You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by pa...@apache.org on 2017/05/18 05:31:58 UTC
[1/3] polygene-java git commit: Update Gradle Wrapper
Repository: polygene-java
Updated Branches:
refs/heads/develop 40522f699 -> d5d753ffd
Update Gradle Wrapper
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/e3c5f7c2
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/e3c5f7c2
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/e3c5f7c2
Branch: refs/heads/develop
Commit: e3c5f7c20cbaf4532c1f5c2939e54471f26c50bf
Parents: 40522f6
Author: Paul Merlin <pa...@apache.org>
Authored: Wed May 17 12:28:21 2017 +0200
Committer: Paul Merlin <pa...@apache.org>
Committed: Wed May 17 12:28:21 2017 +0200
----------------------------------------------------------------------
gradle/wrapper/gradle-wrapper.jar | Bin 54227 -> 54416 bytes
gradlew | 6 +++---
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e3c5f7c2/gradle/wrapper/gradle-wrapper.jar
----------------------------------------------------------------------
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 51288f9..f662fc6 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e3c5f7c2/gradlew
----------------------------------------------------------------------
diff --git a/gradlew b/gradlew
index 4453cce..cccdd3d 100755
--- a/gradlew
+++ b/gradlew
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
-warn ( ) {
+warn () {
echo "$*"
}
-die ( ) {
+die () {
echo
echo "$*"
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
fi
# Escape application args
-save ( ) {
+save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
[2/3] polygene-java git commit: Build verify used Gradle version and
nag if unsupported
Posted by pa...@apache.org.
Build verify used Gradle version and nag if unsupported
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/cf4876b7
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/cf4876b7
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/cf4876b7
Branch: refs/heads/develop
Commit: cf4876b708b6f3230f3ff5d900bcdd000dc33d6e
Parents: e3c5f7c
Author: Paul Merlin <pa...@apache.org>
Authored: Wed May 17 12:29:40 2017 +0200
Committer: Paul Merlin <pa...@apache.org>
Committed: Wed May 17 12:29:40 2017 +0200
----------------------------------------------------------------------
.../DependenciesDeclarationExtension.groovy | 1 +
.../polygene/gradle/structure/RootPlugin.groovy | 23 ++++++++++++++++++++
dependencies.gradle | 3 +++
3 files changed, 27 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/cf4876b7/buildSrc/src/main/groovy/org/apache/polygene/gradle/dependencies/DependenciesDeclarationExtension.groovy
----------------------------------------------------------------------
diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/dependencies/DependenciesDeclarationExtension.groovy b/buildSrc/src/main/groovy/org/apache/polygene/gradle/dependencies/DependenciesDeclarationExtension.groovy
index 9277e62..2f9284a 100644
--- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/dependencies/DependenciesDeclarationExtension.groovy
+++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/dependencies/DependenciesDeclarationExtension.groovy
@@ -25,6 +25,7 @@ import org.gradle.api.artifacts.component.ModuleComponentSelector
@CompileStatic
class DependenciesDeclarationExtension
{
+ String gradleVersion
final Map<String, String> repositoriesUrls = [ : ]
final Map<String, Object> libraries = [ : ]
final Map<String, List<Object>> defaultDependencies = [ : ]
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/cf4876b7/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/RootPlugin.groovy
----------------------------------------------------------------------
diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/RootPlugin.groovy b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/RootPlugin.groovy
index 5b0c497..3f54424 100644
--- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/RootPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/RootPlugin.groovy
@@ -19,8 +19,11 @@ package org.apache.polygene.gradle.structure
import groovy.transform.CompileStatic
import org.apache.polygene.gradle.BasePlugin
+import org.apache.polygene.gradle.dependencies.DependenciesDeclarationExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
+import org.gradle.api.tasks.wrapper.Wrapper
+import org.gradle.util.GradleVersion
@CompileStatic
class RootPlugin implements Plugin<Project>
@@ -34,6 +37,7 @@ class RootPlugin implements Plugin<Project>
{
project.plugins.apply BasePlugin
applyProjectMetadata( project )
+ applyGradleWrapper( project )
}
private static void applyProjectMetadata( Project project )
@@ -42,4 +46,23 @@ class RootPlugin implements Plugin<Project>
extraProperties.set 'title', PROJECT_TITLE
extraProperties.set 'description', PROJECT_DESCRIPTION
}
+
+ private static void applyGradleWrapper( Project project )
+ {
+ def dependencies = project.extensions.getByType( DependenciesDeclarationExtension )
+ def requiredGradleVersion = GradleVersion.version( dependencies.gradleVersion )
+ def currentGradleVersion = GradleVersion.current()
+ if( currentGradleVersion != requiredGradleVersion ) {
+ def warning = "The Apache Polygene™ build is not supported with $currentGradleVersion. " +
+ "The only supported version is $requiredGradleVersion."
+ project.logger.error( warning )
+ project.gradle.buildFinished {
+ project.logger.error( warning )
+ }
+ }
+ project.tasks.create( 'wrapper', Wrapper) { Wrapper wrapper ->
+ wrapper.gradleVersion = dependencies.gradleVersion
+ wrapper.distributionType = Wrapper.DistributionType.ALL
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/cf4876b7/dependencies.gradle
----------------------------------------------------------------------
diff --git a/dependencies.gradle b/dependencies.gradle
index 3bab48f..8cf7a17 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -19,6 +19,9 @@ import org.apache.polygene.gradle.dependencies.DependenciesDeclarationExtension
def dependencies = extensions.getByType( DependenciesDeclarationExtension )
+// Gradle version
+dependencies.gradleVersion = '3.5'
+
// Remote repositories
dependencies.repositoriesUrls << [
mavenCentral: "https://repo1.maven.org/maven2/",
[3/3] polygene-java git commit: Fix Gradle wrapper installation from
source distribution
Posted by pa...@apache.org.
Fix Gradle wrapper installation from source distribution
A separate mini-build that should be compatible with ancient versions of
Gradle allows to install the Gradle Wrapper pointing to the Gradle
version required by the Polygene build.
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/d5d753ff
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/d5d753ff
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/d5d753ff
Branch: refs/heads/develop
Commit: d5d753ffd1784eed411c314e6519ac01c37c725a
Parents: cf4876b
Author: Paul Merlin <pa...@apache.org>
Authored: Wed May 17 12:41:24 2017 +0200
Committer: Paul Merlin <pa...@apache.org>
Committed: Wed May 17 13:00:34 2017 +0200
----------------------------------------------------------------------
.../distributions/DistributionsPlugin.groovy | 19 +++++++++++----
distributions/src/src-dist/README.txt | 16 +++++++------
.../gradle/wrapper-install/build.gradle | 25 ++++++++++++++++++++
.../gradle/wrapper-install/settings.gradle | 19 +++++++++++++++
4 files changed, 68 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d5d753ff/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 46233ce..3425d70 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
@@ -52,6 +52,7 @@ import org.gradle.plugins.ide.internal.IdeDependenciesExtractor
import org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency
import org.gradle.plugins.signing.Sign
import org.gradle.plugins.signing.SigningExtension
+import org.gradle.process.ExecSpec
import java.nio.file.Files
import java.nio.file.Path
@@ -118,6 +119,7 @@ class DistributionsPlugin implements Plugin<Project>
private static void applySourceDistribution( Project project )
{
def releaseSpec = project.extensions.getByType( ReleaseSpecExtension )
+ def dependenciesDeclaration = project.rootProject.extensions.getByType( DependenciesDeclarationExtension )
def srcDistFilesCopySpec = project.copySpec { CopySpec spec ->
spec.from project.rootProject.projectDir
spec.include '*.txt'
@@ -147,7 +149,7 @@ class DistributionsPlugin implements Plugin<Project>
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/wrapper/**' // Gradle wrapper
spec.exclude '**/.gradle/**' // Gradle caches
spec.exclude '**/.gradletasknamecache' // Gradle shell completion cache
spec.exclude '**/node_modules/**' // Node's node_module dir
@@ -168,6 +170,7 @@ class DistributionsPlugin implements Plugin<Project>
def srcDistSupplementaryFilesCopySpec = project.copySpec { CopySpec spec ->
spec.from project.file( 'src/src-dist' )
spec.into '.'
+ spec.filter { String line -> line.replaceAll( '%REQUIRED_GRADLE_VERSION%', dependenciesDeclaration.gradleVersion ) }
}
def srcDistFilteredFilesTask = project.tasks.create 'srcDistFilteredFiles'
srcDistFilteredFilesTask.description = 'Apply release specification to source distribution build scripts'
@@ -307,21 +310,29 @@ class DistributionsPlugin implements Plugin<Project>
}
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.description = 'Checks the source distribution by running `gradle check assemble` 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
- def gradlew = new File( project.rootDir, 'gradlew' ).absolutePath
+ def gradlew = new File( workDir, 'gradlew' ).absolutePath
def settings = new File( workDir, 'settings.gradle' ).absolutePath
- task.commandLine = [ gradlew, '-c', settings, 'build', '-u', '-s', /* '-g', workDir */ ]
+ task.commandLine = [ gradlew, '-c', settings, 'check', 'assemble', '-u', '-s', /* '-g', workDir */ ]
task.doFirst {
project.copy { CopySpec spec ->
spec.from unpackedSrcDistDir
spec.into workDir
}
+ def logName = "${ TaskNames.BUILD_SOURCE_DIST }_installWrapper"
+ def stdout = project.file( "${ project.buildDir }/log/$logName/$logName-stdout.log" )
+ def stderr = project.file( "${ project.buildDir }/log/$logName/$logName-stderr.log" )
+ def rootGradlew = new File( project.rootDir, 'gradlew' ).absolutePath
+ ExecLogged.execLogged( project, stdout, stderr, { ExecSpec spec ->
+ spec.workingDir = workDir
+ spec.commandLine = [ rootGradlew, '-i', '-s', '-b', 'gradle/wrapper-install/build.gradle', 'install' ]
+ } as Action )
}
task.doLast {
if( workDir.exists() )
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d5d753ff/distributions/src/src-dist/README.txt
----------------------------------------------------------------------
diff --git a/distributions/src/src-dist/README.txt b/distributions/src/src-dist/README.txt
index de6c218..2aa83ed 100644
--- a/distributions/src/src-dist/README.txt
+++ b/distributions/src/src-dist/README.txt
@@ -7,9 +7,9 @@ This Apache Polygene™ Source Distribution contains everything you need to
create Polygene™ applications.
-Polygene™ started in 2007, and is still in heavy development under the umbrella of
-the Apache Polygene™ project at the Apache Software Foundation. We would like
-developers around the world to participate in the advancement of this
+Polygene™ started in 2007, and is still in heavy development under the umbrella
+of the Apache Polygene™ project at the Apache Software Foundation. We would
+like developers around the world to participate in the advancement of this
cool, new and challenging technology. We are especially interested in
people willing to help improve the SDK, samples, tutorials, documentation
and other supporting material.
@@ -46,13 +46,12 @@ To build Polygene™ from sources you only need to have a valid Java JDK >= 8
installation and any version of Gradle.
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
+ gradle -b gradle/wrapper-install/build.gradle install
-This will download the required Gradle distribution and create gradlew and
-gradlew.bat script files that you should use from now on.
+This will deploy the Gradle Wrapper 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.
@@ -60,6 +59,9 @@ Here is how to run a full build with checks:
./gradlew check assemble
+Running gradlew for the first time will download the required Gradle
+distribution. You can run ./gradlew tasks to list available tasks.
+
Read the Polygene™ Build System tutorial for more details:
https://polygene.apache.org/java/latest/build-system.html
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d5d753ff/distributions/src/src-dist/gradle/wrapper-install/build.gradle
----------------------------------------------------------------------
diff --git a/distributions/src/src-dist/gradle/wrapper-install/build.gradle b/distributions/src/src-dist/gradle/wrapper-install/build.gradle
new file mode 100644
index 0000000..232ab00
--- /dev/null
+++ b/distributions/src/src-dist/gradle/wrapper-install/build.gradle
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+task install( type: Wrapper ) {
+ description = 'Installs the Gradle Wrapper in Apache Polygene™ source distribution.'
+ gradleVersion = '%REQUIRED_GRADLE_VERSION%'
+ def targetRoot = project.rootDir.parentFile.parentFile
+ jarFile = new File(targetRoot, 'gradle/wrapper/gradle-wrapper.jar')
+ scriptFile = new File(targetRoot, 'gradlew')
+}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/d5d753ff/distributions/src/src-dist/gradle/wrapper-install/settings.gradle
----------------------------------------------------------------------
diff --git a/distributions/src/src-dist/gradle/wrapper-install/settings.gradle b/distributions/src/src-dist/gradle/wrapper-install/settings.gradle
new file mode 100644
index 0000000..a183ce3
--- /dev/null
+++ b/distributions/src/src-dist/gradle/wrapper-install/settings.gradle
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+
+// Gradle build root directory marker