polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [42/50] [abbrv] polygene-java git commit: Remove the Gradle Wrapper from the source distribution
Date Tue, 16 May 2017 18:51:34 GMT
Remove the Gradle Wrapper from the source distribution

The required Gradle version is kept in gradle/wrapper/gradle-wrapper.properties
The source distribution’s README explain how to get started


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

Branch: refs/heads/master
Commit: ac6094d818edcf219210962c2b1369e15970f938
Parents: cf15aa4
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Mon May 15 18:21:17 2017 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Mon May 15 18:21:26 2017 +0200

----------------------------------------------------------------------
 .../distributions/DistributionsPlugin.groovy    | 34 ++++++++++++++++----
 distributions/src/src-dist/README.txt           | 16 ++++++---
 .../src/docs/tutorials/howto-build-system.txt   |  7 ++++
 3 files changed, 46 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ac6094d8/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/distributions/DistributionsPlugin.groovy
----------------------------------------------------------------------
diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/distributions/DistributionsPlugin.groovy
b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/distributions/DistributionsPlugin.groovy
index 6404495..c7b1958 100644
--- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/distributions/DistributionsPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/distributions/DistributionsPlugin.groovy
@@ -56,6 +56,7 @@ import org.gradle.plugins.signing.SigningExtension
 import java.nio.file.Files
 import java.nio.file.Path
 
+// TODO Split each distribution as a separate plugin
 // TODO Expose all project outputs into configurations
 @CompileStatic
 class DistributionsPlugin implements Plugin<Project>
@@ -78,6 +79,7 @@ class DistributionsPlugin implements Plugin<Project>
     static final String CHECK_SOURCE_DIST = 'checkSourceDistribution'
     static final String CHECK_BINARY_DIST = 'checkBinaryDistribution'
     private static final String RAT_SOURCE_DIST = 'ratSourceDistribution'
+    private static final String INSPECT_SOURCE_DIST = 'inspectSourceDistribution'
     private static final String BUILD_SOURCE_DIST = 'buildSourceDistribution'
     private static final String RAT_BINARY_DIST = 'ratBinaryDistribution'
   }
@@ -121,7 +123,6 @@ class DistributionsPlugin implements Plugin<Project>
       spec.include '*.txt'
       spec.include 'doap.rdf'
       spec.include '*.gradle'
-      spec.include 'gradlew*'
       spec.include 'gradle/**'
       spec.include 'etc/**'
       spec.include 'buildSrc/**'
@@ -142,7 +143,14 @@ class DistributionsPlugin implements Plugin<Project>
       spec.exclude 'settings.gradle'
       spec.exclude 'gradle.properties'
       // Excludes
+      spec.exclude '**/.git/**'              // Git directories
+      spec.exclude '**/.git*'                // Git files
       spec.exclude '**/build/**'             // Build output
+      spec.exclude 'gradlew*'                // Gradle wrapper scripts
+      spec.exclude 'gradle/wrapper/*.jar'    // Gradle wrapper JAR
+      spec.exclude '**/.gradle/**'           // Gradle caches
+      spec.exclude '**/.gradletasknamecache' // Gradle shell completion cache
+      spec.exclude '**/node_modules/**'      // Node's node_module dir
       spec.exclude 'derby.log'               // Derby test garbage
       spec.exclude '**/*.iml'                // IDEA files
       spec.exclude '**/*.ipr'                // IDEA files
@@ -154,11 +162,6 @@ class DistributionsPlugin implements Plugin<Project>
       spec.exclude '**/.settings'            // Eclipse files
       spec.exclude '**/.nb-gradle/**'        // Netbeans files
       spec.exclude '**/.nb-gradle*'          // Netbeans files
-      spec.exclude '**/.git/**'              // Git directories
-      spec.exclude '**/.git*'                // Git files
-      spec.exclude '**/.gradle/**'           // Gradle caches
-      spec.exclude '**/.gradletasknamecache' // Gradle shell completion cache
-      spec.exclude '**/node_modules/**'      // Node's node_module dir
 
       spec.into '.'
     }
@@ -286,11 +289,28 @@ class DistributionsPlugin implements Plugin<Project>
         'tools/generator-polygene/app/templates/Heroes/**',
       ]
     } as Action<RatTask> )
+    project.tasks.create( TaskNames.INSPECT_SOURCE_DIST ) { Task task ->
+      task.group = TaskGroups.DISTRIBUTION_VERIFICATION
+      task.description = 'Inspects various aspects of the source distribution.'
+      task.dependsOn TaskNames.STAGE_SOURCE_DIST
+      task.onlyIf { !releaseSpec.developmentVersion }
+      task.doLast {
+        // ad-hoc checks to the source distribution -----------------------
+        def assertFilePresent = { String path -> assert new File( unpackedSrcDistDir,
path ).isFile() }
+        def assertFileAbsent = { String path -> assert !new File( unpackedSrcDistDir,
path ).isFile() }
+
+        assertFileAbsent 'gradlew'
+        assertFileAbsent 'gradlew.bat'
+        assertFileAbsent 'gradle/wrapper/gradle-wrapper.jar'
+        assertFilePresent 'gradle/wrapper/gradle-wrapper.properties'
+      }
+    }
     project.tasks.create( TaskNames.BUILD_SOURCE_DIST, ExecLogged, { ExecLogged task ->
       task.group = TaskGroups.DISTRIBUTION_VERIFICATION
       task.description = 'Checks the source distribution by running `gradle build` inside.'
       task.dependsOn TaskNames.STAGE_SOURCE_DIST
       task.mustRunAfter TaskNames.RAT_SOURCE_DIST
+      task.mustRunAfter TaskNames.INSPECT_SOURCE_DIST
       def workDir = project.file( "$project.buildDir/tmp/${ TaskNames.BUILD_SOURCE_DIST }"
)
       task.inputs.dir unpackedSrcDistDir
       task.workingDir = workDir
@@ -310,7 +330,7 @@ class DistributionsPlugin implements Plugin<Project>
     } as Action<ExecLogged> )
     project.tasks.create( TaskNames.CHECK_SOURCE_DIST ) { Task task ->
       task.description = "Checks the source distribution."
-      task.dependsOn TaskNames.RAT_SOURCE_DIST, TaskNames.BUILD_SOURCE_DIST
+      task.dependsOn TaskNames.RAT_SOURCE_DIST, TaskNames.INSPECT_SOURCE_DIST, TaskNames.BUILD_SOURCE_DIST
     }
   }
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ac6094d8/distributions/src/src-dist/README.txt
----------------------------------------------------------------------
diff --git a/distributions/src/src-dist/README.txt b/distributions/src/src-dist/README.txt
index 7a2d996..de6c218 100644
--- a/distributions/src/src-dist/README.txt
+++ b/distributions/src/src-dist/README.txt
@@ -42,11 +42,19 @@ https://polygene.apache.org/java/latest/howto-depend-on-polygene.html
 
 Building Apache Polygene
 ---------------------
-To build Polygene™ from sources you only need to have a valid Java JDK >= 7
-installation.
+To build Polygene™ from sources you only need to have a valid Java JDK >= 8
+installation and any version of Gradle.
 
-If you want to build the Polygene™ manual, then you also need valid Asciidoc
-(http://www.methods.co.nz/asciidoc/) and Docbook-XSL installations.
+This distribution embeds the exact version of Gradle needed to build Polygene™.
+It is in the gradle/wrapper/gradle-wrapper.properties file.
+Here is how to bootstrap that version:
+
+    gradle wrapper
+
+This will download the required Gradle distribution and create gradlew and
+gradlew.bat script files that you should use from now on.
+
+Once you have the wrapper installed you can invoke the build system.
 
 Here is how to run a full build with checks:
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ac6094d8/manual/src/docs/tutorials/howto-build-system.txt
----------------------------------------------------------------------
diff --git a/manual/src/docs/tutorials/howto-build-system.txt b/manual/src/docs/tutorials/howto-build-system.txt
index 86460f0..45c8b10 100644
--- a/manual/src/docs/tutorials/howto-build-system.txt
+++ b/manual/src/docs/tutorials/howto-build-system.txt
@@ -45,6 +45,13 @@ Build System configuration is done through Gradle properties.
 This can be done in many ways, see
 https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties[Gradle
properties and system properties].
 
+== The Wrapper ==
+
+`gradlew` and `gradlew.bat` scripts that can be found at the root of the Polygene sources
is *The Wrapper*.
+Any build invocation starts from this script.
+It will download the Gradle distribution version required by the build.
+See the https://docs.gradle.org/current/userguide/gradle_wrapper.html[Gradle Wrapper] documentation
for more details.
+
 == Main tasks ==
 
 The Polygene™ SDK project has tasks that work with the whole SDK.


Mime
View raw message