From 53895b440c854c7b9df2547d795cf0eca2d8e01c Mon Sep 17 00:00:00 2001 From: akolomentsev Date: Thu, 5 Apr 2018 20:42:56 -0700 Subject: [PATCH] remove buildSrc directory --- build.gradle | 72 ++++++++----------- buildSrc/build.gradle | 14 ---- buildSrc/gradle.properties | 1 - gradle.properties | 4 +- libs/composition-drawer/build.gradle | 1 + libs/composition-drawer/readme.md | 6 +- .../com.satori.composition.drawer.properties | 1 + .../drawer/CompositionDrawerPlugin.kt | 11 +++ .../drawer/GenerateCompositionDiagramTask.kt} | 6 +- libs/gradle/github/build.gradle | 2 + .../com.satori.github.properties | 1 + .../gradle/github}/GitHubDeleteReleaseTask.kt | 2 + .../gradle/github}/GitHubListReleasesTask.kt | 2 + .../satori/libs/gradle/github/GitHubPlugin.kt | 13 ++++ .../github}/GitHubPublishReleaseTask.kt | 4 +- .../satori/libs/gradle/github/GitHubTask.kt | 52 +++++++------- libs/gradle/transform/build.gradle | 2 + .../com.satori.transform.properties | 1 + .../libs/gradle/transform/TransformPlugin.kt | 21 ++++++ .../libs/gradle/transform}/TransformTask.kt | 3 +- .../libs/gradle/utils/ProjectExtensions.kt | 7 ++ libs/gtfs/readme.md | 4 +- mods-examples/examples.gradle | 2 +- readme.md | 15 ++-- readme.template.md | 5 +- settings.gradle | 8 ++- 26 files changed, 154 insertions(+), 106 deletions(-) delete mode 100644 buildSrc/build.gradle delete mode 100644 buildSrc/gradle.properties create mode 100644 libs/composition-drawer/res/META-INF/gradle-plugins/com.satori.composition.drawer.properties create mode 100644 libs/composition-drawer/src/com/satori/libs/composition/drawer/CompositionDrawerPlugin.kt rename libs/composition-drawer/src/{GenerateCompositionImageTask.kt => com/satori/libs/composition/drawer/GenerateCompositionDiagramTask.kt} (95%) create mode 100644 libs/gradle/github/res/META-INF/gradle-plugins/com.satori.github.properties rename libs/gradle/github/src/{ => com/satori/libs/gradle/github}/GitHubDeleteReleaseTask.kt (93%) rename libs/gradle/github/src/{ => com/satori/libs/gradle/github}/GitHubListReleasesTask.kt (88%) create mode 100644 libs/gradle/github/src/com/satori/libs/gradle/github/GitHubPlugin.kt rename libs/gradle/github/src/{ => com/satori/libs/gradle/github}/GitHubPublishReleaseTask.kt (95%) create mode 100644 libs/gradle/transform/res/META-INF/gradle-plugins/com.satori.transform.properties create mode 100644 libs/gradle/transform/src/com/satori/libs/gradle/transform/TransformPlugin.kt rename libs/gradle/transform/src/{ => com/satori/libs/gradle/transform}/TransformTask.kt (89%) create mode 100644 libs/gradle/utils/src/com/satori/libs/gradle/utils/ProjectExtensions.kt diff --git a/build.gradle b/build.gradle index 7b00d46..282319f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,22 @@ +gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS + buildscript { repositories { mavenCentral() + maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" + + classpath "com.satori:satori-libs-gradle-transform:$scaffoldingVersion" + classpath "com.satori:satori-libs-gradle-github:$scaffoldingVersion" + classpath "com.satori:satori-libs-composition-drawer:$scaffoldingVersion" } } -import com.satori.libs.gradle.transform.* - -gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS +apply plugin: "com.satori.transform" +apply plugin: "com.satori.github" +apply plugin: "com.satori.composition.drawer" apply plugin: 'idea' @@ -32,50 +39,28 @@ idea { ext { pckg = group pckgDir = pckg.replace('.', '/') + examples = container(Object) } -afterEvaluate { - task generateBigBlueBusImage(type: JavaExec) { - group 'codegen' - - def cfgPath = project(":mods-examples-big-blue-bus").file("res/com/satori/mods/resources/config.json") - def imgPath = rootProject.file("docs/files/big-blue-bus-composition.png") - - inputs.file(cfgPath) - outputs.file(imgPath) - - classpath project(":libs-composition-drawer").sourceSets.main.output - classpath project(":libs-composition-drawer").configurations.runtime - - main = "${project(":libs-composition-drawer").pckg}.App" - args "--cfg-path", cfgPath - args "--img-path", imgPath - - doFirst { - println "generating composition diagram ...." - println commandLine.join(" ") - } - } - - task generateReadme(type: TransformTask) { - group 'codegen' - dependsOn generateBigBlueBusImage - template = file('readme.template.md') - output = file('readme.md') - outputs.upToDateWhen { false } - } - - tasks.generateReadme.execute() - +task generateCode { + group "codegen" +} +task classes { + dependsOn generateCode + group "build" +} +task build { + dependsOn classes + group "build" } -void transform(Closure closure) { - def spec = new TransformSpec(project) - closure.delegate = spec - closure.resolveStrategy = Closure.DELEGATE_FIRST - closure() - Transform.execute(spec, project) +task generateReadme(type: TransformTask) { + group 'codegen' + template = file('readme.template.md') + output = file('readme.md') + //outputs.upToDateWhen { false } } +generateCode.dependsOn generateReadme allprojects { task info() { @@ -146,7 +131,7 @@ subprojects { dependencies { } - sourceSets.all {sourceSet -> + sourceSets.all { sourceSet -> def n = sourceSet.name n = n != "main" ? n.capitalize() : "" def taskName = "generate${n}Code" @@ -267,6 +252,7 @@ task githubListReleases(type: GitHubListReleasesTask) { } task githubPublishRelease(type: GitHubPublishReleaseTask) { + dependsOn generateCode url = githubUrl if (project.hasProperty('githubAuthToken')) { authToken = githubAuthToken diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index d33fe7f..0000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -buildDir = '.out' - -sourceSets.main.java.srcDirs = ['src'] -sourceSets.main.resources.srcDirs = ['res'] - -repositories { - mavenCentral() - maven {url "https://oss.sonatype.org/content/repositories/snapshots/"} -} -dependencies { - compile "com.satori:satori-libs-gradle-transform:$scaffoldingVersion" - compile "com.satori:satori-libs-gradle-github:$scaffoldingVersion" - compile "com.satori:satori-libs-composition-drawer:$scaffoldingVersion" -} diff --git a/buildSrc/gradle.properties b/buildSrc/gradle.properties deleted file mode 100644 index 8d101bd..0000000 --- a/buildSrc/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -scaffoldingVersion=0.5.16-SNAPSHOT diff --git a/gradle.properties b/gradle.properties index bb2adc2..1cbc26a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group=com.satori -version=0.5.17-SNAPSHOT +version=0.5.22-SNAPSHOT -scaffoldingVersion=0.5.16-SNAPSHOT +scaffoldingVersion=0.5.21-SNAPSHOT #nexusUsername= #nexusPassword= diff --git a/libs/composition-drawer/build.gradle b/libs/composition-drawer/build.gradle index 31c5221..84bba46 100644 --- a/libs/composition-drawer/build.gradle +++ b/libs/composition-drawer/build.gradle @@ -4,6 +4,7 @@ apply from: rootProject.file('readme.gradle') // main dependencies dependencies { compile project(":composer") + compile project(":libs-gradle-utils") compile "org.slf4j:slf4j-api:$slf4jVersion" diff --git a/libs/composition-drawer/readme.md b/libs/composition-drawer/readme.md index 3a0faf9..10fbe19 100644 --- a/libs/composition-drawer/readme.md +++ b/libs/composition-drawer/readme.md @@ -22,7 +22,7 @@ buildscript{ } } dependencies { - classpath "com.satori:satori-libs-composition-drawer:0.5.17-SNAPSHOT" + classpath "com.satori:satori-libs-composition-drawer:0.5.22-SNAPSHOT" } } @@ -47,7 +47,7 @@ repositories { configurations{compositionDrawer} dependencies { - compositionDrawer "com.satori:satori-libs-composition-drawer:0.5.17-SNAPSHOT" + compositionDrawer "com.satori:satori-libs-composition-drawer:0.5.22-SNAPSHOT" } task generateCompositionDiagram(type: JavaExec) { @@ -85,7 +85,7 @@ task generateCompositionDiagram(type: JavaExec) { com.satori satori-libs-composition-drawer - 0.5.17-SNAPSHOT + 0.5.22-SNAPSHOT ``` diff --git a/libs/composition-drawer/res/META-INF/gradle-plugins/com.satori.composition.drawer.properties b/libs/composition-drawer/res/META-INF/gradle-plugins/com.satori.composition.drawer.properties new file mode 100644 index 0000000..40c3109 --- /dev/null +++ b/libs/composition-drawer/res/META-INF/gradle-plugins/com.satori.composition.drawer.properties @@ -0,0 +1 @@ +implementation-class=com.satori.libs.composition.drawer.CompositionDrawerPlugin \ No newline at end of file diff --git a/libs/composition-drawer/src/com/satori/libs/composition/drawer/CompositionDrawerPlugin.kt b/libs/composition-drawer/src/com/satori/libs/composition/drawer/CompositionDrawerPlugin.kt new file mode 100644 index 0000000..e1d7a1c --- /dev/null +++ b/libs/composition-drawer/src/com/satori/libs/composition/drawer/CompositionDrawerPlugin.kt @@ -0,0 +1,11 @@ +package com.satori.libs.composition.drawer + +import com.satori.libs.gradle.utils.* +import org.gradle.api.* + +open class CompositionDrawerPlugin : Plugin { + + override fun apply(project: Project) { + project.addExtension("GenerateCompositionDiagramTask", GenerateCompositionDiagramTask::class.java) + } +} \ No newline at end of file diff --git a/libs/composition-drawer/src/GenerateCompositionImageTask.kt b/libs/composition-drawer/src/com/satori/libs/composition/drawer/GenerateCompositionDiagramTask.kt similarity index 95% rename from libs/composition-drawer/src/GenerateCompositionImageTask.kt rename to libs/composition-drawer/src/com/satori/libs/composition/drawer/GenerateCompositionDiagramTask.kt index f8fc595..ee4e528 100644 --- a/libs/composition-drawer/src/GenerateCompositionImageTask.kt +++ b/libs/composition-drawer/src/com/satori/libs/composition/drawer/GenerateCompositionDiagramTask.kt @@ -1,5 +1,6 @@ +package com.satori.libs.composition.drawer + import com.mxgraph.util.* -import com.satori.libs.composition.drawer.* import org.gradle.api.* import org.gradle.api.tasks.* import java.awt.* @@ -26,10 +27,9 @@ open class GenerateCompositionDiagramTask : DefaultTask() { @TaskAction fun generateImage() { println(MetaInfo) - val cfgPath = cfgPath ?: throw Exception("cfgPath not specified") - + cfgPath.toPath().parent.toFile().mkdirs() val graph = createGraph( cfgPath ?: throw Exception("cfgPath not specified"), diff --git a/libs/gradle/github/build.gradle b/libs/gradle/github/build.gradle index 67dcee0..dcc2bc8 100644 --- a/libs/gradle/github/build.gradle +++ b/libs/gradle/github/build.gradle @@ -1,6 +1,8 @@ // main dependencies dependencies { + compile project(":libs-gradle-utils") + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion" diff --git a/libs/gradle/github/res/META-INF/gradle-plugins/com.satori.github.properties b/libs/gradle/github/res/META-INF/gradle-plugins/com.satori.github.properties new file mode 100644 index 0000000..393fb11 --- /dev/null +++ b/libs/gradle/github/res/META-INF/gradle-plugins/com.satori.github.properties @@ -0,0 +1 @@ +implementation-class=com.satori.libs.gradle.github.GitHubPlugin \ No newline at end of file diff --git a/libs/gradle/github/src/GitHubDeleteReleaseTask.kt b/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubDeleteReleaseTask.kt similarity index 93% rename from libs/gradle/github/src/GitHubDeleteReleaseTask.kt rename to libs/gradle/github/src/com/satori/libs/gradle/github/GitHubDeleteReleaseTask.kt index f9f8711..36ea332 100644 --- a/libs/gradle/github/src/GitHubDeleteReleaseTask.kt +++ b/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubDeleteReleaseTask.kt @@ -1,3 +1,5 @@ +package com.satori.libs.gradle.github + import org.gradle.api.tasks.* open class GitHubDeleteReleaseTask : GitHubTask() { diff --git a/libs/gradle/github/src/GitHubListReleasesTask.kt b/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubListReleasesTask.kt similarity index 88% rename from libs/gradle/github/src/GitHubListReleasesTask.kt rename to libs/gradle/github/src/com/satori/libs/gradle/github/GitHubListReleasesTask.kt index 8d9c0a5..c615fd1 100644 --- a/libs/gradle/github/src/GitHubListReleasesTask.kt +++ b/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubListReleasesTask.kt @@ -1,3 +1,5 @@ +package com.satori.libs.gradle.github + import org.gradle.api.tasks.* open class GitHubListReleasesTask : GitHubTask() { diff --git a/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubPlugin.kt b/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubPlugin.kt new file mode 100644 index 0000000..cdba167 --- /dev/null +++ b/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubPlugin.kt @@ -0,0 +1,13 @@ +package com.satori.libs.gradle.github + +import com.satori.libs.gradle.utils.* +import org.gradle.api.* + +open class GitHubPlugin : Plugin { + + override fun apply(project: Project) { + project.addExtension("GitHubPublishReleaseTask", GitHubPublishReleaseTask::class.java) + project.addExtension("GitHubDeleteReleaseTask", GitHubDeleteReleaseTask::class.java) + project.addExtension("GitHubListReleasesTask", GitHubListReleasesTask::class.java) + } +} \ No newline at end of file diff --git a/libs/gradle/github/src/GitHubPublishReleaseTask.kt b/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubPublishReleaseTask.kt similarity index 95% rename from libs/gradle/github/src/GitHubPublishReleaseTask.kt rename to libs/gradle/github/src/com/satori/libs/gradle/github/GitHubPublishReleaseTask.kt index 53afe5f..cfcc82b 100644 --- a/libs/gradle/github/src/GitHubPublishReleaseTask.kt +++ b/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubPublishReleaseTask.kt @@ -1,3 +1,5 @@ +package com.satori.libs.gradle.github + import com.damnhandy.uri.template.* import com.fasterxml.jackson.annotation.* import org.gradle.api.* @@ -61,7 +63,7 @@ open class GitHubPublishReleaseTask : GitHubTask() { request("DELETE", "releases/${release["id"].asText()}").get() } - val body = jsonTree(Request().apply { + val body = GitHubTask.jsonTree(Request().apply { tagName = releaseTag targetCommitish = releaseBranch name = releaseName diff --git a/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubTask.kt b/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubTask.kt index 4e8c0ca..5f16b75 100644 --- a/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubTask.kt +++ b/libs/gradle/github/src/com/satori/libs/gradle/github/GitHubTask.kt @@ -1,3 +1,5 @@ +package com.satori.libs.gradle.github + import com.fasterxml.jackson.core.* import com.fasterxml.jackson.core.type.* import com.fasterxml.jackson.databind.* @@ -8,16 +10,15 @@ import java.io.* import java.net.* import java.nio.charset.* - open class GitHubTask : DefaultTask() { - + init { group = "github" } - + var url: String? = null var authToken: String? = null - + data class ApiResult(val status: Int, val message: String?, val content: JsonNode?) { fun isSucceeded() = status in 200..299 fun notFound() = status == HttpURLConnection.HTTP_NOT_FOUND @@ -27,36 +28,36 @@ open class GitHubTask : DefaultTask() { } return content } - + inline fun getAs(): T? = jsonMap(get()) } - + fun get(path: String) = request("GET", path) fun head(path: String) = request("HEAD", path) fun post(path: String, content: JsonNode?) = request("POST", path, content) fun delete(path: String) = request("DELETE", path) - + fun upload(path: String, contentType: String? = null, content: InputStream): ApiResult { val uri = URI(url).resolve(path) val con = uri.toURL().openConnection() as HttpURLConnection con.requestMethod = "POST" - + if (!authToken.isNullOrBlank()) { con.setRequestProperty("Authorization", "token $authToken") } //con.setChunkedStreamingMode(-1); con.setRequestProperty("Accept", "application/json") - + if (contentType !== null) { con.setRequestProperty("Content-Type", contentType) } con.doOutput = true - + println("${con.requestMethod} '$uri' ...") con.connect() try { con.outputStream.use { out -> - + val buf = ByteArray(1024) while (true) { val read = content.read(buf) @@ -67,7 +68,7 @@ open class GitHubTask : DefaultTask() { } out.flush() } - + (if (con.responseCode >= 400) con.errorStream else con.inputStream).use { inputStream -> val apiResult = ApiResult( status = con.responseCode, @@ -81,23 +82,23 @@ open class GitHubTask : DefaultTask() { con.disconnect() } } - + fun request(method: String, path: String, content: JsonNode? = null): ApiResult { - + val uri = URI(url).resolve(path) val con = uri.toURL().openConnection() as HttpURLConnection con.requestMethod = method - + if (!authToken.isNullOrBlank()) { con.setRequestProperty("Authorization", "token $authToken") } con.setRequestProperty("Accept", "application/json") - + if (content !== null && !content.isMissingNode) { con.setRequestProperty("Content-Type", "application/json") con.doOutput = true } - + println("$method '$uri' ${jsonFormat(content)}...") con.connect() try { @@ -107,7 +108,7 @@ open class GitHubTask : DefaultTask() { w.flush() } } - + (if (con.responseCode >= 400) con.errorStream else con.inputStream).use { inputStream -> val apiResult = ApiResult( status = con.responseCode, @@ -121,8 +122,7 @@ open class GitHubTask : DefaultTask() { con.disconnect() } } - - + companion object { val mapper = ObjectMapper() .configure(JsonParser.Feature.ALLOW_COMMENTS, true) @@ -133,7 +133,7 @@ open class GitHubTask : DefaultTask() { .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .registerModule(AfterburnerModule()) .registerModule(Jdk8Module()) - + fun jsonTree(value: Any?): JsonNode? { if (value == null) { return null @@ -141,20 +141,20 @@ open class GitHubTask : DefaultTask() { return mapper.valueToTree(value) } } - + fun jsonParse(json: String) = mapper.readTree(json) - + inline fun jsonMap(json: JsonNode?): T? { if (json === null) { return null } return mapper.readValue(mapper.treeAsTokens(json), object : TypeReference() {}) } - + fun jsonFormat(json: String): String = jsonFormat( jsonParse(json) ) - + fun jsonFormat(json: JsonNode?): String { if (json === null || json.isMissingNode) { return "" @@ -166,7 +166,7 @@ open class GitHubTask : DefaultTask() { w.toString() } } - + fun urlEncode(value: String) = URLEncoder.encode(value, StandardCharsets.UTF_8.name()) } } \ No newline at end of file diff --git a/libs/gradle/transform/build.gradle b/libs/gradle/transform/build.gradle index f3d0e18..a5a4ba6 100644 --- a/libs/gradle/transform/build.gradle +++ b/libs/gradle/transform/build.gradle @@ -1,6 +1,8 @@ // main dependencies dependencies { + compile project(":libs-gradle-utils") + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion" compile gradleApi() diff --git a/libs/gradle/transform/res/META-INF/gradle-plugins/com.satori.transform.properties b/libs/gradle/transform/res/META-INF/gradle-plugins/com.satori.transform.properties new file mode 100644 index 0000000..a7021fc --- /dev/null +++ b/libs/gradle/transform/res/META-INF/gradle-plugins/com.satori.transform.properties @@ -0,0 +1 @@ +implementation-class=com.satori.libs.gradle.transform.TransformPlugin \ No newline at end of file diff --git a/libs/gradle/transform/src/com/satori/libs/gradle/transform/TransformPlugin.kt b/libs/gradle/transform/src/com/satori/libs/gradle/transform/TransformPlugin.kt new file mode 100644 index 0000000..2af2301 --- /dev/null +++ b/libs/gradle/transform/src/com/satori/libs/gradle/transform/TransformPlugin.kt @@ -0,0 +1,21 @@ +package com.satori.libs.gradle.transform + +import com.satori.libs.gradle.utils.* +import groovy.lang.* +import org.gradle.api.* + +open class TransformPlugin : Plugin { + + override fun apply(project: Project) { + project.addExtension("transform") { closure: Closure<*> -> + val spec = TransformSpec(project) + (closure.clone() as Closure<*>).apply { + delegate = spec + resolveStrategy = Closure.DELEGATE_FIRST + call() + } + Transform.execute(spec, project) + } + project.addExtension("TransformTask", TransformTask::class.java) + } +} \ No newline at end of file diff --git a/libs/gradle/transform/src/TransformTask.kt b/libs/gradle/transform/src/com/satori/libs/gradle/transform/TransformTask.kt similarity index 89% rename from libs/gradle/transform/src/TransformTask.kt rename to libs/gradle/transform/src/com/satori/libs/gradle/transform/TransformTask.kt index 2750030..3624fd0 100644 --- a/libs/gradle/transform/src/TransformTask.kt +++ b/libs/gradle/transform/src/com/satori/libs/gradle/transform/TransformTask.kt @@ -1,4 +1,5 @@ -import com.satori.libs.gradle.transform.* +package com.satori.libs.gradle.transform + import org.gradle.api.* import org.gradle.api.tasks.* import java.io.* diff --git a/libs/gradle/utils/src/com/satori/libs/gradle/utils/ProjectExtensions.kt b/libs/gradle/utils/src/com/satori/libs/gradle/utils/ProjectExtensions.kt new file mode 100644 index 0000000..727d05c --- /dev/null +++ b/libs/gradle/utils/src/com/satori/libs/gradle/utils/ProjectExtensions.kt @@ -0,0 +1,7 @@ +package com.satori.libs.gradle.utils + +import org.gradle.api.* + +inline fun Project.addExtension(name: String, instance: T) { + project.extensions.add(T::class.java, name, instance) +} \ No newline at end of file diff --git a/libs/gtfs/readme.md b/libs/gtfs/readme.md index a368d21..3a6014b 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.17-SNAPSHOT + 0.5.22-SNAPSHOT ``` ### Download -[satori-libs-gtfs.v0.5.17-SNAPSHOT.zip](https://github.com/satori-com/satori-composer/releases/download/v0.5.17-SNAPSHOT/satori-libs-gtfs.v0.5.17-SNAPSHOT.zip)
+[satori-libs-gtfs.v0.5.22-SNAPSHOT.zip](https://github.com/satori-com/satori-composer/releases/download/v0.5.22-SNAPSHOT/satori-libs-gtfs.v0.5.22-SNAPSHOT.zip)
[or see latest releases](https://github.com/satori-com/satori-composer/releases/latest) ### Examples diff --git a/mods-examples/examples.gradle b/mods-examples/examples.gradle index 1af9fd2..62e9843 100644 --- a/mods-examples/examples.gradle +++ b/mods-examples/examples.gradle @@ -1,4 +1,4 @@ -import groovy.text.* +examples.add(project) task generateCompositionImage(type: GenerateCompositionDiagramTask) { group "codegen" diff --git a/readme.md b/readme.md index d64a9dc..bf75cac 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,9 @@ ## Satori Composer (preview) [![Build Status](https://travis-ci.org/satori-com/satori-composer.svg?branch=dev)](https://travis-ci.org/satori-com/satori-composer) -[![Build Status](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.17-SNAPSHOT/) +[![Build Status](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.22-SNAPSHOT/) #### Example -![diagram](docs/files/big-blue-bus-composition.png) +![diagram](mods-examples/big-blue-bus/docs/files/diagram.png) ```yaml { "stats": { @@ -72,7 +72,14 @@ - [Building and Running](https://www.satori.com/docs/opensource/composer#building-and-running) - [Async support library](docs/async/readme.md) - [Composition diagram drawer](libs/composition-drawer/readme.md) - +- Examples: + - [barrier](mods-examples/barrier/readme.md) + - [barrier queue](mods-examples/barrier-queue/readme.md) + - [big blue bus](mods-examples/big-blue-bus/readme.md) + - [clock](mods-examples/clock/readme.md) + - [nws usa alerts](mods-examples/nws-usa-alerts/readme.md) + - [queue](mods-examples/queue/readme.md) + - [rtm filter](mods-examples/rtm-filter/readme.md) ### Common Libraries - [Gtfs Library For Real-Time](https://github.com/satori-com/satori-composer/tree/dev/libs/gtfs) @@ -87,7 +94,7 @@ com.satori satori-composer - 0.5.17-SNAPSHOT + 0.5.22-SNAPSHOT ``` diff --git a/readme.template.md b/readme.template.md index ebf72ca..269c894 100644 --- a/readme.template.md +++ b/readme.template.md @@ -3,7 +3,7 @@ [![Build Status](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/${project.version}/) #### Example -![diagram](docs/files/big-blue-bus-composition.png) +![diagram](mods-examples/big-blue-bus/docs/files/diagram.png) ```yaml <%= rootProject.file("mods-examples/big-blue-bus/res/com/satori/mods/resources/config.json").text %> ``` @@ -15,7 +15,8 @@ - [Building and Running](https://www.satori.com/docs/opensource/composer#building-and-running) - [Async support library](docs/async/readme.md) - [Composition diagram drawer](libs/composition-drawer/readme.md) - +- Examples: <% examples.forEach{ %> + - [${it.description}](${rootProject.projectDir.toPath().relativize(it.projectDir.toPath()).toString().replace("\\", "/")}/readme.md)<% } %> ### Common Libraries - [Gtfs Library For Real-Time](https://github.com/satori-com/satori-composer/tree/dev/libs/gtfs) diff --git a/settings.gradle b/settings.gradle index 0fad297..fdaec2a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,8 @@ -include 'mods' -include 'mods-suite' -include 'composer' +rootProject.name = 'root' + +include ':mods' +include ':mods-suite' +include ':composer' // codegen