From 118367dc6b589f7c563669e1158156062b9efd5b Mon Sep 17 00:00:00 2001 From: jianglai Date: Mon, 19 Nov 2018 10:55:01 -0800 Subject: [PATCH] Move proxy to its separate project It can be run directly by "gradle :proxy:run" ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=222102849 --- gradle/build.gradle | 11 +++---- gradle/core/build.gradle | 24 +++++++-------- gradle/proxy/build.gradle | 65 +++++++++++++++++++++++++++++++++++++++ gradle/settings.gradle | 2 +- 4 files changed, 82 insertions(+), 20 deletions(-) create mode 100644 gradle/proxy/build.gradle diff --git a/gradle/build.gradle b/gradle/build.gradle index 4ec958b21..aa96311c6 100644 --- a/gradle/build.gradle +++ b/gradle/build.gradle @@ -1,6 +1,5 @@ plugins { id 'nebula.lint' version '10.3.1' - // Config helper for annotation processors such as AutoValue and Dagger. // Ensures that source code is generated at an appropriate location. id 'net.ltgt.apt' version '0.19' apply false @@ -79,22 +78,22 @@ subprojects { if (project.name == 'core') return - def relativePath = "google/registry/${project.name}/" + ext.relativePath = "google/registry/${project.name}" sourceSets.each { it.java { - include relativePath + include "${project.relativePath}/" } it.resources { - include relativePath + include "${project.relativePath}/" } } project(':core').sourceSets.each { it.java { - exclude relativePath + exclude "${project.relativePath}/" } it.resources { - exclude relativePath + exclude "${project.relativePath}/" } } } diff --git a/gradle/core/build.gradle b/gradle/core/build.gradle index 969ddd5dd..8f1621b44 100644 --- a/gradle/core/build.gradle +++ b/gradle/core/build.gradle @@ -78,9 +78,9 @@ dependencies { testImplementation project(':third_party') compile 'com.beust:jcommander:1.48' - compile 'com.fasterxml.jackson.core:jackson-core:2.8.5' - compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.0' - compile 'com.fasterxml.jackson.core:jackson-databind:2.8.5' + maybeRuntime 'com.fasterxml.jackson.core:jackson-core:2.8.5' + maybeRuntime 'com.fasterxml.jackson.core:jackson-annotations:2.8.0' + maybeRuntime 'com.fasterxml.jackson.core:jackson-databind:2.8.5' compile 'com.google.api-client:google-api-client:1.22.0' maybeRuntime 'com.google.api-client:google-api-client-appengine:1.22.0' maybeRuntime 'com.google.api-client:google-api-client-jackson2:1.20.0' @@ -99,7 +99,7 @@ dependencies { compile 'com.google.apis:google-api-services-groupssettings:v1-rev60-1.22.0' compile 'com.google.apis:google-api-services-monitoring:v3-rev11-1.22.0' compile 'com.google.apis:google-api-services-sheets:v4-rev483-1.22.0' - compile 'com.google.apis:google-api-services-storage:v1-rev86-1.22.0' + maybeRuntime 'com.google.apis:google-api-services-storage:v1-rev86-1.22.0' // TODO(b/71631624): change appengine:appengine-api-1.0-sdk to // testCompileOnly after BillingEmailUtilsTest.java is fixed. compile 'com.google.appengine:appengine-api-1.0-sdk:1.9.48' @@ -127,7 +127,6 @@ dependencies { runtime 'com.google.flogger:flogger-system-backend:0.1' maybeRuntime 'com.google.gdata:core:1.47.1' maybeRuntime 'com.google.googlejavaformat:google-java-format:1.4' - compile 'com.google.guava:guava-jdk5:17.0' compile 'com.google.guava:guava:25.1-jre' gradleLint.ignore('unused-dependency') { compile 'com.google.gwt:gwt-user:2.8.2' @@ -154,15 +153,15 @@ dependencies { maybeRuntime 'commons-codec:commons-codec:1.6' maybeRuntime 'commons-logging:commons-logging:1.1.1' compile 'dnsjava:dnsjava:2.1.7' - compile 'io.netty:netty-buffer:4.1.28.Final' - compile 'io.netty:netty-codec:4.1.28.Final' - compile 'io.netty:netty-codec-http:4.1.28.Final' - compile 'io.netty:netty-common:4.1.28.Final' - compile 'io.netty:netty-handler:4.1.28.Final' + maybeRuntime 'io.netty:netty-buffer:4.1.28.Final' + maybeRuntime 'io.netty:netty-codec:4.1.28.Final' + maybeRuntime 'io.netty:netty-codec-http:4.1.28.Final' + maybeRuntime 'io.netty:netty-common:4.1.28.Final' + maybeRuntime 'io.netty:netty-handler:4.1.28.Final' maybeRuntime 'io.netty:netty-resolver:4.1.28.Final' maybeRuntime 'io.netty:netty-tcnative:2.0.12.Final' maybeRuntime 'io.netty:netty-tcnative-boringssl-static:2.0.12.Final' - compile 'io.netty:netty-transport:4.1.28.Final' + maybeRuntime 'io.netty:netty-transport:4.1.28.Final' maybeRuntime 'it.unimi.dsi:fastutil:6.5.16' maybeRuntime 'javax.annotation:jsr250-api:1.0' runtime 'org.glassfish.jaxb:jaxb-runtime:2.3.0' @@ -200,7 +199,7 @@ dependencies { maybeRuntime 'org.apache.tomcat:tomcat-annotations-api:8.0.5' testCompile 'org.apache.tomcat:tomcat-annotations-api:8.0.5' compile 'org.bouncycastle:bcpg-jdk15on:1.52' - compile 'org.bouncycastle:bcpkix-jdk15on:1.52' + testCompile 'org.bouncycastle:bcpkix-jdk15on:1.52' compile 'org.bouncycastle:bcprov-jdk15on:1.52' maybeRuntime 'org.codehaus.jackson:jackson-core-asl:1.9.13' maybeRuntime 'org.codehaus.jackson:jackson-mapper-asl:1.9.13' @@ -214,7 +213,6 @@ dependencies { maybeRuntime 'org.slf4j:slf4j-api:1.7.16' maybeRuntime 'org.tukaani:xz:1.5' maybeRuntime 'org.xerial.snappy:snappy-java:1.1.4-M3' - compile 'org.yaml:snakeyaml:1.17' maybeRuntime 'org.mortbay.jetty:jetty-util:6.1.26' maybeRuntime 'org.slf4j:slf4j-api:1.7.16' maybeRuntime 'org.tukaani:xz:1.5' diff --git a/gradle/proxy/build.gradle b/gradle/proxy/build.gradle new file mode 100644 index 000000000..a1f6e51f1 --- /dev/null +++ b/gradle/proxy/build.gradle @@ -0,0 +1,65 @@ +plugins { + id 'application' +} + +sourceSets { + main { + resources { + exclude "${project.relativePath}/terraform/" + exclude "${project.relativePath}/kubernetes/" + } + } +} + +mainClassName = 'google.registry.proxy.ProxyServer' + +dependencies { + compile 'com.beust:jcommander:1.48' + compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.9' + compile 'com.fasterxml.jackson.core:jackson-core:2.9.6' + compile 'com.fasterxml.jackson.core:jackson-databind:2.8.9' + compile 'com.google.api-client:google-api-client:1.27.0' + compile 'com.google.api-client:google-api-client:1.27.0' + compile 'com.google.apis:google-api-services-cloudkms:v1-rev12-1.22.0' + compile 'com.google.apis:google-api-services-monitoring:v3-rev11-1.22.0' + compile 'com.google.apis:google-api-services-storage:v1-rev86-1.22.0' + compile 'com.google.auto.value:auto-value-annotations:1.6.2' + compile 'com.google.code.findbugs:jsr305:3.0.2' + compile 'com.google.dagger:dagger:2.15' + compile 'com.google.flogger:flogger:0.1' + compile 'com.google.guava:guava-jdk5:17.0' + compile 'com.google.guava:guava:27.0-jre' + compile 'com.google.http-client:google-http-client:1.27.0' + compile 'com.google.monitoring-client:metrics:1.0.4' + compile 'com.google.monitoring-client:stackdriver:1.0.4' + compile 'io.netty:netty-buffer:4.1.31.Final' + compile 'io.netty:netty-codec-http:4.1.31.Final' + compile 'io.netty:netty-codec:4.1.31.Final' + compile 'io.netty:netty-common:4.1.31.Final' + compile 'io.netty:netty-handler:4.1.31.Final' + compile 'io.netty:netty-transport:4.1.31.Final' + compile 'javax.inject:javax.inject:1' + compile 'joda-time:joda-time:2.3' + compile 'org.bouncycastle:bcpkix-jdk15on:1.52' + compile 'org.bouncycastle:bcprov-jdk15on:1.52' + compile project(':util') + + runtime 'com.google.flogger:flogger-system-backend:0.1' + runtime 'io.netty:netty-tcnative-boringssl-static:2.0.20.Final' + runtime 'com.google.auto.value:auto-value:1.6.2' + + testCompile 'com.google.monitoring-client:contrib:1.0.4' + testCompile 'com.google.truth:truth:0.42' + testCompile 'org.yaml:snakeyaml:1.17' + testCompile 'junit:junit:4.12' + testCompile 'org.mockito:mockito-all:1.9.5' + testCompile project(':third_party') + testCompile project(path: ':core', configuration: 'testRuntime') + + // Include auto-value in compile until nebula-lint understands + // annotationProcessor + annotationProcessor 'com.google.auto.value:auto-value:1.6.2' + testAnnotationProcessor 'com.google.auto.value:auto-value:1.6.2' + annotationProcessor 'com.google.dagger:dagger-compiler:2.15' + testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.15' +} diff --git a/gradle/settings.gradle b/gradle/settings.gradle index 3f02f24e4..a5d469cb3 100644 --- a/gradle/settings.gradle +++ b/gradle/settings.gradle @@ -1,6 +1,6 @@ rootProject.name = 'nomulus' include 'core' +include 'proxy' include 'third_party' include 'util' -