ctubbsii commented on code in PR #2583:
URL: https://github.com/apache/thrift/pull/2583#discussion_r855420366
##########
doc/install/debian.md:
##########
@@ -18,7 +18,7 @@ Debian 7/Ubuntu 12 users need to manually install a more
recent version of autom
If you would like to build Apache Thrift libraries for other programming
languages you may need to install additional packages. The following languages
require the specified additional packages:
* Java
- * packages: gradle
+ * packages: gradle (version 6.9.2)
Review Comment:
I don't know that the Gradle version is a fixed requirement. Can clarify
that this was the version tested:
```suggestion
* packages: gradle (version 6.9.2 is confirmed to work)
```
##########
lib/java/.gitignore:
##########
@@ -0,0 +1,53 @@
+# Created by https://www.toptal.com/developers/gitignore/api/java,gradle
+# Edit at https://www.toptal.com/developers/gitignore?templates=java,gradle
+
+### Java ###
+# Compiled class file
+*.class
+
+# Log file
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.nar
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# virtual machine crash logs, see
http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+replay_pid*
+
+### Gradle ###
+.gradle
+**/build/
+!src/**/build/
+
+# Ignore Gradle GUI config
+gradle-app.setting
+
+# Cache of project
+.gradletasknamecache
+
+# Eclipse Gradle plugin generated files
+# Eclipse Core
+.project
+# JDT-specific (Eclipse Java Development Tools)
+.classpath
Review Comment:
Eclipse has a .settings/ directory also:
```suggestion
.classpath
.settings/
```
##########
lib/java/README.md:
##########
@@ -42,11 +42,41 @@ The Thrift Java source is not build using the GNU tools,
but rather uses
the Gradle build system, which tends to be predominant amongst Java
developers.
+Currently we use gradle 6.9.2 to build the Thrift Java source. The usual way
to setup gradle
+project is to include the gradle-wrapper.jar in the project and then run the
gradle wrapper to
+bootstrap setting up gradle binaries. However to avoid putting binary files
into the source tree we
+have ignored the gradle wrapper files. You are expected to install it
manually, as described in
+the [gradle
documentation](https://docs.gradle.org/current/userguide/installation.html), or
+following this step (which is also done in the travis CI docker images):
+
+```bash
+export GRADLE_VERSION="6.9.2"
+# install dependencies
+apt-get install -y --no-install-recommends openjdk-11-jdk-headless wget unzip
+# download gradle distribution
+wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip
-q -O /tmp/gradle-$GRADLE_VERSION-bin.zip
+# check binary integrity
+echo "8b356fd8702d5ffa2e066ed0be45a023a779bba4dd1a68fd11bc2a6bdc981e8f
/tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -
+# unzip and install
+unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip
+mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle
+ln -s /usr/local/gradle/bin/gradle /usr/local/bin
+```
+
+After the above step, `gradle` binary will be available in `/usr/local/bin/`.
You can further choose
+to locally create the gradle wrapper (even if they are ignored) using:
+
+```bash
+gradle wrapper --gradle-version $GRADLE_VERSION
+```
+
To compile the Java Thrift libraries, simply do the following:
- gradle
+```bash
+gradle
+```
-Yep, that's easy. Look for libthrift-<version>.jar in the build/libs directory.
+Yep, that's easy. Look for `libthrift-<version>.jar` in the build/libs
directory.
Review Comment:
We probably shouldn't say it's easy... that's subjective. Users may not
agree, and might interpret this as being arrogant.
```suggestion
Look for `libthrift-<version>.jar` in the build/libs directory.
```
##########
lib/java/README.md:
##########
@@ -42,11 +42,41 @@ The Thrift Java source is not build using the GNU tools,
but rather uses
the Gradle build system, which tends to be predominant amongst Java
developers.
+Currently we use gradle 6.9.2 to build the Thrift Java source. The usual way
to setup gradle
+project is to include the gradle-wrapper.jar in the project and then run the
gradle wrapper to
+bootstrap setting up gradle binaries. However to avoid putting binary files
into the source tree we
+have ignored the gradle wrapper files. You are expected to install it
manually, as described in
+the [gradle
documentation](https://docs.gradle.org/current/userguide/installation.html), or
+following this step (which is also done in the travis CI docker images):
+
+```bash
+export GRADLE_VERSION="6.9.2"
+# install dependencies
+apt-get install -y --no-install-recommends openjdk-11-jdk-headless wget unzip
+# download gradle distribution
+wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip
-q -O /tmp/gradle-$GRADLE_VERSION-bin.zip
+# check binary integrity
+echo "8b356fd8702d5ffa2e066ed0be45a023a779bba4dd1a68fd11bc2a6bdc981e8f
/tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -
+# unzip and install
+unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip
+mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle
+ln -s /usr/local/gradle/bin/gradle /usr/local/bin
+```
+
+After the above step, `gradle` binary will be available in `/usr/local/bin/`.
You can further choose
+to locally create the gradle wrapper (even if they are ignored) using:
Review Comment:
```suggestion
After the above step, the `gradle` binary will be available in
`/usr/local/bin/`. You may then choose
to locally create the Gradle Wrapper, if you wish to run commands with
`gradlew` instead of `gradle`, using:
```
##########
lib/java/README.md:
##########
@@ -42,11 +42,41 @@ The Thrift Java source is not build using the GNU tools,
but rather uses
the Gradle build system, which tends to be predominant amongst Java
developers.
+Currently we use gradle 6.9.2 to build the Thrift Java source. The usual way
to setup gradle
+project is to include the gradle-wrapper.jar in the project and then run the
gradle wrapper to
+bootstrap setting up gradle binaries. However to avoid putting binary files
into the source tree we
+have ignored the gradle wrapper files. You are expected to install it
manually, as described in
+the [gradle
documentation](https://docs.gradle.org/current/userguide/installation.html), or
+following this step (which is also done in the travis CI docker images):
Review Comment:
Minor punctuation, capitalization, and phrasing improvements:
```suggestion
Currently, we use Gradle 6.9.2 to build the Thrift Java source. The usual
way to setup Gradle
project is to include the gradle-wrapper.jar in the project and then run the
Gradle Wrapper to
bootstrap setting up Gradle binaries. However, to avoid putting binary files
into the source tree, we
have excluded the Gradle Wrapper files. You are expected to install Gradle
manually, as described in
the [Gradle
documentation](https://docs.gradle.org/current/userguide/installation.html), or
following the following steps (which is also done in the Travis CI Docker
images):
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]