Skip to content

Commit 0c147fb

Browse files
julianhydeF21
authored andcommitted
[CALCITE-4575] Remove Gradle wrapper from source distribution
1 parent 9486557 commit 0c147fb

File tree

3 files changed

+46
-27
lines changed

3 files changed

+46
-27
lines changed

release/build.gradle.kts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ Release artifacts are signed with the following key:
7777
https://people.apache.org/keys/committer/$committerId.asc
7878
https://www.apache.org/dist/$tlpUrl/KEYS
7979
80-
N.B.
81-
To create the jars and test $componentName: "./gradlew build -Prelease -PskipSign".
80+
To create the jars and test $componentName: "gradle build -Prelease -PskipSign".
8281
83-
If you do not have a Java environment available, you can run the tests
82+
If you do not have a Java/Gradle environment available, you can run the tests
8483
using docker. To do so, install docker and docker-compose, then run
8584
"docker-compose run test" from the root of the directory.
8685
@@ -89,7 +88,7 @@ Please vote on releasing this package as $componentName $version.
8988
The vote is open for the next 72 hours and passes if a majority of at
9089
least three +1 PMC votes are cast.
9190
92-
[ ] +1 Release this package as Apache Calcite $version
91+
[ ] +1 Release this package as Apache Calcite Avatica $version
9392
[ ] 0 I don't feel strongly about it, but I'm okay with the release
9493
[ ] -1 Do not release this package because...
9594
@@ -142,6 +141,15 @@ fun CopySpec.excludeLicenseFromSourceRelease() {
142141
exclude("LICENSE")
143142
}
144143

144+
fun CopySpec.excludeGradleWrapperFromSourceRelease() {
145+
// Source distributions must not include binary files. The Gradle wrapper
146+
// requires gradle-wrapper.jar, so exclude the whole wrapper. Users must
147+
// install Gradle manually.
148+
exclude("gradlew")
149+
exclude("gradlew.bat")
150+
exclude("gradle/wrapper/**")
151+
}
152+
145153
fun CopySpec.excludeCategoryBLicensedWorksFromSourceRelease() {
146154
// The source distribution contains "font-awesome:fonts" which is licensed as
147155
// http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License).
@@ -167,6 +175,7 @@ fun CrLfSpec.sourceLayout() = copySpec {
167175
from(rootDir) {
168176
gitignore(gitProps)
169177
excludeLicenseFromSourceRelease()
178+
excludeGradleWrapperFromSourceRelease()
170179
excludeCategoryBLicensedWorksFromSourceRelease()
171180
}
172181
}

site/_docs/history.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Please see below to determine how the breaking change will affect your project.
3636

3737
Compatibility: This release is tested
3838
on Linux, macOS, Microsoft Windows;
39-
using Oracle JDK 8, 9, 10, 11, 12, 13, 14;
39+
using Oracle JDK 8, 9, 10, 11, 12, 13, 14, 15;
4040
using IBM Java 8;
4141
Guava versions 14.0 to 29.0;
4242
other software versions as specified in `gradle.properties`.

site/_docs/howto.md

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,27 @@ Here's some miscellaneous documentation about using Avatica.
3030

3131
## Building from a source distribution
3232

33-
Prerequisites are Java (JDK 8 or later) on your path.
33+
Prerequisites are Java (JDK 8 or later)
34+
and Gradle (version 6.8.1) on your path.
35+
36+
(The source distribution
37+
[does not include the Gradle wrapper](https://issues.apache.org/jira/browse/CALCITE-4575);
38+
therefore you need to
39+
[install Gradle manually](https://gradle.org/releases/).)
3440

3541
Unpack the source distribution `.tar.gz` file,
3642
`cd` to the root directory of the unpacked source,
37-
then build using maven:
43+
then build using Gradle:
3844

3945
{% highlight bash %}
4046
$ tar xvfz apache-calcite-avatica-1.18.0-src.tar.gz
4147
$ cd apache-calcite-avatica-1.18.0-src
42-
$ ./gradlew build
48+
$ gradle build
4349
{% endhighlight %}
4450

4551
[Running tests](#running-tests) describes how to run more or fewer
46-
tests.
52+
tests (but you should use the `gradle` command rather than
53+
`./gradlew`).
4754

4855
## Building from Git
4956

@@ -52,17 +59,14 @@ and Java (JDK 8 or later) on your path.
5259

5360
Create a local copy of the GitHub repository,
5461
`cd` to its root directory,
55-
then build using maven:
62+
then build using Gradle:
5663

5764
{% highlight bash %}
5865
$ git clone git://github.com/apache/calcite-avatica.git avatica
5966
$ cd avatica
6067
$ ./gradlew build
6168
{% endhighlight %}
6269

63-
Note: [gdub](https://github.com/dougborg/gdub) simplifies `./gradlew build` to `gw build`,
64-
and it simplifies cases like `../../gradlew ...` to `gw ...` as well.
65-
6670
[Running tests](#running-tests) describes how to run more or fewer
6771
tests.
6872

@@ -83,7 +87,8 @@ You can use `./gradlew assemble` to build the artifacts and skip all tests and v
8387

8488
### To run tests in docker:
8589

86-
* You will need to have [docker](https://docs.docker.com/install/) and [Docker Compose](https://docs.docker.com/compose/install/) installed.
90+
Prerequisites are [Docker](https://docs.docker.com/install/) and
91+
[Docker Compose](https://docs.docker.com/compose/install/).
8792

8893
{% highlight bash %}
8994
docker-compose run test
@@ -123,7 +128,7 @@ ball because that would be
123128

124129
## Run a GPG agent
125130

126-
By default, Maven plugins which require you to unlock a GPG secret key
131+
By default, Gradle plugins which require you to unlock a GPG secret key
127132
will prompt you in the terminal. To prevent you from having to enter
128133
this password numerous times, it is highly recommended to install and
129134
run `gpg-agent`.
@@ -167,8 +172,10 @@ asfSvnUsername=
167172
asfSvnPassword=
168173
{% endhighlight %}
169174

170-
Note: when https://github.com/vlsi/asflike-release-environment is used, the credentials are takend from
171-
`asfTest...` (e.g. `asfTestNexusUsername=test`)
175+
When
176+
[asflike-release-environment](https://github.com/vlsi/asflike-release-environment)
177+
is used, the credentials are taken from `asfTest...`
178+
(e.g. `asfTestNexusUsername=test`)
172179

173180
Note: if you want to uses `gpg-agent`, you need to pass `useGpgCmd` property, and specify the key id
174181
via `signing.gnupg.keyName`.
@@ -194,6 +201,7 @@ Before you start:
194201
* Set up signing keys as described above.
195202
* Make sure you are using JDK 8 (not 9 or 10).
196203
* Check that `README`, `site/_docs/howto.md`, `site/_docs/docker_images.md` have the correct version number.
204+
* Check that `site/_docs/howto.md` has the correct Gradle version.
197205
* Check that `NOTICE` has the current copyright year.
198206
* Check that `calcite.avatica.version` has the proper value in `/gradle.properties`.
199207
* Add release notes to `site/_docs/history.md`. Include the commit history,
@@ -269,7 +277,9 @@ docker-compose run -v /c/Users/username/AppData/Roaming/gnupg:/.gnupg publish-re
269277
* That directory must contain files `NOTICE`, `LICENSE`,
270278
`README`, `README.md`
271279
* Check that the version in `README` is correct
272-
* Make sure that there is no `KEYS` file in the source distros
280+
* Make sure that the following files do not occur in the source
281+
distros: `KEYS`, `gradlew`, `gradlew.bat`, `gradle-wrapper.jar`,
282+
`gradle-wrapper.properties`
273283
* For each .jar (for example `core/build/libs/avatica-core-X.Y.Z.jar`
274284
and `server/build/libs/avatica-server-X.Y.Z-sources.jar`),
275285
verify that the `META-INF` directory contains the correct
@@ -299,23 +309,23 @@ gpg --recv-keys key
299309
# Check keys
300310
curl -O https://dist.apache.org/repos/dist/release/calcite/KEYS
301311

302-
# Sign/check sha256 hashes
312+
# Sign/check sha512 hashes
303313
# (Assumes your O/S has a 'shasum' command.)
304314
function checkHash() {
305315
cd "$1"
306316
for i in *.{pom,gz}; do
307317
if [ ! -f $i ]; then
308318
continue
309319
fi
310-
if [ -f $i.sha256 ]; then
311-
if [ "$(cat $i.sha256)" = "$(shasum -a 256 $i)" ]; then
312-
echo $i.sha256 present and correct
320+
if [ -f $i.sha512 ]; then
321+
if [ "$(cat $i.sha512)" = "$(shasum -a 512 $i)" ]; then
322+
echo $i.sha512 present and correct
313323
else
314-
echo $i.sha256 does not match
324+
echo $i.sha512 does not match
315325
fi
316326
else
317-
shasum -a 256 $i > $i.sha256
318-
echo $i.sha256 created
327+
shasum -a 512 $i > $i.sha512
328+
echo $i.sha512 created
319329
fi
320330
done
321331
}
@@ -349,7 +359,7 @@ The artifacts to be voted on are located here:
349359
https://dist.apache.org/repos/dist/dev/calcite/apache-calcite-avatica-X.Y.Z-rcN/
350360

351361
The hashes of the artifacts are as follows:
352-
src.tar.gz.sha256 XXXX
362+
src.tar.gz.sha512 XXXX
353363

354364
A staged Maven repository is available for review at:
355365
https://repository.apache.org/content/repositories/orgapachecalcite-NNNN
@@ -362,7 +372,7 @@ Please vote on releasing this package as Apache Calcite Avatica X.Y.Z.
362372
The vote is open for the next 72 hours and passes if a majority of
363373
at least three +1 PMC votes are cast.
364374

365-
[ ] +1 Release this package as Apache Calcite X.Y.Z
375+
[ ] +1 Release this package as Apache Calcite Avatica X.Y.Z
366376
[ ] 0 I don't feel strongly about it, but I'm okay with the release
367377
[ ] -1 Do not release this package because...
368378

0 commit comments

Comments
 (0)