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/12/14 19:24:35 UTC

[45/50] [abbrv] incubator-edgent git commit: remove gradle wrapper jar from the source bundle per policy

remove gradle wrapper jar from the source bundle per policy

add a build bootstrap step for source bundles
retain the wrapper in the repo for travis-ci use

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

Branch: refs/heads/master
Commit: e83df78e844e1c3638922dd520ba03fec7ac8956
Parents: 94cb416
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Wed Nov 30 17:21:25 2016 -0500
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Wed Nov 30 17:21:25 2016 -0500

----------------------------------------------------------------------
 DEVELOPMENT.md | 10 +++++++++-
 README         |  7 +++++++
 build.gradle   |  7 ++++++-
 wrapper.gradle | 38 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 60 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/e83df78e/DEVELOPMENT.md
----------------------------------------------------------------------
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index 61168ef..263a91e 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -35,12 +35,19 @@ Once you have forked the repository and created your local clone you need to dow
 these additional development software tools.
 
 * Java 8 - The development setup assumes Java 8 and Linux.
+* gradle - (https://gradle.org/) only if building from a source release bundle
 
 All Edgent runtime development is done using Java 8.  JARs for Java 7 and Android
 platforms are created as described below.
 
 ### Building a Binary Release Bundle
 
+Building from a source release bundle (lacking a `./gradlew`) requires
+performing a one-time bootstrap step using an installed version of gradle:
+``` sh
+$ gradle          # one time gradle build bootstrap setup.
+```
+
 Building an Edgent binary release bundle:
 ``` sh
 $ ./gradlew release
@@ -73,7 +80,8 @@ The Gradle tooling:
 The top-level Gradle file is `edgent/build.gradle` and it contains several
 unique tasks:
 
-* `assemble` (default) : Build all code and Javadoc into `build\distributions`. The build will fail on any code error or Javadoc warning or error.
+* `downloadWrapper` (default) : one-time bootstrap processing for use when building from a source release bundle 
+* `assemble` : 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

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/e83df78e/README
----------------------------------------------------------------------
diff --git a/README b/README
index 8c3717f..59e10a6 100644
--- a/README
+++ b/README
@@ -17,8 +17,15 @@ or in the repository mirror at github https://github.com/apache/incubator-edgent
 
 Pre-requisites:
 - Java 8 is required to build an Edgent binary distribution
+- gradle (https://gradle.org/) only if building from a source release bundle
+
+Building from a source release bundle (lacking a ./gradlew) requires
+performing a one-time bootstrap step using an installed version of gradle:
+
+$ gradle          # one time gradle build bootstrap setup.
 
 Build an Edgent binary distribution:
+
 $ ./gradlew release   # .\gradlew.bat on Windows
 
 The build reports the location of the binary distribution bundle that can then

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/e83df78e/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 84305bc..4090017 100644
--- a/build.gradle
+++ b/build.gradle
@@ -17,7 +17,11 @@ specific language governing permissions and limitations
 under the License.
 */
  
-defaultTasks 'assemble'
+ext {
+  gradleVersion = "3.1"
+  gradleDistributionSha256Sum = "c7de3442432253525902f7e8d7eac8b5fd6ce1623f96d76916af6d0e383010fc"
+}
+apply from: 'wrapper.gradle'
 
 apply from: 'other.gradle'
 
@@ -745,6 +749,7 @@ task srcReleaseTarGz(type: Tar) {
   from '.'
   exclude 'KEYS'
   exclude '.git', '.gradle', '.settings'
+  exclude '.gradle-wrapper', 'gradlew', 'gradlew.bat'
   exclude '**/build/'           // gradle generated artifacts
   exclude '**/externalJars/'    // gradle generated artifacts for eclipse
   exclude '**/bin/'             // eclipse generated artifacts

http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/e83df78e/wrapper.gradle
----------------------------------------------------------------------
diff --git a/wrapper.gradle b/wrapper.gradle
new file mode 100644
index 0000000..fbc49d7
--- /dev/null
+++ b/wrapper.gradle
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+defaultTasks 'downloadWrapper'
+
+task downloadWrapper(type: Wrapper) {
+    description = "Download the gradle wrapper and requisite files. Overwrites existing wrapper files."
+    jarFile = "${project.projectDir}/.gradle-wrapper/gradle-wrapper.jar"
+    
+    gradleVersion = project.gradleVersion
+    // ugh... must manually set in generated gradle-wrapper.properties
+    // distributionSha256Sum = project.gradleDistributionSha256Sum
+    
+    doLast {
+      File wrapperProps = file(propertiesFile)
+      wrapperProps.append("distributionSha256Sum=${project.gradleDistributionSha256Sum}\n");
+    }
+    doLast {
+      println "The gradle wrapper is now initialized." +
+            "\nUse ./gradlew for subsequent build operations."
+    }
+}
\ No newline at end of file