diff --git a/gradle/backend/build.gradle b/gradle/backend/build.gradle deleted file mode 100644 index 56428a267..000000000 --- a/gradle/backend/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -plugins { - id 'war' -} - -// Set this directory before applying the appengine plugin so that the plugin -// will recognize this as an app-engine standard app (and also obtains the -// appengine-web.xml from the correct location) -project.convention.plugins['war'].webAppDirName = - '../../java/google/registry/env/crash/backend' - -apply plugin: 'com.google.cloud.tools.appengine' - -// Get the web.xml file for the service. -war { - webInf { - from '../../java/google/registry/env/common/backend/WEB-INF' - } -} - -appengine { - deploy { - project = 'domain-registry-crash' - } -} - -dependencies { - compile project(':core') -} diff --git a/gradle/build.gradle b/gradle/build.gradle index 206af2dcf..4adb4af10 100644 --- a/gradle/build.gradle +++ b/gradle/build.gradle @@ -24,14 +24,63 @@ gradleLint.autoLintAfterFailure = false ext.javaDir = "${rootDir}/../java" ext.javatestsDir = "${rootDir}/../javatests" +// Tasks to deploy/stage all App Engine services +task deploy { + group = 'deployment' + description = 'Deploys all services to App Engine.' +} + +task stage { + group = 'deployment' + description = 'Generates application directories for all services.' +} + subprojects { + // Skip no-op project + if (project.name == 'services') return + repositories { jcenter() mavenCentral() } - // Exclude all of the module deployment projects. - if (project.name in ['default', 'backend', 'tools', 'pubapi']) return + // Set up all of the deployment projects. + if (project.name in ['default', 'backend', 'tools', 'pubapi']) { + + apply plugin: 'war' + + // Set this directory before applying the appengine plugin so that the + // plugin will recognize this as an app-engine standard app (and also + // obtains the appengine-web.xml from the correct location) + project.convention.plugins['war'].webAppDirName = + "../../../java/google/registry/env/crash/${project.name}" + + apply plugin: 'com.google.cloud.tools.appengine' + + // Get the web.xml file for the service. + war { + webInf { + from "../../../java/google/registry/env/common/${project.name}/WEB-INF" + } + } + + appengine { + deploy { + // TODO: change this to a variable. + project = 'domain-registry-crash' + } + } + + dependencies { + compile project(':core') + } + + rootProject.deploy.dependsOn appengineDeploy + rootProject.stage.dependsOn appengineStage + + // Return early, do not apply the settings below. + return + } apply plugin: 'java' apply plugin: 'nebula.lint' diff --git a/gradle/default/build.gradle b/gradle/default/build.gradle deleted file mode 100644 index 02db5a69a..000000000 --- a/gradle/default/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id 'war' -} - -// Set this directory before applying the appengine plugin so that the plugin -// will recognize this as an app-engine standard app (and also obtains the -// appengine-web.xml from the correct location) -project.convention.plugins['war'].webAppDirName = - '../../java/google/registry/env/crash/default' - -apply plugin: 'com.google.cloud.tools.appengine' - -// Get the web.xml and cron.xml files for the service. -war { - webInf { - from '../../java/google/registry/env/common/default/WEB-INF' - from '../../java/google/registry/env/crash/tools/WEB-INF/cron.xml' - } -} - -appengine { - deploy { - project = 'domain-registry-crash' - } -} - -dependencies { - compile project(':core') -} diff --git a/gradle/pubapi/build.gradle b/gradle/pubapi/build.gradle deleted file mode 100644 index 27fbb9b97..000000000 --- a/gradle/pubapi/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id 'war' -} - -// Set this directory before applying the appengine plugin so that the plugin -// will recognize this as an app-engine standard app (and also obtains the -// appengine-web.xml from the correct location) -project.convention.plugins['war'].webAppDirName = - '../../java/google/registry/env/crash/pubapi' - -apply plugin: 'com.google.cloud.tools.appengine' - -// Get the web.xml file for the service. -war { - webInf { - from '../../java/google/registry/env/common/pubapi/WEB-INF' - from '../../java/google/registry/env/crash/pubapi/WEB-INF/cron.xml' - } -} - -appengine { - deploy { - project = 'domain-registry-crash' - } -} - -dependencies { - compile project(':core') -} diff --git a/gradle/services/backend/README.txt b/gradle/services/backend/README.txt new file mode 100644 index 000000000..956793fc4 --- /dev/null +++ b/gradle/services/backend/README.txt @@ -0,0 +1,2 @@ +This directory is intentionally empty. This subproject is configred through root +project build script. diff --git a/gradle/services/default/README.txt b/gradle/services/default/README.txt new file mode 100644 index 000000000..956793fc4 --- /dev/null +++ b/gradle/services/default/README.txt @@ -0,0 +1,2 @@ +This directory is intentionally empty. This subproject is configred through root +project build script. diff --git a/gradle/services/pubapi/README.txt b/gradle/services/pubapi/README.txt new file mode 100644 index 000000000..956793fc4 --- /dev/null +++ b/gradle/services/pubapi/README.txt @@ -0,0 +1,2 @@ +This directory is intentionally empty. This subproject is configred through root +project build script. diff --git a/gradle/services/tools/README.txt b/gradle/services/tools/README.txt new file mode 100644 index 000000000..956793fc4 --- /dev/null +++ b/gradle/services/tools/README.txt @@ -0,0 +1,2 @@ +This directory is intentionally empty. This subproject is configred through root +project build script. diff --git a/gradle/settings.gradle b/gradle/settings.gradle index 1806b5156..30879379f 100644 --- a/gradle/settings.gradle +++ b/gradle/settings.gradle @@ -4,7 +4,7 @@ include 'core' include 'proxy' include 'third_party' include 'util' -include 'default' -include 'backend' -include 'tools' -include 'pubapi' +include 'services:default' +include 'services:backend' +include 'services:tools' +include 'services:pubapi' diff --git a/gradle/tools/build.gradle b/gradle/tools/build.gradle deleted file mode 100644 index ddf0e2beb..000000000 --- a/gradle/tools/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -plugins { - id 'war' -} - -// Set this directory before applying the appengine plugin so that the plugin -// will recognize this as an app-engine standard app (and also obtains the -// appengine-web.xml from the correct location) -project.convention.plugins['war'].webAppDirName = - '../../java/google/registry/env/crash/tools' - -apply plugin: 'com.google.cloud.tools.appengine' - -// Get the web.xml file for the service. -war { - webInf { - from '../../java/google/registry/env/common/tools/WEB-INF' - } -} - -appengine { - deploy { - project = 'domain-registry-crash' - } -} - -dependencies { - compile project(':core') -}