From 49ac17bcc72e777b6bc07c8579aa3c0fb0794221 Mon Sep 17 00:00:00 2001 From: akolomentsev Date: Fri, 20 Apr 2018 11:33:52 -0700 Subject: [PATCH] add json schema models code generator --- codegen/jschema-models-gen/.gitignore | 1 + codegen/jschema-models-gen/build.gradle | 47 +++++++++++++ .../codegen/jschema/models/gen/FileModel.java | 24 +++++++ .../jschema/models/gen/FileTemplate.java | 36 ++++++++++ .../codegen/jschema/models/gen/TypeModel.java | 61 +++++++++++++++++ .../jschema/models/gen/TypeTemplate.java | 55 +++++++++++++++ .../satori/codegen/jschema/models/gen/App.kt | 26 +++++++ .../codegen/jschema/models/gen/AppConfig.kt | 23 +++++++ .../codegen/jschema/models/gen/Example.kt | 19 ++++++ .../codegen/jschema/models/gen/ICodeGenEnv.kt | 26 +++++++ .../jschema/models/gen/ModelsCodeGen.kt | 67 +++++++++++++++++++ .../codegen/jschema/models/gen/Utils.kt | 40 +++++++++++ .../templates/File.mustache | 12 ++++ .../templates/Type.mustache | 12 ++++ .../tests/res/logback.groovy | 7 ++ gradle.properties | 5 +- libs/composition-drawer/readme.md | 10 +-- libs/gradle/codegen/readme.md | 6 +- libs/gradle/docker/readme.md | 6 +- libs/gradle/github/readme.md | 6 +- libs/gradle/transform/readme.md | 6 +- libs/gtfs/readme.md | 4 +- metainfo.template.kt | 3 +- readme.md | 4 +- settings.gradle | 3 + 25 files changed, 485 insertions(+), 24 deletions(-) create mode 100644 codegen/jschema-models-gen/.gitignore create mode 100644 codegen/jschema-models-gen/build.gradle create mode 100644 codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/FileModel.java create mode 100644 codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/FileTemplate.java create mode 100644 codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/TypeModel.java create mode 100644 codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/TypeTemplate.java create mode 100644 codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/App.kt create mode 100644 codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/AppConfig.kt create mode 100644 codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/Example.kt create mode 100644 codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/ICodeGenEnv.kt create mode 100644 codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/ModelsCodeGen.kt create mode 100644 codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/Utils.kt create mode 100644 codegen/jschema-models-gen/templates/File.mustache create mode 100644 codegen/jschema-models-gen/templates/Type.mustache create mode 100644 codegen/jschema-models-gen/tests/res/logback.groovy diff --git a/codegen/jschema-models-gen/.gitignore b/codegen/jschema-models-gen/.gitignore new file mode 100644 index 0000000..074fbb9 --- /dev/null +++ b/codegen/jschema-models-gen/.gitignore @@ -0,0 +1 @@ +/meta-info/ \ No newline at end of file diff --git a/codegen/jschema-models-gen/build.gradle b/codegen/jschema-models-gen/build.gradle new file mode 100644 index 0000000..52d94f4 --- /dev/null +++ b/codegen/jschema-models-gen/build.gradle @@ -0,0 +1,47 @@ +apply from: rootProject.file('metainfo.gradle') + +task generateTemplates(type: DependencyExec) { + group 'codegen' + generateCode.dependsOn it + + def out = file("gen") + def templates = fileTree("templates").include("*.mustache") + + inputs.file(templates) + outputs.dir(out) + + sourceSets.main.java.srcDir out + idea.module.generatedSourceDirs += out + + dependency "com.satori:satori-codegen-mustache-builder:$scaffoldingVersion" + main = "com.satori.codegen.mustache.builder.App" + + args "--templates", templates.files.join(File.pathSeparator) + args "--pckg", pckg + args "--out", out + + doFirst { + delete out + println "generating templates ...." + } + + clean.doFirst { + delete out + } +} + +// main dependencies +dependencies { + compile project(":libs-common-kotlin") + compile project(":codegen-utils") + + compile "com.fasterxml.jackson.module:jackson-module-jsonSchema:$jacksonVersion" + compile "com.github.javaparser:javaparser-core:$javaparserVersion" +} + +// test dependencies +dependencies { + testCompile project(":libs-testlib") + testCompile "ch.qos.logback:logback-classic:$logbackVersion" + testCompile "org.codehaus.groovy:groovy-all:$groovyVersion" +} diff --git a/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/FileModel.java b/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/FileModel.java new file mode 100644 index 0000000..8d48409 --- /dev/null +++ b/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/FileModel.java @@ -0,0 +1,24 @@ +//auto generated +//don't modify + + +package com.satori.codegen.jschema.models.gen; + +import java.util.ArrayList; + +public class FileModel { + + public final FileModel _root; + public TypeModel type; + public final ArrayList imports = new ArrayList(); + public String packageName; + + public FileModel() { + _root = this; + } + + public void addImportsItem(String _item) { + imports.add(_item); + } + +} diff --git a/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/FileTemplate.java b/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/FileTemplate.java new file mode 100644 index 0000000..34711a2 --- /dev/null +++ b/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/FileTemplate.java @@ -0,0 +1,36 @@ + +package com.satori.codegen.jschema.models.gen; + +import java.io.Writer; + + +/** + * auto generated + * don't modify + * + */ +public class FileTemplate { + + + public static void render0(Writer _os, String _model, boolean _last) + throws Exception + { + _os.write("import "); + _os.write(_model); + _os.write(";\n"); + } + + public static void render(Writer _os, FileModel _model) + throws Exception + { + _os.write("// auto generated\n// don't modify\npackage "); + _os.write(_model.packageName); + _os.write(";\n\n\nimport com.fasterxml.jackson.annotation.*;\n\n"); + for(int _i=0; _i< _model.imports.size(); _i+=1){ + render0(_os, _model.imports.get(_i), (_i+1) >= _model.imports.size()); + } + _os.write("\n"); + TypeTemplate.render(_os, _model.type); + } + +} diff --git a/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/TypeModel.java b/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/TypeModel.java new file mode 100644 index 0000000..2ad8941 --- /dev/null +++ b/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/TypeModel.java @@ -0,0 +1,61 @@ +//auto generated +//don't modify + + +package com.satori.codegen.jschema.models.gen; + +import java.util.ArrayList; + +public class TypeModel { + + public final TypeModel _root; + public boolean isStatic; + public final ArrayList types = new ArrayList(); + public String className; + public final ArrayList properties = new ArrayList(); + + public TypeModel() { + _root = this; + } + + public TypesItem addTypesItem() { + TypesItem _item = new TypesItem(_root, this); + types.add(_item); + return _item; + } + + public PropertiesItem addPropertiesItem() { + PropertiesItem _item = new PropertiesItem(_root, this); + properties.add(_item); + return _item; + } + + public class PropertiesItem { + + public final TypeModel _root; + public final TypeModel _parent; + public String varName; + public String schemaName; + public String type; + + public PropertiesItem(TypeModel _root, TypeModel _parent) { + this._root = _root; + this._parent = _parent; + } + + } + + public class TypesItem { + + public final TypeModel _root; + public final TypeModel _parent; + public TypeModel type; + + public TypesItem(TypeModel _root, TypeModel _parent) { + this._root = _root; + this._parent = _parent; + } + + } + +} diff --git a/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/TypeTemplate.java b/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/TypeTemplate.java new file mode 100644 index 0000000..cd3493b --- /dev/null +++ b/codegen/jschema-models-gen/gen/com/satori/codegen/jschema/models/gen/TypeTemplate.java @@ -0,0 +1,55 @@ + +package com.satori.codegen.jschema.models.gen; + +import java.io.Writer; + + +/** + * auto generated + * don't modify + * + */ +public class TypeTemplate { + + + public static void render0(Writer _os, TypeModel.PropertiesItem _model, boolean _last) + throws Exception + { + _os.write(" @JsonProperty(\""); + _os.write(_model.schemaName); + _os.write("\")\n public "); + _os.write(_model.type); + _os.write(" "); + _os.write(_model.varName); + _os.write(";\n"); + } + + public static void render1(Writer _os, TypeModel.TypesItem _model, boolean _last) + throws Exception + { + _os.write(" "); + TypeTemplate.render(_os, _model.type); + _os.write("\n"); + } + + public static void render(Writer _os, TypeModel _model) + throws Exception + { + _os.write("@JsonInclude(JsonInclude.Include.NON_DEFAULT)\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic "); + if( _model.isStatic ) { + _os.write("static"); + } + _os.write(" class "); + _os.write(_model.className); + _os.write(" {\n"); + for(int _i=0; _i< _model.properties.size(); _i+=1){ + render0(_os, _model.properties.get(_i), (_i+1) >= _model.properties.size()); + } + _os.write("\n"); + for(int _i=0; _i< _model.types.size(); _i+=1){ + render1(_os, _model.types.get(_i), (_i+1) >= _model.types.size()); + } + _os.write("}"); + } + +} diff --git a/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/App.kt b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/App.kt new file mode 100644 index 0000000..3a259d7 --- /dev/null +++ b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/App.kt @@ -0,0 +1,26 @@ +package com.satori.codegen.jschema.models.gen + +import com.satori.libs.common.kotlin.json.* + +object App : IJsonContext by DefaultJsonContext { + @JvmStatic + fun main(vararg args: String) { + println(MetaInfo) + println("java version: ${System.getProperty("java.version")}") + + val cfg = jsonObject { + val itor = args.iterator() + while (true) { + val name = if (itor.hasNext()) itor.next() else break + val value = if (itor.hasNext()) itor.next() else throw Exception("argument value is missing") + if (!name.startsWith("--")) throw Exception("argument '$name' should start with '--'") + field(name, value) + } + }.scope { toValue() } + + val env = ICodeGenEnv.Default(cfg) + ModelsCodeGen.run(env) + } +} + + diff --git a/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/AppConfig.kt b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/AppConfig.kt new file mode 100644 index 0000000..50157bb --- /dev/null +++ b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/AppConfig.kt @@ -0,0 +1,23 @@ +package com.satori.codegen.jschema.models.gen + +import com.fasterxml.jackson.annotation.* + +@JsonInclude(JsonInclude.Include.NON_DEFAULT) +class AppConfig { + @JsonProperty("--pckg") + var pckg: String = "" + + @JsonProperty("--schema") + var schema: String? = null + + @JsonProperty("--out") + var out: String = "" + + @JsonProperty("--name") + var name: String? = null + + @JsonProperty("--prefix") + var prefix: String = "" +} + + diff --git a/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/Example.kt b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/Example.kt new file mode 100644 index 0000000..aee81ba --- /dev/null +++ b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/Example.kt @@ -0,0 +1,19 @@ +@file:JvmName("Example") + +package com.satori.codegen.jschema.models.gen + +import java.io.* + +fun main(args: Array) { + + File("core/.tests-data").deleteRecursively() + + val cfg = AppConfig().apply { + pckg = javaClass.`package`.name + schema = "core/codegen/schema.json" + out = "core/.tests-data" + } + + val env = ICodeGenEnv.Default(cfg) + ModelsCodeGen.run(env) +} diff --git a/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/ICodeGenEnv.kt b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/ICodeGenEnv.kt new file mode 100644 index 0000000..01fd651 --- /dev/null +++ b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/ICodeGenEnv.kt @@ -0,0 +1,26 @@ +package com.satori.codegen.jschema.models.gen + +import com.fasterxml.jackson.module.jsonSchema.* +import com.satori.codegen.utils.* +import com.satori.libs.common.kotlin.json.* +import java.nio.file.* + +interface ICodeGenEnv : IJsonContext { + val cfg: AppConfig + val schema: JsonSchema + val fmt: ICodeFormatter + get() = CodeFormatter + + fun path(pckg: String, fileName: String): Path { + val pckgDir = pckg.replace(".", "/") + return Paths.get("${cfg.out}/$pckgDir/$fileName") + } + + class Default(cfg: AppConfig) : ICodeGenEnv { + override val mapper = DefaultJsonContext.mapper + override val cfg = cfg + override val schema = loadSchema(cfg.schema + ?: throw Exception("missing '--schema' argument")) + } + +} diff --git a/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/ModelsCodeGen.kt b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/ModelsCodeGen.kt new file mode 100644 index 0000000..5220295 --- /dev/null +++ b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/ModelsCodeGen.kt @@ -0,0 +1,67 @@ +package com.satori.codegen.jschema.models.gen + +import com.fasterxml.jackson.module.jsonSchema.* +import com.fasterxml.jackson.module.jsonSchema.types.* + +class ModelsCodeGen(env: ICodeGenEnv) : ICodeGenEnv by env { + + fun run() { + val model = FileModel() + + if (schema !is ObjectSchema) { + println("schema is no an object") + return + } + + val className = fmt.className(cfg.name ?: throw Exception("--name not specified")) + model.packageName = cfg.pckg + + model.type = TypeModel().also { + it.className = className + processProperties(it, schema) + } + + + + writeJavaClass(className) { + FileTemplate.render(it, model) + } + } + + fun processProperties(model: TypeModel, schema: ObjectSchema) { + for ((k, v) in schema.properties) { + model.addPropertiesItem().apply { + this.schemaName = k + this.varName = fmt.varName(k) + this.type = typeForSchema(k, v) + } + if (v.isObjectSchema) { + model.addTypesItem().apply { + type = TypeModel().also { + it.isStatic = true + it.className = fmt.className(k) + processProperties(it, v.asObjectSchema()) + } + } + } + } + } + + fun typeForSchema(propName: String, schema: JsonSchema): String { + if (schema.isStringSchema) return "String" + if (schema.isBooleanSchema) return "Boolean" + if (schema.isIntegerSchema) return "Integer" + if (schema.isNumberSchema) return "Double" + if (schema.isAnySchema) return "JsonNode" + if (schema.isObjectSchema) return fmt.className(propName) + throw Exception("type '$schema' not supported") + } + + companion object { + + fun run(env: ICodeGenEnv) { + ModelsCodeGen(env).run() + } + + } +} diff --git a/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/Utils.kt b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/Utils.kt new file mode 100644 index 0000000..7703612 --- /dev/null +++ b/codegen/jschema-models-gen/src/com/satori/codegen/jschema/models/gen/Utils.kt @@ -0,0 +1,40 @@ +package com.satori.codegen.jschema.models.gen + +import com.fasterxml.jackson.module.jsonSchema.* +import com.satori.libs.common.kotlin.* +import com.satori.libs.common.kotlin.json.* +import java.io.* +import java.nio.file.* + +fun ICodeGenEnv.loadSchema(path: String): JsonSchema { + println("reading schema '$path'...") + Files.newInputStream(Paths.get(path)).use { + return jsonParse(it) + } +} + +fun List.concat(): String { + val sb = StringBuilder() + forEach { sb.append(it) } + return sb.toString() +} + +fun ICodeGenEnv.writeJavaClass(className: String, block: (Writer) -> Unit) { + file(path(cfg.pckg, "${className}.java")) { + write { os -> + os.writer().use { ow -> + block(ow) + } + } + /*val code = StringWriter().use { + block(it) + it.toString() + } + println(code) + val cu = JavaParser.parse(code)*/ + //write(cu.toString()) + println("file generated '${path.fileName}' ('${path}')") + println("verifying '${path.fileName}' ('${path}')...") + //JavaParser.parse(path) + } +} diff --git a/codegen/jschema-models-gen/templates/File.mustache b/codegen/jschema-models-gen/templates/File.mustache new file mode 100644 index 0000000..f2c12aa --- /dev/null +++ b/codegen/jschema-models-gen/templates/File.mustache @@ -0,0 +1,12 @@ +// auto generated +// don't modify +package {{packageName}}; + + +import com.fasterxml.jackson.annotation.*; + +{{#imports*}} +import {{this}}; +{{/imports*}} + +{{>Type}} \ No newline at end of file diff --git a/codegen/jschema-models-gen/templates/Type.mustache b/codegen/jschema-models-gen/templates/Type.mustache new file mode 100644 index 0000000..5b9c791 --- /dev/null +++ b/codegen/jschema-models-gen/templates/Type.mustache @@ -0,0 +1,12 @@ +@JsonInclude(JsonInclude.Include.NON_DEFAULT) +@JsonIgnoreProperties(ignoreUnknown = true) +public {{#isStatic?}}static{{/isStatic?}} class {{className}} { + {{#properties*}} + @JsonProperty("{{schemaName}}") + public {{type}} {{varName}}; + {{/properties*}} + + {{#types*}} + {{>Type}} + {{/types*}} +} \ No newline at end of file diff --git a/codegen/jschema-models-gen/tests/res/logback.groovy b/codegen/jschema-models-gen/tests/res/logback.groovy new file mode 100644 index 0000000..8797e0c --- /dev/null +++ b/codegen/jschema-models-gen/tests/res/logback.groovy @@ -0,0 +1,7 @@ +appender("console", ConsoleAppender) { + encoder(PatternLayoutEncoder) { + pattern = "%d{yy/MM/dd HH:mm:ss.SSS} %thread [%level] %logger - %msg%n%ex{full}" + } +} + +root(INFO, ["console"]) diff --git a/gradle.properties b/gradle.properties index a6a5d61..06663fe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group=com.satori -version=0.5.62-SNAPSHOT +version=0.5.63-SNAPSHOT scaffoldingVersion=0.5.61-SNAPSHOT @@ -20,4 +20,5 @@ logbackVersion=1.2.3 groovyVersion=2.4.14 codemodelVersion=2.6 protobufVersion=3.5.1 -spullaraVersion=0.9.5 \ No newline at end of file +spullaraVersion=0.9.5 +javaparserVersion=3.5.+ \ No newline at end of file diff --git a/libs/composition-drawer/readme.md b/libs/composition-drawer/readme.md index 668a5bd..29191b1 100644 --- a/libs/composition-drawer/readme.md +++ b/libs/composition-drawer/readme.md @@ -20,7 +20,7 @@ buildscript{ maven {url "https://oss.sonatype.org/content/repositories/snapshots"} } dependencies { - classpath "com.satori:satori-libs-composition-drawer:0.5.62-SNAPSHOT" + classpath "com.satori:satori-libs-composition-drawer:0.5.63-SNAPSHOT" } } apply plugin: "com.satori.composition.drawer" @@ -43,7 +43,7 @@ buildscript{ maven { url "https://oss.sonatype.org/content/repositories/snapshots"} } dependencies { - classpath "com.satori:satori-libs-composition-drawer:0.5.62-SNAPSHOT" + classpath "com.satori:satori-libs-composition-drawer:0.5.63-SNAPSHOT" } } @@ -72,7 +72,7 @@ repositories { configurations{compositionDrawer} dependencies { - compositionDrawer "com.satori:satori-libs-composition-drawer:0.5.62-SNAPSHOT" + compositionDrawer "com.satori:satori-libs-composition-drawer:0.5.63-SNAPSHOT" } task generateCompositionDiagram(type: JavaExec) { @@ -110,13 +110,13 @@ task generateCompositionDiagram(type: JavaExec) { com.satori satori-libs-composition-drawer - 0.5.62-SNAPSHOT + 0.5.63-SNAPSHOT ``` ### Download -[satori-libs-composition-drawer.v0.5.62-SNAPSHOT.zip](https://github.com/satori-com/satori-composer/releases/download/v0.5.62-SNAPSHOT/satori-libs-composition-drawer.v0.5.62-SNAPSHOT.zip)
+[satori-libs-composition-drawer.v0.5.63-SNAPSHOT.zip](https://github.com/satori-com/satori-composer/releases/download/v0.5.63-SNAPSHOT/satori-libs-composition-drawer.v0.5.63-SNAPSHOT.zip)
[or see latest releases](https://github.com/satori-com/satori-composer/releases/latest) ### Example of generated diagram diff --git a/libs/gradle/codegen/readme.md b/libs/gradle/codegen/readme.md index 55b5b89..f43b1cd 100644 --- a/libs/gradle/codegen/readme.md +++ b/libs/gradle/codegen/readme.md @@ -1,4 +1,4 @@ -[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-libs-gradle-codegen.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-libs-gradle-codegen/0.5.62-SNAPSHOT/) +[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-libs-gradle-codegen.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-libs-gradle-codegen/0.5.63-SNAPSHOT/) ## 'codegen' gradle plugin @@ -13,7 +13,7 @@ buildscript{ maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } dependencies { - classpath "com.satori:satori-libs-gradle-codegen:0.5.62-SNAPSHOT" + classpath "com.satori:satori-libs-gradle-codegen:0.5.63-SNAPSHOT" } } apply plugin: "com.satori.codegen" @@ -122,6 +122,6 @@ task generateGraphqlClasses { com.satori satori-libs-gradle-codegen - 0.5.62-SNAPSHOT + 0.5.63-SNAPSHOT ``` diff --git a/libs/gradle/docker/readme.md b/libs/gradle/docker/readme.md index 32ff41e..6282fa2 100644 --- a/libs/gradle/docker/readme.md +++ b/libs/gradle/docker/readme.md @@ -1,4 +1,4 @@ -[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-libs-gradle-docker.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-libs-gradle-docker/0.5.62-SNAPSHOT/) +[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-libs-gradle-docker.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-libs-gradle-docker/0.5.63-SNAPSHOT/) ## Gradle plugin 'com.satori.transform' @@ -14,7 +14,7 @@ buildscript{ maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } dependencies { - classpath "com.satori:satori-libs-gradle-docker:0.5.62-SNAPSHOT" + classpath "com.satori:satori-libs-gradle-docker:0.5.63-SNAPSHOT" } } apply plugin: "com.satori.docker" @@ -146,6 +146,6 @@ stop docker container com.satori satori-libs-gradle-docker - 0.5.62-SNAPSHOT + 0.5.63-SNAPSHOT ``` diff --git a/libs/gradle/github/readme.md b/libs/gradle/github/readme.md index b961ca1..4752b4c 100644 --- a/libs/gradle/github/readme.md +++ b/libs/gradle/github/readme.md @@ -1,4 +1,4 @@ -[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-libs-gradle-github.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-libs-gradle-github/0.5.62-SNAPSHOT/) +[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-libs-gradle-github.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-libs-gradle-github/0.5.63-SNAPSHOT/) ## 'github' gradle plugin tasks for management github releases using [Github Releases API v3](https://developer.github.com/v3/repos/releases/) @@ -10,7 +10,7 @@ buildscript{ maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } dependencies { - classpath "com.satori:satori-libs-gradle-github:0.5.62-SNAPSHOT" + classpath "com.satori:satori-libs-gradle-github:0.5.63-SNAPSHOT" } } apply plugin: "com.satori.github" @@ -43,6 +43,6 @@ task githubPublishRelease(type: GitHubPublishReleaseTask) { com.satori satori-libs-gradle-github - 0.5.62-SNAPSHOT + 0.5.63-SNAPSHOT ``` diff --git a/libs/gradle/transform/readme.md b/libs/gradle/transform/readme.md index e0d091a..6fc564e 100644 --- a/libs/gradle/transform/readme.md +++ b/libs/gradle/transform/readme.md @@ -1,4 +1,4 @@ -[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-libs-gradle-transform.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-libs-gradle-transform/0.5.62-SNAPSHOT/) +[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-libs-gradle-transform.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-libs-gradle-transform/0.5.63-SNAPSHOT/) ## Gradle plugin 'com.satori.transform' gradle task wrappers around groovy [GStringTemplateEngine](http://docs.groovy-lang.org/next/html/documentation/template-engines.html#_gstringtemplateengine) @@ -12,7 +12,7 @@ buildscript{ maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } dependencies { - classpath "com.satori:satori-libs-gradle-docker:0.5.62-SNAPSHOT" + classpath "com.satori:satori-libs-gradle-docker:0.5.63-SNAPSHOT" } } apply plugin: "com.satori.docker" @@ -59,6 +59,6 @@ task generateReadme { com.satori satori-libs-gradle-transform - 0.5.62-SNAPSHOT + 0.5.63-SNAPSHOT ``` diff --git a/libs/gtfs/readme.md b/libs/gtfs/readme.md index 62f362c..6231545 100644 --- a/libs/gtfs/readme.md +++ b/libs/gtfs/readme.md @@ -14,13 +14,13 @@ classes are generated based on [gtfs-realtime.proto](https://developers.google.c com.satori satori-libs-gtfs - 0.5.62-SNAPSHOT + 0.5.63-SNAPSHOT ``` ### Download -[satori-libs-gtfs.v0.5.62-SNAPSHOT.zip](https://github.com/satori-com/satori-composer/releases/download/v0.5.62-SNAPSHOT/satori-libs-gtfs.v0.5.62-SNAPSHOT.zip)
+[satori-libs-gtfs.v0.5.63-SNAPSHOT.zip](https://github.com/satori-com/satori-composer/releases/download/v0.5.63-SNAPSHOT/satori-libs-gtfs.v0.5.63-SNAPSHOT.zip)
[or see latest releases](https://github.com/satori-com/satori-composer/releases/latest) ### Examples diff --git a/metainfo.template.kt b/metainfo.template.kt index 20dd48f..779af3b 100644 --- a/metainfo.template.kt +++ b/metainfo.template.kt @@ -22,7 +22,8 @@ object ${model.className} { override fun toString(): String { val sb = StringBuilder() - + sb.append(group) + sb.append(":") sb.append(project) sb.append(":") sb.append(version) diff --git a/readme.md b/readme.md index e368aec..7603f1a 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ ## Satori Composer (preview) [![Build Status](https://travis-ci.org/satori-com/satori-composer.svg?branch=dev)](https://travis-ci.org/satori-com/satori-composer) -[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-composer.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-composer/0.5.62-SNAPSHOT/) +[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-composer.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-composer/0.5.63-SNAPSHOT/) #### Example ![diagram](mods-examples/big-blue-bus/docs/files/diagram.png) @@ -99,7 +99,7 @@ com.satori satori-composer - 0.5.62-SNAPSHOT + 0.5.63-SNAPSHOT ``` diff --git a/settings.gradle b/settings.gradle index 5a0d870..75a1ef5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -33,6 +33,9 @@ project(':codegen-jpoet-dsl-example').projectDir = file('codegen/jpoet-dsl-examp include ':codegen-mustache-builder' project(':codegen-mustache-builder').projectDir = file('codegen/mustache-builder') +include ':codegen-jschema-models-gen' +project(':codegen-jschema-models-gen').projectDir = file('codegen/jschema-models-gen') + // libs include ':libs-async-api'