diff --git a/gradle/README.md b/gradle/README.md index e11cffbbb..7335346f5 100644 --- a/gradle/README.md +++ b/gradle/README.md @@ -1,5 +1,6 @@ -This folder contains experimental Gradle scripts as an alternative to Bazel. -These are work-in-progress and are expected to evolve in the near future. +This folder contains experimental Gradle scripts as an alternative to Bazel for +the open-source Nomulus project. These are work-in-progress and are expected to +evolve in the near future. ## Current status @@ -7,7 +8,8 @@ Currently there are two sub-projects, third_party, which contains the back-ported JUnit 4.13 code; and core, which contains all Nomulus source code. Gradle can be used to compile and run all Java tests. -Gradle is configured to use the existing Nomulus source tree. +Gradle is configured to use the directory containing this file as root, but use +the existing Nomulus source tree. Dependencies are mostly the same as in Bazel, with a few exceptions: @@ -38,38 +40,22 @@ sub-project configs. ## Initial Setup -Install Gradle 4.10.x on your local host, then run the following commands from -this directory: +Install Gradle on your local host, then run the following commands from this +directory: ```shell -GRADLE_DIR="$(pwd)" - -(cd "${GRADLE_DIR}"; gradle init; mkdir third_party core) - -cp root.gradle "${GRADLE_DIR}/build.gradle" - -cp settings.gradle "${GRADLE_DIR}" - -cp third_party.gradle "${GRADLE_DIR}/third_party/build.gradle" - -cp core.gradle "${GRADLE_DIR}/core/build.gradle" - -cd "${GRADLE_DIR}" +# One-time command to add gradle wrapper: +gradle wrapper +# Start the build: ./gradlew build ``` -The example above uses the directory with this file as working directory for -Gradle. You may use a different directory for Gradle, by assigning GRADLE_DIR to -the desired path. You will also need to update the following paths in the -.gradle files: - -* In "${GRADLE_DIR}/build.gradle", update allprojects > repositories > - flatDir > dirs to the correct location. -* In core/build.gradle, update 'javaSourceDir' and 'javatestSourceDir' to the - correct locations. -* In third_party/build.gradle, update SourceSets > main > java > srcDirs to - the correct locations. - -From now on, use './gradlew build' or './gradlew test' build and test your +From now on, use './gradlew build' or './gradlew test' to build and test your changes. + +To upgrade to a new Gradle version for this project, use: + +```shell +gradle wrapper --gradle-version version-number +``` diff --git a/gradle/root.gradle b/gradle/build.gradle similarity index 98% rename from gradle/root.gradle rename to gradle/build.gradle index f7ca13bff..3f358decc 100644 --- a/gradle/root.gradle +++ b/gradle/build.gradle @@ -132,7 +132,9 @@ subprojects { subproject -> implementation 'org.apache.httpcomponents:httpclient:4.5.2' implementation 'org.apache.httpcomponents:httpcore:4.4.4' implementation 'org.apache.mina:mina-core:2.0.4' - implementation 'org.apache.sshd:sshd-core:1.2.0' + implementation 'org.apache.sshd:sshd-core:2.0.0' + implementation 'org.apache.sshd:sshd-scp:2.0.0' + implementation 'org.apache.sshd:sshd-sftp:2.0.0' implementation 'org.apache.tomcat:servlet-api:6.0.45' implementation 'org.apache.tomcat:tomcat-annotations-api:8.0.5' implementation 'org.bouncycastle:bcpg-jdk15on:1.52' diff --git a/gradle/core.gradle b/gradle/core/build.gradle similarity index 100% rename from gradle/core.gradle rename to gradle/core/build.gradle diff --git a/gradle/third_party.gradle b/gradle/third_party/build.gradle similarity index 100% rename from gradle/third_party.gradle rename to gradle/third_party/build.gradle