Merge pull request #90 from google/gb/refactorGradle

Refactor to be more in line with a standard Gradle project structure
This commit is contained in:
gbrodman 2019-06-13 13:01:45 -04:00 committed by GitHub
commit 454dcb9b0e
3141 changed files with 85 additions and 90 deletions

13
.gitignore vendored
View file

@ -74,6 +74,9 @@ local.properties
# Auto-generated java files
autogenerated/
# IDEA
nomulus.iml
######################################################################
# Python Ignores
@ -83,11 +86,9 @@ autogenerated/
# Gradle Ignores
# We don't want to ignore the gradle jar files
!/gradle/gradle/wrapper/**/*.jar
!/gradle/wrapper/**/*.jar
.gradle/
/gradle/.gradle
/gradle/**/WEB-INF
/gradle/**/build
/gradle/node_modules/**
!/gradle/node_modules/soyutils_usegoog.js
**/build
node_modules/**
!node_modules/soyutils_usegoog.js
/repos/

View file

@ -55,4 +55,4 @@ env:
# output, instead of the default 10.
# See notes on the CREDZ and REPORT_GCS_BUCKET environment variable in the
# comments at the top of the file.
script: cd gradle && echo "$CREDZ" >credz.json && chmod 755 ./gradlew && travis_wait 45 ./gradlew build --continue -P uploaderDestination="$REPORT_GCS_DESTINATION" -P uploaderCredentialsFile=credz.json -P uploaderMultithreadedUpload=yes -P mavenUrl=https://storage.googleapis.com/domain-registry-maven-repository/maven -P pluginsUrl=https://storage.googleapis.com/domain-registry-maven-repository/plugins
script: echo "$CREDZ" >credz.json && chmod 755 ./gradlew && travis_wait 45 ./gradlew build --continue -P uploaderDestination="$REPORT_GCS_DESTINATION" -P uploaderCredentialsFile=credz.json -P uploaderMultithreadedUpload=yes -P mavenUrl=https://storage.googleapis.com/domain-registry-maven-repository/maven -P pluginsUrl=https://storage.googleapis.com/domain-registry-maven-repository/plugins

View file

@ -21,14 +21,14 @@ apply plugin: 'war'
// 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/${environment}/${project.name}"
"../../java/google/registry/env/${environment}/${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"
from "../../java/google/registry/env/common/${project.name}/WEB-INF"
}
}

View file

@ -65,9 +65,7 @@ if (!project.hasProperty('showAllOutput')) {
gradleLint.autoLintAfterFailure = false
// Paths to main and test sources.
ext.projectRootDir = "${rootDir}/.."
ext.javaDir = "${rootDir}/../java"
ext.javatestsDir = "${rootDir}/../javatests"
ext.projectRootDir = "${rootDir}"
// Tasks to deploy/stage all App Engine services
task deploy {
@ -161,43 +159,42 @@ subprojects {
def commonlyExcludedResources = ['**/*.java', '**/BUILD']
project.ext.javaDir = "${project.projectDir}/src/main/java"
project.ext.javaTestDir = "${project.projectDir}/src/test/java"
sourceSets {
main {
java {
srcDirs = [
rootProject.javaDir,
aptGeneratedDir
]
srcDirs += aptGeneratedDir
}
resources {
srcDirs = [
rootProject.javaDir
project.ext.javaDir
]
exclude commonlyExcludedResources
}
}
test {
java {
srcDirs = [
rootProject.javatestsDir,
aptGeneratedTestDir
]
srcDirs += aptGeneratedTestDir
}
resources {
srcDirs = [
rootProject.javatestsDir,
project.ext.javaTestDir
]
exclude commonlyExcludedResources
}
}
}
if (project.name == 'util') return
if (project.name == 'proxy') return
if (project.name == 'core') return
test {
testLogging.showStandardStreams = Boolean.parseBoolean(showAllOutput)
}
if (project.name == 'core') return
ext.relativePath = "google/registry/${project.name}"
sourceSets.each {
@ -208,13 +205,5 @@ subprojects {
include "${project.relativePath}/"
}
}
project(':core').sourceSets.each {
it.java {
exclude "${project.relativePath}/"
}
it.resources {
exclude "${project.relativePath}/"
}
}
}

View file

@ -41,6 +41,14 @@ repositories {
apply from: '../dependencies.gradle'
apply from: '../java_common.gradle'
sourceSets {
main {
java {
srcDirs += "${project.buildDir}/generated/source/apt/main"
}
}
}
checkstyle {
configDir file('../config/checkstyle')
}
@ -50,6 +58,10 @@ checkstyle {
// - Format in place: ../gradlew spotlessApply
spotless {
java {
target project.fileTree("${project.rootDir}/") {
include "src/main/java/**/*.java"
include "src/test/java/**/*.java"
}
googleJavaFormat('1.7')
}
format 'misc', {

View file

@ -8,5 +8,5 @@
<!-- Ignore generated files in Checkstyle -->
<suppress files="[/\\].*[/\\]generated.*[/\\]" checks="."/>
<!-- Ignore Javadoc checks in test files -->
<suppress files="[/\\].*[/\\]javatests.*[/\\]" checks="JavadocType"/>
<suppress files="[/\\].*[/\\]src/test/java/.*[/\\]" checks="JavadocType"/>
</suppressions>

1
core/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
out/

View file

@ -10,7 +10,7 @@ def screenshotsDir = "${project.buildDir}/screenshots"
def screenshotsForGoldensDir = "${project.buildDir}/screenshots_for_goldens"
def newGoldensDir = "${project.buildDir}/new_golden_images"
def goldensDir =
"${javatestsDir}/google/registry/webdriver/goldens/chrome-linux"
"${javaTestDir}/google/registry/webdriver/goldens/chrome-linux"
// Tests that conflict with (mostly unidentified) members of the main test
// suite. It is unclear if they are offenders (i.e., those that pollute global
@ -110,7 +110,7 @@ dependencies {
// Custom-built objectify jar at commit ecd5165, included in Nomulus
// release.
implementation files(
"${rootDir}/../third_party/objectify/v4_1/objectify-4.1.3.jar")
"${rootDir}/third_party/objectify/v4_1/objectify-4.1.3.jar")
testImplementation project(':third_party')
compile deps['com.beust:jcommander']

Some files were not shown because too many files have changed in this diff Show more