You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by dl...@apache.org on 2016/08/15 20:29:38 UTC

[3/4] incubator-edgent git commit: make root 'assemble' be like our 'all'; make 'all' a synonym for it

make root 'assemble' be like our 'all'; make 'all' a synonym for it

- also use some more concise syntax

Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/c6837a53
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/c6837a53
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/c6837a53

Branch: refs/heads/master
Commit: c6837a534e889a7be2a4afa4574f77480ae60114
Parents: 1a0f678
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Mon Aug 15 09:23:33 2016 -0400
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Mon Aug 15 09:23:33 2016 -0400

----------------------------------------------------------------------
 DEVELOPMENT.md |  9 +++++----
 build.gradle   | 27 +++++++++++++--------------
 2 files changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/c6837a53/DEVELOPMENT.md
----------------------------------------------------------------------
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index cdae879..b220d47 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -108,16 +108,17 @@ Work is ongoing to replace the Ant based build system with a Gradle based one
 be complete.
 
 **TODO: The primary build process is using Gradle, any pull request is expected to
-maintain the build success of `clean, all, test`.**
+maintain the build success of `clean, assemble, test, reports`.**
 
 The Gradle wrapper `edgent/{gradlew,gradlew.bat}` should be used to ensure an appropriate
-version of Gradle is used.  e.g.  `$ ./gradlew clean all test reports`
+version of Gradle is used.  e.g.  `$ ./gradlew clean build`
 
 The top-level Gradle file is `edgent/build.gradle` and contains several
 unique tasks: 
 
-* `all` (default) : Build all code and Javadoc into `build\distributions`. The build will fail on any code error or Javadoc warning or error.
-* `build` : essentially like "all test reports"
+* `assemble` (default) : Build all code and Javadoc into `build\distributions`. The build will fail on any code error or Javadoc warning or error.
+* `all` : synonym for `assemble`
+* `build` : essentially like "assemble test reports"
 * `clean` : Clean the project
 * `test` : Run the JUnit tests, if any test fails the test run stops.
   * use a project test task and optionally the `--tests` option to run a subset of the tests:

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/c6837a53/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index aa4f924..1184815 100644
--- a/build.gradle
+++ b/build.gradle
@@ -12,7 +12,7 @@
  * limitations under the License.
  */
  
-defaultTasks 'all'
+defaultTasks 'assemble'
  
 /* Configure root project */
 allprojects {
@@ -184,9 +184,7 @@ subprojects {
       //Copy Sample SRC to dist
       doLast {
         copy {
-          from(sourceSets.main.allSource.srcDirs) {
-            include '**/*.java'
-          }
+          from(sourceSets.main.allSource.srcDirs) { include '**/*.java' }
           into "${rootProject.ext.target_java8_dir}/$projectGroup/src/$project.name/src/main/java/"
         }
       }
@@ -206,9 +204,8 @@ subprojects {
 task copyScripts(type: Copy) {
   description = 'Copy scripts to target_java8_dir'
   includeEmptyDirs = false
-  from "scripts/"
+  from("scripts/") { include "**/*" }
   into "${rootProject.ext.target_java8_dir}/scripts/"
-  include "**/*"
 }
 
 //Create Junit Report
@@ -228,9 +225,7 @@ task createJunitReport << {
           classname: 'org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator',
           classpath: configurations.junitLibs.asPath)
   ant.junitreport(todir: './') {
-    fileset(dir: './') {
-      include(name: '**/test-results/TEST-*.xml')
-    }
+    fileset(dir: './', includes: '**/test-results/TEST-*.xml')
     report(format: 'frames', todir: "${target_report_dir}/tests")
   }
   ant.move(file: "TESTS-TestSuites.xml", tofile: "${target_report_dir}/TESTS-TestSuites.xml")
@@ -491,9 +486,13 @@ task releaseTarGz(type: Tar) {
   }
 }  
 
-task all {
+assemble {
   description = "Assemble distribution artifacts and populate the target_dir with jars, doc, etc. Like 'build' w/o 'test'"
-  dependsOn filteredSubprojects*.assemble, copyScripts, aggregateJavadoc
+  dependsOn filteredSubprojects*.assemble, aggregateJavadoc, copyScripts
+}
+
+task all(dependsOn: assemble) {
+  description = "alias for 'assemble'"
 }
 
 task cleanAll {
@@ -503,10 +502,10 @@ task cleanAll {
 
 task release {
   description = 'Assemble distribution artifacts, populate target_dir, and create a release tgz'
-  dependsOn cleanAll, addMiscDistFiles, all, releaseTarGz
+  dependsOn cleanAll, addMiscDistFiles, assemble, releaseTarGz
   addMiscDistFiles.mustRunAfter cleanAll
   all.mustRunAfter addMiscDistFiles
-  releaseTarGz.mustRunAfter all
+  releaseTarGz.mustRunAfter assemble
 }
 
 task reports {
@@ -517,7 +516,7 @@ task reports {
 // build: inject test report generation and javadoc generation (for early problem detection)
 // make 'build' like "all test reports"
 build {
-  dependsOn filteredSubprojects*.build, aggregateJavadoc, copyScripts
+  dependsOn filteredSubprojects*.build
   finalizedBy reports // after build's test task
 }