google-nomulus/gradle
shicong b84fb004c8 Add source code and JAR file to internal repository
This CL made the following changes to achieve the purpose:

1. Modified HttpProxy.java to generate a file containing Maven
   coordinates for all requested JAR files. This is to replace
   Gradle task "generateMavenCoordinateForDependency" which served
   for the same purpose before. The reason is during the course
   of the build, Gradle may request some POM file of a artifact
   for some reason but it doesn't actually need the JAR file.
   However, task "generateMavenCoordinateForDependency" cannot
   identify this use case so it added more JARs to the dependency
   which are not necessary and are not consistent with what we
   get from HttpProxy.java. Going forward, we will use HttpProxy.java
   as the single source to provide dependency.

2. Updated update_deps_metadata.py to retrieve *-sources.jar for each
   dependency for obvious reason.

3. Improved update_dependency.sh by removing 1 unnecessary build.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=247607871
2019-05-13 12:41:31 -04:00
..
buildSrc Refactor Gradle project setup 2019-05-06 17:03:18 -04:00
config/checkstyle Add Checkstyle and Error Prone to the Gradle build 2019-01-31 13:49:33 -05:00
core Remove failing tests from Nomulus GCB pipeline 2019-05-06 16:58:15 -04:00
gradle Remove failing tests from Nomulus GCB pipeline 2019-05-06 16:58:15 -04:00
node_modules Add the Closure Compiler/Library/Templates dependencies 2019-02-08 11:21:43 -05:00
proxy Upgrade truth to v0.44 2019-05-06 16:39:17 -04:00
services Upgrade truth to v0.44 2019-05-06 16:39:17 -04:00
third_party Upgrade truth to v0.44 2019-05-06 16:39:17 -04:00
util Upgrade truth to v0.44 2019-05-06 16:39:17 -04:00
appengine_war.gradle Refactor Gradle project setup 2019-05-06 17:03:18 -04:00
build.gradle Add source code and JAR file to internal repository 2019-05-13 12:41:31 -04:00
dependencies.gradle Refactor Gradle project setup 2019-05-06 17:03:18 -04:00
gradle.properties Add source code and JAR file to internal repository 2019-05-13 12:41:31 -04:00
gradlew Upgrade to Gradle 5.4 2019-04-23 10:43:09 -04:00
gradlew.bat Upgrade to Gradle 5.4 2019-04-23 10:43:09 -04:00
java_common.gradle Refactor Gradle project setup 2019-05-06 17:03:18 -04:00
package-lock.json Upgrade the version of google-closure-library that we use in NPM 2019-05-06 16:31:14 -04:00
package.json Upgrade the version of google-closure-library that we use in NPM 2019-05-06 16:31:14 -04:00
README.md Add deploy notes to Gradle README 2019-01-31 14:03:45 -05:00
settings.gradle Make repo override messages more consistent 2019-04-22 12:52:55 -04:00

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.

Gradle is configured to use the directory containing this file as root, but use the existing Nomulus source tree.

All testing is done with Gradle v5.1.1.

Notable Issues

Test suites (RdeTestSuite and TmchTestSuite) are ignored to avoid duplicate execution of tests. Neither suite performs any shared test setup routine, so it is easier to exclude the suite classes than individual test classes. This is the reason why all test tasks in the :core project contain the exclude pattern '"/TestCase.", "/TestSuite."'

Many Nomulus tests are not hermetic: they modify global state (e.g., the shared local instance of Datastore) but do not clean up on completion. This becomes a problem with Gradle. In the beginning we forced Gradle to run every test class in a new process, and incurred heavy overheads. Since then, we have fixed some tests, and manged to divide all tests into three suites that do not have intra-suite conflicts. We will revisit the remaining tests soon.

Note that it is unclear if all conflicting tests have been identified. More may be exposed if test execution order changes, e.g., when new tests are added or execution parallelism level changes.

Initial Setup

Install Gradle on your local host, then run the following commands from this directory:

# One-time command to add gradle wrapper:
gradle wrapper

# Start the build:
./gradlew build

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:

gradle wrapper --gradle-version version-number

Deploy to AppEngine

Use the Gradle task 'appengineDeploy' to build and deploy to AppEngine. For now you must update the appengine.deploy.project in build.gradle to your GCP project ID.

To deploy the Gradle build, you will need the Google Cloud SDK and its app-engine-java component.