This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy-geb.git


The following commit(s) were added to refs/heads/master by this push:
     new 2a675963 Build a src distribution for releasing #245
2a675963 is described below

commit 2a67596307224b8a2c21466538a1c949940bccd2
Author: Paul King <[email protected]>
AuthorDate: Wed Jan 15 19:37:07 2025 +1000

    Build a src distribution for releasing #245
---
 CONTRIBUTING.md                                    | 36 ++++++++++++++--
 bootstrap/build.gradle                             | 38 +++++++++++++++++
 bootstrap/settings.gradle                          |  0
 .../src/main/groovy/geb.source-distribution.gradle | 48 ++++++++++++++++++++++
 geb.gradle                                         |  2 +
 gradle.properties                                  |  3 +-
 6 files changed, 123 insertions(+), 4 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 38d1f3d3..85cffea2 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,14 +25,44 @@ To become a committer, you need to sign the [Apache 
Individual Contributor Agree
 ## Build Environment
 
 Geb builds with [Gradle](http://www.gradle.org/). 
-You do not need to have Gradle installed to work with the Geb build as Gradle 
provides an executable wrapper that you use to drive the build.
+You do not need to have Gradle installed to work with the Geb build as Gradle
+provides an executable wrapper that you use to drive the build.
 
 On UNIX type environments this is `gradlew` and is `gradlew.bat` on Windows.
+Most examples here are for UNIX type systems.
+You can leave off the leading `./` when using the wrapper on Windows.
 
-For example to run all the automated tests and quality checks for the entire 
project you would run…
+To see all available tasks you can run:
+
+    ./gradlew tasks
+
+But there are a few very common tasks worth knowing.
+For example, to run all the automated tests and quality
+checks for the entire project you would run:
 
     ./gradlew check
-    
+
+To publish Geb artifacts to your local Maven cache you would run:
+
+    ./gradlew publishToMavenLocal
+
+## Bootstrapping the build environment from a source distribution
+
+If you have cloned the source from the GitHub repo, you can skip this section. 
If instead
+you are using an ASF source release Zip, read on.
+
+ASF source releases don't contain binary files such as those needed by the 
Gradle wrapper.
+If using a source Zip release, there is an additional boostrap step you need 
to do
+to properly set up the build environment.
+
+The bootstrap step requires you to have a version of Gradle installed on your 
system.
+If you know the desired Gradle version, you can run Gradle's `wrapper` task.
+Alternatively, you can use the bootstrap project which knows about the correct 
Gradle version:
+
+    gradle -P bootstrap
+
+Now the wrapper will be installed, and you can follow the instructions 
elsewhere which use the wrapper.
+
 ## IDE import
 
 The project is set up to work with IntelliJ IDEA, simply import it using the 
native IntelliJ IDEA import for Gradle projects.
diff --git a/bootstrap/build.gradle b/bootstrap/build.gradle
new file mode 100644
index 00000000..d6ef1fc5
--- /dev/null
+++ b/bootstrap/build.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.
+ */
+
+def props = new Properties()
+file("$projectDir/../gradle.properties").withInputStream {
+    props.load(it)
+}
+
+defaultTasks 'bootstrap'
+
+tasks.withType(Wrapper).configureEach {
+    gradleVersion = props.gradle_version
+}
+
+tasks.register('bootstrap') {
+    dependsOn 'wrapper'
+    doLast {
+        ant.move file: "${projectDir}/gradlew", todir: "${projectDir}/../"
+        ant.move file: "${projectDir}/gradlew.bat", todir: "${projectDir}/../"
+        ant.move file: "${projectDir}/gradle/wrapper", todir: 
"${projectDir}/../gradle/"
+    }
+}
diff --git a/bootstrap/settings.gradle b/bootstrap/settings.gradle
new file mode 100644
index 00000000..e69de29b
diff --git a/buildSrc/src/main/groovy/geb.source-distribution.gradle 
b/buildSrc/src/main/groovy/geb.source-distribution.gradle
new file mode 100644
index 00000000..bb6d45c2
--- /dev/null
+++ b/buildSrc/src/main/groovy/geb.source-distribution.gradle
@@ -0,0 +1,48 @@
+/*
+ *  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.
+ */
+
+plugins {
+    id 'signing'
+}
+
+def srcSpec = copySpec {
+    from fileTree(rootProject.projectDir) {
+        exclude '.circleci', '.github', '.idea',
+            '**/build', '.asf.yaml', '.tm_properties',
+            'gradlew', 'gradlew.bat', 'gradle/wrapper', // gradlew
+            'out',             // used by Intellij IDEA
+            '**/*.iml',        // used by Intellij IDEA
+            '**/*.ipr',        // used by Intellij IDEA
+            '**/*.iws',        // used by Intellij IDEA
+            '.settings',       // used by Eclipse
+            '.classpath',      // used by Eclipse
+            '.gradle'          // used by Gradle
+    }
+}
+
+tasks.register('distSrc', Zip) {
+    archiveBaseName = 'apache-groovy-geb'
+    archiveAppendix = 'src'
+    into "groovy-geb-${project.version}"
+    with srcSpec
+}
+
+signing {
+    tasks.named('distSrc')
+}
diff --git a/geb.gradle b/geb.gradle
index 8010e90f..c7ecaf84 100644
--- a/geb.gradle
+++ b/geb.gradle
@@ -25,6 +25,7 @@ plugins {
     id 'geb.coordinates'
     alias(libs.plugins.nexusPublish)
     alias(libs.plugins.asl2)
+    id 'geb.source-distribution'
     id 'com.github.jk1.dependency-license-report' version '2.9'
     id 'org.nosphere.apache.rat'
     id 'com.github.ben-manes.versions' version '0.51.0'
@@ -100,6 +101,7 @@ tasks.named('rat') {
         'doc', // TODO re-enable checking for docs
         'logo.svg', // Logo svg
         'out/**', '*.ipr', '**/*.iml', '*.iws', '.idea/**', // Intellij files
+        'bootstrap/settings.gradle', // empty file
     ]
 }
 
diff --git a/gradle.properties b/gradle.properties
index e421e910..8945e104 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -14,4 +14,5 @@
 # limitations under the License.
 
 org.gradle.caching=true
-#org.gradle.caching.debug=true
\ No newline at end of file
+#org.gradle.caching.debug=true
+gradle_version=8.12

Reply via email to