polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [21/35] zest-java git commit: build: fix samples tasks name conflicts
Date Sat, 19 Nov 2016 22:50:22 GMT
build: fix samples tasks name conflicts

All runnable samples can now be run from different Gradle tasks.
e.g. ./gradlew runCircuitBreakerSample
Use ./gradlew tasks to list available tasks


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/e485f59a
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/e485f59a
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/e485f59a

Branch: refs/heads/develop
Commit: e485f59afa3fd2866b45b1f9e0cfcd3831bd678d
Parents: e28a4a5
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sat Nov 19 14:57:57 2016 +0100
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sat Nov 19 15:03:01 2016 +0100

----------------------------------------------------------------------
 .../org/apache/zest/gradle/TaskGroups.groovy      | 18 ++++++++++++++++++
 libraries/circuitbreaker/build.gradle             |  7 +++++--
 .../circuitbreaker/src/docs/circuitbreaker.txt    |  2 +-
 libraries/fileconfig/build.gradle                 |  3 ---
 libraries/jmx/build.gradle                        |  6 +++++-
 libraries/restlet/build.gradle                    |  6 +++++-
 manual/src/docs/website/samples.txt               |  3 ++-
 samples/forum/build.gradle                        |  6 +++++-
 samples/sql-support/build.gradle                  |  6 +++++-
 samples/swing/build.gradle                        | 10 ++++++++++
 tools/envisage/build.gradle                       | 10 ++++++++--
 tools/envisage/src/docs/envisage.txt              |  4 ++--
 12 files changed, 66 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/buildSrc/src/main/groovy/org/apache/zest/gradle/TaskGroups.groovy
----------------------------------------------------------------------
diff --git a/buildSrc/src/main/groovy/org/apache/zest/gradle/TaskGroups.groovy b/buildSrc/src/main/groovy/org/apache/zest/gradle/TaskGroups.groovy
index 03ec348..fb97c47 100644
--- a/buildSrc/src/main/groovy/org/apache/zest/gradle/TaskGroups.groovy
+++ b/buildSrc/src/main/groovy/org/apache/zest/gradle/TaskGroups.groovy
@@ -1,3 +1,20 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
 package org.apache.zest.gradle
 
 import org.gradle.api.plugins.ApplicationPlugin
@@ -17,4 +34,5 @@ class TaskGroups
   static final String RELEASE = 'release'
   static final String RELEASE_VERIFICATION = 'release verification'
   static final String UPLOAD = BasePlugin.UPLOAD_GROUP
+  static final String SAMPLES = 'samples'
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/libraries/circuitbreaker/build.gradle
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/build.gradle b/libraries/circuitbreaker/build.gradle
index 7c2242e..6182fb1 100644
--- a/libraries/circuitbreaker/build.gradle
+++ b/libraries/circuitbreaker/build.gradle
@@ -17,6 +17,7 @@
  *
  *
  */
+import org.apache.zest.gradle.TaskGroups
 
 description = "Apache Zest™ Circuit Breaker Library provides a framework for connecting
external resources, so that they can be disabled during re-play of events."
 
@@ -34,7 +35,9 @@ dependencies {
   testRuntime libraries.logback
 }
 
-task( runSample, dependsOn: 'testClasses', type: JavaExec ) {
-  main = 'org.apache.zest.library.circuitbreaker.jmx.CircuitBreakerManagementTest'
+task( runCircuitBreakerSample, dependsOn: 'testClasses', type: JavaExec ) {
+  group = TaskGroups.SAMPLES
+  description = "Runs $project.name sample."
+  main = 'org.apache.zest.library.circuitbreaker.jmx.CircuitBreakerManagementSample'
   classpath = sourceSets.test.runtimeClasspath
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/libraries/circuitbreaker/src/docs/circuitbreaker.txt
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/src/docs/circuitbreaker.txt b/libraries/circuitbreaker/src/docs/circuitbreaker.txt
index 21aada2..b30cf47 100644
--- a/libraries/circuitbreaker/src/docs/circuitbreaker.txt
+++ b/libraries/circuitbreaker/src/docs/circuitbreaker.txt
@@ -113,7 +113,7 @@ tag=jmx
 
 == Interactive sample ==
 
-A gradle task runSample is defined in this library as a shortcut to run a
+From the sources you can run the `runCircuitBreakerSample` Gradle task to run a
 simple interactive example. You'll need a MBean client to connect to the
 sample, VisualVM with its MBean plugin does the job. See <<build-system>>
 if you need some guidance.

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/libraries/fileconfig/build.gradle
----------------------------------------------------------------------
diff --git a/libraries/fileconfig/build.gradle b/libraries/fileconfig/build.gradle
index fb233c3..ffed594 100644
--- a/libraries/fileconfig/build.gradle
+++ b/libraries/fileconfig/build.gradle
@@ -17,9 +17,6 @@
  *
  *
  */
-import org.apache.zest.gradle.test.TestSupportPlugin
-
-apply plugin: TestSupportPlugin
 
 description = "Apache Zest™ File Configuration Library provides platform specific file
locations."
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/libraries/jmx/build.gradle
----------------------------------------------------------------------
diff --git a/libraries/jmx/build.gradle b/libraries/jmx/build.gradle
index 0131292..ca1e79a 100644
--- a/libraries/jmx/build.gradle
+++ b/libraries/jmx/build.gradle
@@ -1,3 +1,5 @@
+import org.apache.zest.gradle.TaskGroups
+
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one
  *  or more contributor license agreements.  See the NOTICE file
@@ -33,7 +35,9 @@ dependencies {
   testRuntime libraries.logback
 }
 
-task( runSample, dependsOn: 'testClasses', type: JavaExec ) {
+task( runJmxSample, dependsOn: 'testClasses', type: JavaExec ) {
+  group = TaskGroups.SAMPLES
+  description = "Runs $project.name sample."
   main = 'org.apache.zest.library.jmx.JMXTest'
   classpath = sourceSets.test.runtimeClasspath
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/libraries/restlet/build.gradle
----------------------------------------------------------------------
diff --git a/libraries/restlet/build.gradle b/libraries/restlet/build.gradle
index 70a58b1..9bf1ec7 100644
--- a/libraries/restlet/build.gradle
+++ b/libraries/restlet/build.gradle
@@ -1,3 +1,5 @@
+import org.apache.zest.gradle.TaskGroups
+
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one
  *  or more contributor license agreements.  See the NOTICE file
@@ -40,7 +42,9 @@ dependencies {
   testRuntime libraries.logback
 }
 
-task runSample( type: JavaExec, dependsOn: 'testClasses' ) {
+task runRestletSample( type: JavaExec, dependsOn: 'testClasses' ) {
+  group = TaskGroups.SAMPLES
+  description = "Runs $project.name sample."
   classpath = sourceSets.test.runtimeClasspath
   main = 'org.apache.zest.library.restlet.TestApplication'
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/manual/src/docs/website/samples.txt
----------------------------------------------------------------------
diff --git a/manual/src/docs/website/samples.txt b/manual/src/docs/website/samples.txt
index b4de2ff..9805bca 100644
--- a/manual/src/docs/website/samples.txt
+++ b/manual/src/docs/website/samples.txt
@@ -99,7 +99,8 @@ postgres=# \q
 user@host $
 ----
 
-A gradle task `runSample` is defined in this module as a shortcut to run the example. See
<<build-system>>.
+From the sources you can run the `runSqlSupportSample` Gradle task to run the example.
+See <<build-system>> if you need some guidance.
 
 [[sample-swing,Swing Bindings Sample]]
 == Swing Bindings Sample ==

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/samples/forum/build.gradle
----------------------------------------------------------------------
diff --git a/samples/forum/build.gradle b/samples/forum/build.gradle
index b4f7520..8195fdb 100644
--- a/samples/forum/build.gradle
+++ b/samples/forum/build.gradle
@@ -1,3 +1,5 @@
+import org.apache.zest.gradle.TaskGroups
+
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one
  *  or more contributor license agreements.  See the NOTICE file
@@ -39,7 +41,9 @@ dependencies {
   testRuntime libraries.logback
 }
 
-task( runSample, dependsOn: 'testClasses', type: JavaExec ) {
+task( runForumSample, dependsOn: 'testClasses', type: JavaExec ) {
+  group = TaskGroups.SAMPLES
+  description = "Runs $project.name sample."
   main = 'org.apache.zest.sample.forum.web.Main'
   classpath = sourceSets.test.runtimeClasspath
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/samples/sql-support/build.gradle
----------------------------------------------------------------------
diff --git a/samples/sql-support/build.gradle b/samples/sql-support/build.gradle
index 48717ab..d1a82e9 100644
--- a/samples/sql-support/build.gradle
+++ b/samples/sql-support/build.gradle
@@ -1,3 +1,5 @@
+import org.apache.zest.gradle.TaskGroups
+
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one
  *  or more contributor license agreements.  See the NOTICE file
@@ -35,7 +37,9 @@ dependencies {
   runtime libraries.slf4j_simple
 }
 
-task( runSample, dependsOn: 'classes', type: JavaExec ) {
+task( runSqlSupportSample, dependsOn: 'classes', type: JavaExec ) {
+  group = TaskGroups.SAMPLES
+  description = "Runs $project.name sample."
   main = 'org.apache.zest.sample.sqlsupport.Main'
   classpath = sourceSets.main.runtimeClasspath
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/samples/swing/build.gradle
----------------------------------------------------------------------
diff --git a/samples/swing/build.gradle b/samples/swing/build.gradle
index 9291e4b..3286e95 100644
--- a/samples/swing/build.gradle
+++ b/samples/swing/build.gradle
@@ -1,3 +1,5 @@
+import org.apache.zest.gradle.TaskGroups
+
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one
  *  or more contributor license agreements.  See the NOTICE file
@@ -24,4 +26,12 @@ jar { manifest { name = "Apache Zest™ Sample - Swing Bindings" } }
 
 dependencies {
   compile zest.core.bootstrap
+  runtime zest.core.runtime
+}
+
+task( runSwingSample, dependsOn: 'classes', type: JavaExec ) {
+  group = TaskGroups.SAMPLES
+  description = "Runs $project.name sample."
+  main = 'org.apache.zest.sample.swing.binding.example.Main'
+  classpath = sourceSets.main.runtimeClasspath
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/tools/envisage/build.gradle
----------------------------------------------------------------------
diff --git a/tools/envisage/build.gradle b/tools/envisage/build.gradle
index 7d1780b..7415b70 100644
--- a/tools/envisage/build.gradle
+++ b/tools/envisage/build.gradle
@@ -1,3 +1,5 @@
+import org.apache.zest.gradle.TaskGroups
+
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one
  *  or more contributor license agreements.  See the NOTICE file
@@ -37,12 +39,16 @@ dependencies {
   testRuntime libraries.logback
 }
 
-task( runSample, dependsOn: 'testClasses', type: JavaExec ) {
+task( runEnvisageSample, dependsOn: 'testClasses', type: JavaExec ) {
+  group = TaskGroups.SAMPLES
+  description = "Runs $project.name sample."
   main = 'org.apache.zest.envisage.sample.EnvisageSample'
   classpath = sourceSets.test.runtimeClasspath
 }
 
-task( runSchool, dependsOn: 'testClasses', type: JavaExec ) {
+task( runEnvisageSchoolSample, dependsOn: 'testClasses', type: JavaExec ) {
+  group = TaskGroups.SAMPLES
+  description = "Runs $project.name School sample."
   main = 'org.apache.zest.envisage.school.EnvisageSchoolSample'
   classpath = sourceSets.test.runtimeClasspath
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e485f59a/tools/envisage/src/docs/envisage.txt
----------------------------------------------------------------------
diff --git a/tools/envisage/src/docs/envisage.txt b/tools/envisage/src/docs/envisage.txt
index 67afac8..6bdaa6f 100644
--- a/tools/envisage/src/docs/envisage.txt
+++ b/tools/envisage/src/docs/envisage.txt
@@ -36,8 +36,8 @@ tag=envisage
 As you can see, Envisage operates on the ApplicationModel, this means that you
 can easily embed it in your own Applications too.
 
-Two gradle tasks runSample and runSchool are defined in this module as a
-shortcut to run the examples. See <<build-system>>.
+From the sources you can run the `runEnvisageSample` or `runEnvisageSchoolSample` Gradle
tasks
+to run interactive examples. See <<build-system>> if you need some guidance.
 
 == Screenshots ==
 


Mime
View raw message