Skip to content

Commit 04ca317

Browse files
committed
fix gradle bootstrap process
1 parent dcce932 commit 04ca317

File tree

9 files changed

+55
-54
lines changed

9 files changed

+55
-54
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ For further information, please consult the [documentation](https://docs.grails.
112112

113113
For detailed building Grails, please consult the [CONTRIBUTING.md](CONTRIBUTING.md) file. To bootstrap the project from a source distribution, you can execute:
114114

115-
gradle wrapper
115+
cd gralde-bootstrap
116+
gradle wrapper
116117

117118
Then you can proceed with running any valid gradle command from [CONTRIBUTING.md](CONTRIBUTING.md).
118119

build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import java.time.Instant
1919
import java.time.ZoneOffset
2020
import java.time.format.DateTimeFormatter
2121

22-
23-
2422
ext {
2523
isReproducibleBuild = System.getenv("SOURCE_DATE_EPOCH") != null
2624
buildInstant = java.util.Optional.ofNullable(System.getenv("SOURCE_DATE_EPOCH"))
@@ -92,7 +90,6 @@ subprojects {
9290
}
9391

9492
apply {
95-
from layout.projectDirectory.file('gradle/gradle-wrapper-root-config.gradle')
9693
from layout.projectDirectory.file('gradle/publish-root-config.gradle')
9794
from layout.projectDirectory.file('gradle/rat-root-config.gradle')
9895
}

gradle-bootstrap/build.gradle

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* https://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
def props = new Properties()
21+
project.rootProject.layout.projectDirectory.file('../.sdkmanrc').asFile.withInputStream {
22+
props.load(it)
23+
}
24+
tasks.withType(Wrapper).configureEach {
25+
gradleVersion = props.gradle
26+
}
27+
28+
defaultTasks 'bootstrap'
29+
tasks.register('bootstrap') {
30+
dependsOn 'wrapper'
31+
doLast {
32+
ant.copy file: "${projectDir}/gradlew", todir: "${projectDir}/../grails-forge"
33+
ant.copy file: "${projectDir}/gradlew.bat", todir: "${projectDir}/../grails-forge"
34+
ant.copy(todir: "${projectDir}/../grails-forge/gradle/wrapper") {
35+
fileset(dir: "${projectDir}/gradle/wrapper") {
36+
include(name: 'gradle-wrapper.jar')
37+
include(name: 'gradle-wrapper.properties')
38+
}
39+
}
40+
ant.copy file: "${projectDir}/gradlew", todir: "${projectDir}/../grails-gradle"
41+
ant.copy file: "${projectDir}/gradlew.bat", todir: "${projectDir}/../grails-gradle"
42+
ant.copy(todir: "${projectDir}/../grails-gradle/gradle/wrapper") {
43+
fileset(dir: "${projectDir}/gradle/wrapper") {
44+
include(name: 'gradle-wrapper.jar')
45+
include(name: 'gradle-wrapper.properties')
46+
}
47+
}
48+
ant.move file: "${projectDir}/gradlew", todir: "${projectDir}/../"
49+
ant.move file: "${projectDir}/gradlew.bat", todir: "${projectDir}/../"
50+
ant.move file: "${projectDir}/gradle/wrapper", todir: "${projectDir}/../gradle"
51+
}
52+
}

gradle/gradle-wrapper-root-config.gradle renamed to gradle-bootstrap/settings.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,4 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
def props = new Properties()
20-
project.rootProject.layout.projectDirectory.file('.sdkmanrc').asFile.withInputStream {
21-
props.load(it)
22-
}
23-
tasks.withType(Wrapper).configureEach {
24-
gradleVersion = props.gradle
25-
}
19+

grails-gradle/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,5 @@ ext {
5454
}
5555

5656
apply {
57-
from layout.projectDirectory.file('gradle/gradle-wrapper-root-config.gradle')
5857
from layout.projectDirectory.file('gradle/publish-root-config.gradle')
5958
}

grails-gradle/gradle/gradle-wrapper-root-config.gradle

Lines changed: 0 additions & 27 deletions
This file was deleted.

grails-gradle/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
# Licensed to the Apache Software Foundation (ASF) under one or more
2-
# contributor license agreements. See the NOTICE file distributed with
3-
# this work for additional information regarding copyright ownership.
4-
# The ASF licenses this file to You under the Apache License, Version 2.0
5-
# (the "License"); you may not use this file except in compliance with
6-
# the License. You may obtain a copy of the License at
7-
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
10-
# Unless required by applicable law or agreed to in writing, software
11-
# distributed under the License is distributed on an "AS IS" BASIS,
12-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
# See the License for the specific language governing permissions and
14-
# limitations under the License.
15-
161
distributionBase=GRADLE_USER_HOME
172
distributionPath=wrapper/dists
183
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip

grails-gradle/gradlew

100755100644
File mode changed.

grails-gradle/gradlew.bat

100755100644
File mode changed.

0 commit comments

Comments
 (0)