diff --git a/build.gradle b/build.gradle index 31ff00d..63da9b4 100644 --- a/build.gradle +++ b/build.gradle @@ -163,7 +163,7 @@ subprojects { println "creating default project structure for project '${project.name}'..." // create directories for all source sets - sourceSets.all { sourceSet -> + sourceSets.forEach { sourceSet -> sourceSet.java.srcDirs.forEach { def pathToCreate = new File(it, pckgDir) println "creating sources path for '${sourceSet.name}': '$pathToCreate'" diff --git a/mods-examples/barrier-queue/build.gradle b/mods-examples/barrier-queue/build.gradle index 371f386..f704d11 100644 --- a/mods-examples/barrier-queue/build.gradle +++ b/mods-examples/barrier-queue/build.gradle @@ -1,6 +1,8 @@ apply plugin: 'application' apply from: '../examples.gradle' +description "barrier queue" + mainClassName = 'com.satori.mods.examples.App' applicationName = projectDir.name diff --git a/mods-examples/barrier-queue/docs/files/diagram.png b/mods-examples/barrier-queue/docs/files/diagram.png new file mode 100644 index 0000000..9e87191 Binary files /dev/null and b/mods-examples/barrier-queue/docs/files/diagram.png differ diff --git a/mods-examples/barrier-queue/readme.md b/mods-examples/barrier-queue/readme.md index c7b4dad..fb40878 100644 --- a/mods-examples/barrier-queue/readme.md +++ b/mods-examples/barrier-queue/readme.md @@ -1,4 +1,7 @@ +## 'barrier queue' example +![diagram](docs/files/diagram.png) + ##### build app ``` gradle installDist diff --git a/mods-examples/barrier/build.gradle b/mods-examples/barrier/build.gradle index 371f386..aef54d8 100644 --- a/mods-examples/barrier/build.gradle +++ b/mods-examples/barrier/build.gradle @@ -1,6 +1,8 @@ apply plugin: 'application' apply from: '../examples.gradle' +description "barrier" + mainClassName = 'com.satori.mods.examples.App' applicationName = projectDir.name diff --git a/mods-examples/barrier/docs/files/diagram.png b/mods-examples/barrier/docs/files/diagram.png new file mode 100644 index 0000000..8694f1b Binary files /dev/null and b/mods-examples/barrier/docs/files/diagram.png differ diff --git a/mods-examples/barrier/readme.md b/mods-examples/barrier/readme.md index 0b20e34..a55e1ee 100644 --- a/mods-examples/barrier/readme.md +++ b/mods-examples/barrier/readme.md @@ -1,4 +1,7 @@ +## 'barrier' example +![diagram](docs/files/diagram.png) + ##### build app ``` gradle installDist diff --git a/mods-examples/big-blue-bus/build.gradle b/mods-examples/big-blue-bus/build.gradle index bbb6069..a4cbcf5 100644 --- a/mods-examples/big-blue-bus/build.gradle +++ b/mods-examples/big-blue-bus/build.gradle @@ -1,6 +1,8 @@ apply plugin: 'application' apply from: '../examples.gradle' +description "big blue bus" + mainClassName = 'com.satori.mods.examples.BigBlueBus' applicationName = projectDir.name diff --git a/mods-examples/big-blue-bus/docs/files/diagram.png b/mods-examples/big-blue-bus/docs/files/diagram.png new file mode 100644 index 0000000..d5102a4 Binary files /dev/null and b/mods-examples/big-blue-bus/docs/files/diagram.png differ diff --git a/mods-examples/big-blue-bus/readme.md b/mods-examples/big-blue-bus/readme.md index 150cf78..b286748 100644 --- a/mods-examples/big-blue-bus/readme.md +++ b/mods-examples/big-blue-bus/readme.md @@ -1,4 +1,7 @@ +## 'big blue bus' example +![diagram](docs/files/diagram.png) + ##### build app ``` gradle installDist diff --git a/mods-examples/clock/build.gradle b/mods-examples/clock/build.gradle index e9fe600..da8a447 100644 --- a/mods-examples/clock/build.gradle +++ b/mods-examples/clock/build.gradle @@ -1,6 +1,8 @@ apply plugin: 'application' apply from: '../examples.gradle' +description "clock" + mainClassName = 'com.satori.mods.examples.ClockApp' applicationName = projectDir.name diff --git a/mods-examples/clock/docs/files/diagram.png b/mods-examples/clock/docs/files/diagram.png new file mode 100644 index 0000000..876081e Binary files /dev/null and b/mods-examples/clock/docs/files/diagram.png differ diff --git a/mods-examples/clock/readme.md b/mods-examples/clock/readme.md index bb1d2a5..a3c8edb 100644 --- a/mods-examples/clock/readme.md +++ b/mods-examples/clock/readme.md @@ -1,4 +1,7 @@ +## 'clock' example +![diagram](docs/files/diagram.png) + ##### build app ``` gradle installDist diff --git a/mods-examples/clock2/Dockerfile b/mods-examples/clock2/Dockerfile deleted file mode 100644 index 840a915..0000000 --- a/mods-examples/clock2/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# generated, do not modify -FROM centos:7 - -RUN yum -y update &&\ - yum -y install --setopt=tsflags=nodocs java-1.8.0-openjdk &&\ - yum clean all - -# install jdk -ENV JAVA_HOME /usr/lib/jvm/jre-1.8.0-openjdk -ENV PATH $JAVA_HOME/bin:$PATH - -# copy app files -ADD . /app -RUN chmod +x /app/bin/clock2 -RUN rm -f /app/Dockerfile - -# cleanup -RUN rm -rf /tmp -RUN mkdir /tmp -RUN chmod a+rw /tmp - -# default command to execute when creating a new container -WORKDIR /app -CMD ["/app/bin/clock2"] \ No newline at end of file diff --git a/mods-examples/clock2/build.gradle b/mods-examples/clock2/build.gradle index 1c18021..39c57a2 100644 --- a/mods-examples/clock2/build.gradle +++ b/mods-examples/clock2/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'application' -apply from: '../examples.gradle' mainClassName = 'com.satori.mods.examples.ClocksApp2' applicationName = projectDir.name diff --git a/mods-examples/clock2/readme.md b/mods-examples/clock2/readme.md deleted file mode 100644 index fe0f8ec..0000000 --- a/mods-examples/clock2/readme.md +++ /dev/null @@ -1,36 +0,0 @@ - -##### build app -``` -gradle installDist -``` - -##### run app using gradle -``` -gradle run -``` - -##### run app using command line -``` -./.out/install/clock2/bin/clock2 -``` - -##### build docker image -``` -gradle buildDockerImage -``` - -##### run interactive docker container using gradle -``` -gradle runDockerContainer -``` - -##### run interactive docker container using command line -``` -docker run --rm -ti mods-examples-clock2 -``` - -##### run daemonized docker container -``` -docker run --restart=always --log-opt max-size=64m --log-opt max-file=16 -d --name=clock2 mods-examples-clock2 -``` - diff --git a/mods-examples/composition-drawer/build.gradle b/mods-examples/composition-drawer/build.gradle index 6bba7e2..f76af05 100644 --- a/mods-examples/composition-drawer/build.gradle +++ b/mods-examples/composition-drawer/build.gradle @@ -1,5 +1,3 @@ -import com.satori.libs.composition.drawer.* - buildscript{ repositories { mavenCentral() @@ -8,7 +6,7 @@ buildscript{ } } dependencies { - classpath "com.satori:satori-libs-composition-drawer:0.5.13-SNAPSHOT" + classpath "com.satori:satori-libs-composition-drawer:0.5.14-SNAPSHOT" } } @@ -24,7 +22,7 @@ generateCode.dependsOn generateCompositionImage configurations{compositionDrawer} dependencies { - compositionDrawer "com.satori:satori-libs-composition-drawer:0.5.13-SNAPSHOT" + compositionDrawer "com.satori:satori-libs-composition-drawer:0.5.14-SNAPSHOT" } task generateCompositionImage2(type: JavaExec) { diff --git a/mods-examples/examples.gradle b/mods-examples/examples.gradle index 43d5945..011ba52 100644 --- a/mods-examples/examples.gradle +++ b/mods-examples/examples.gradle @@ -1,5 +1,25 @@ import groovy.text.* +buildscript{ + repositories { + mavenCentral() + maven { + url('https://oss.sonatype.org/content/repositories/snapshots/') + } + } + dependencies { + classpath "com.satori:satori-libs-composition-drawer:0.5.14-SNAPSHOT" + } +} + +task generateCompositionImage(type: GenerateCompositionDiagramTask) { + group "codegen" + cfgPath = file("res/com/satori/mods/resources/config.json") + imgPath = file("docs/files/diagram.png") + blockWidth = 220 + blockHeight = 45 +} + startScripts { //applicationName = 'app' defaultJvmOpts = ["-server", "-d64"] @@ -18,6 +38,9 @@ task generateReadme(type: TransformTask) { output file("readme.md") outputs.upToDateWhen { false } } +generateReadme.dependsOn generateCompositionImage +generateCode.dependsOn generateReadme + task generateLogProperties(type: TransformTask) { group 'codegen' diff --git a/mods-examples/hello-world/Dockerfile b/mods-examples/hello-world/Dockerfile deleted file mode 100644 index 5443dda..0000000 --- a/mods-examples/hello-world/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# generated, do not modify -FROM centos:7 - -RUN yum -y update &&\ - yum -y install --setopt=tsflags=nodocs java-1.8.0-openjdk &&\ - yum clean all - -# install jdk -ENV JAVA_HOME /usr/lib/jvm/jre-1.8.0-openjdk -ENV PATH $JAVA_HOME/bin:$PATH - -# copy app files -ADD . /app -RUN chmod +x /app/bin/hello-world -RUN rm -f /app/Dockerfile - -# cleanup -RUN rm -rf /tmp -RUN mkdir /tmp -RUN chmod a+rw /tmp - -# default command to execute when creating a new container -WORKDIR /app -CMD ["/app/bin/hello-world"] \ No newline at end of file diff --git a/mods-examples/hello-world/build.gradle b/mods-examples/hello-world/build.gradle index 5a331e8..58bbcda 100644 --- a/mods-examples/hello-world/build.gradle +++ b/mods-examples/hello-world/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'application' -apply from: '../examples.gradle' mainClassName = 'com.satori.mods.examples.HelloWorldApp' applicationName = projectDir.name diff --git a/mods-examples/hello-world/readme.md b/mods-examples/hello-world/readme.md deleted file mode 100644 index a183172..0000000 --- a/mods-examples/hello-world/readme.md +++ /dev/null @@ -1,36 +0,0 @@ - -##### build app -``` -gradle installDist -``` - -##### run app using gradle -``` -gradle run -``` - -##### run app using command line -``` -./.out/install/hello-world/bin/hello-world -``` - -##### build docker image -``` -gradle buildDockerImage -``` - -##### run interactive docker container using gradle -``` -gradle runDockerContainer -``` - -##### run interactive docker container using command line -``` -docker run --rm -ti mods-examples-hello-world -``` - -##### run daemonized docker container -``` -docker run --restart=always --log-opt max-size=64m --log-opt max-file=16 -d --name=hello-world mods-examples-hello-world -``` - diff --git a/mods-examples/nws-usa-alerts/build.gradle b/mods-examples/nws-usa-alerts/build.gradle index a5d6206..6aa200d 100644 --- a/mods-examples/nws-usa-alerts/build.gradle +++ b/mods-examples/nws-usa-alerts/build.gradle @@ -1,6 +1,8 @@ apply plugin: 'application' apply from: '../examples.gradle' +description "nws usa alerts" + mainClassName = 'com.satori.mods.examples.NwsUsaAlerts' applicationName = projectDir.name diff --git a/mods-examples/nws-usa-alerts/docs/files/diagram.png b/mods-examples/nws-usa-alerts/docs/files/diagram.png new file mode 100644 index 0000000..e890fbf Binary files /dev/null and b/mods-examples/nws-usa-alerts/docs/files/diagram.png differ diff --git a/mods-examples/nws-usa-alerts/readme.md b/mods-examples/nws-usa-alerts/readme.md index b180dc4..b64728f 100644 --- a/mods-examples/nws-usa-alerts/readme.md +++ b/mods-examples/nws-usa-alerts/readme.md @@ -1,4 +1,7 @@ +## 'nws usa alerts' example +![diagram](docs/files/diagram.png) + ##### build app ``` gradle installDist diff --git a/mods-examples/queue/build.gradle b/mods-examples/queue/build.gradle index 371f386..c8ef993 100644 --- a/mods-examples/queue/build.gradle +++ b/mods-examples/queue/build.gradle @@ -1,6 +1,8 @@ apply plugin: 'application' apply from: '../examples.gradle' +description "queue" + mainClassName = 'com.satori.mods.examples.App' applicationName = projectDir.name diff --git a/mods-examples/queue/docs/files/diagram.png b/mods-examples/queue/docs/files/diagram.png new file mode 100644 index 0000000..f062f01 Binary files /dev/null and b/mods-examples/queue/docs/files/diagram.png differ diff --git a/mods-examples/queue/readme.md b/mods-examples/queue/readme.md index bb63acc..215726e 100644 --- a/mods-examples/queue/readme.md +++ b/mods-examples/queue/readme.md @@ -1,4 +1,7 @@ +## 'queue' example +![diagram](docs/files/diagram.png) + ##### build app ``` gradle installDist diff --git a/mods-examples/readme.template.md b/mods-examples/readme.template.md index 5a3995a..a95270a 100644 --- a/mods-examples/readme.template.md +++ b/mods-examples/readme.template.md @@ -5,6 +5,9 @@ def appScript = project.startScripts.applicationName def appName = project.applicationName def projName = project.name %>--> +## '<%=project.description%>' example +![diagram](docs/files/diagram.png) + ##### build app ``` gradle installDist diff --git a/mods-examples/rtm-filter/build.gradle b/mods-examples/rtm-filter/build.gradle index a5d6206..7962556 100644 --- a/mods-examples/rtm-filter/build.gradle +++ b/mods-examples/rtm-filter/build.gradle @@ -1,6 +1,8 @@ apply plugin: 'application' apply from: '../examples.gradle' +description "rtm filter" + mainClassName = 'com.satori.mods.examples.NwsUsaAlerts' applicationName = projectDir.name diff --git a/mods-examples/rtm-filter/docs/files/diagram.png b/mods-examples/rtm-filter/docs/files/diagram.png new file mode 100644 index 0000000..d18214b Binary files /dev/null and b/mods-examples/rtm-filter/docs/files/diagram.png differ diff --git a/mods-examples/rtm-filter/readme.md b/mods-examples/rtm-filter/readme.md index 093774c..136018c 100644 --- a/mods-examples/rtm-filter/readme.md +++ b/mods-examples/rtm-filter/readme.md @@ -1,4 +1,7 @@ +## 'rtm filter' example +![diagram](docs/files/diagram.png) + ##### build app ``` gradle installDist