google-nomulus/gradle
weiminyu 1c837dcad1 Declare inputs and outputs in code-generation tasks
This makes such tasks work with Gradle's incremental build.

In practice this change is not very useful:
- The Dagger annotation processor version we use is not fully
  compatible with Gradle incremental build, and currently causes
  unnecessary rebuild in the util package, and forces tests to always run.
  Will try the latest version later, which claims to support incremental
  build.
- AppEngine deploy task leaves behind non-writable tools.jar files.
  Reruns of any builds that include :services:*:explodeWar would fail,
  and the easiest work-around right now is to run Gradle clean task.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232929552
2019-02-08 11:18:59 -05:00
..
config/checkstyle Add Checkstyle and Error Prone to the Gradle build 2019-01-31 13:49:33 -05:00
core Declare inputs and outputs in code-generation tasks 2019-02-08 11:18:59 -05:00
gradle/wrapper Update Gradle to 5.1.1 2019-01-14 16:32:49 -05:00
proxy Unify dependency declarations into one place 2019-01-10 16:23:35 -05:00
services Consolidate app engine deployment gradle tasks 2018-12-06 13:34:16 -05:00
third_party Reorganize Gradle dependencies 2018-10-25 14:50:26 -04:00
util Unify dependency declarations into one place 2019-01-10 16:23:35 -05:00
z/pulldeps/google3/third_party/java_src/gtld/gradle Check in initial dependency lockfiles. 2019-02-06 18:00:02 -05:00
build.gradle Update dependency-related Gradle tasks 2019-02-06 18:04:47 -05:00
dependencies.gradle Fix Gradle lint's dependency warnings 2019-01-17 19:17:32 -05:00
gradlew Check gradle wrapper in to VCS 2018-12-03 19:26:38 -05:00
gradlew.bat Check gradle wrapper in to VCS 2018-12-03 19:26:38 -05:00
README.md Add deploy notes to Gradle README 2019-01-31 14:03:45 -05:00
settings.gradle Consolidate app engine deployment gradle tasks 2018-12-06 13:34:16 -05: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.