Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 1 addition & 86 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ plugins {
id 'maven-publish'
}

// Path to code generated by ad hoc tasks in this project. A separate path is
// used for easy inspection.
def generatedDir = "${project.buildDir}/generated/sources/custom/java/main"
def resourcesDir = "${project.buildDir}/resources/main"
def screenshotsDir = "${project.buildDir}/screenshots"
def screenshotsForGoldensDir = "${project.buildDir}/screenshots_for_goldens"
Expand Down Expand Up @@ -56,14 +53,6 @@ def dockerIncompatibleTestPatterns = [
def fragileTestPatterns = dockerIncompatibleTestPatterns

sourceSets {
main {
java {
srcDirs += generatedDir
}
resources {
exclude '**/*.xjb'
}
}
nonprod {
java {
compileClasspath += main.output
Expand All @@ -75,9 +64,6 @@ sourceSets {
compileClasspath += nonprod.output
runtimeClasspath += nonprod.output
}
resources {
exclude '**/*.xjb', '**/*.xsd'
}
}
}

Expand All @@ -86,7 +72,6 @@ processTestResources {
}

configurations {
jaxb
devtool

nonprodImplementation.extendsFrom implementation
Expand Down Expand Up @@ -237,6 +222,7 @@ dependencies {
testImplementation project(':testing')
implementation project(':util')
implementation project(':networking')
implementation project(':xjc')
// Import NomulusPostreSql from ':db' for implementation but exclude dependencies.
implementation project(path: ':db', configuration: 'implementationApi')
nonprodRuntimeOnly project(':db')
Expand Down Expand Up @@ -285,82 +271,11 @@ dependencies {
// dependencies to avoid overriding them accidentally.
implementation deps['com.google.oauth-client:google-oauth-client-java6']

// Dependencies needed for jaxb compilation.
jaxb deps['jakarta.xml.bind:jakarta.xml.bind-api']
jaxb deps['org.glassfish.jaxb:jaxb-runtime']
jaxb deps['org.glassfish.jaxb:jaxb-xjc']

// Flyway classes needed to generate the golden file.
implementation deps['org.flywaydb:flyway-core']
implementation deps['org.flywaydb:flyway-database-postgresql']
}

task jaxbToJava {
def xsdFilesDir = "${javaDir}/google/registry/xml/xsd"
def bindingsFile = "${javaDir}/google/registry/xjc/bindings.xjb"
def pkgInfoTemplate = "${javaDir}/google/registry/xjc/package-info.java.in"
def pkgInfoMap = "${javaDir}/google/registry/xjc/package-info.map"
def outputDir = "${generatedDir}/google/registry/xjc"

inputs.dir xsdFilesDir
inputs.files bindingsFile, pkgInfoTemplate, pkgInfoMap
outputs.dir outputDir

doLast {
file(generatedDir).mkdirs()

// Temp dir to hold schema and bindings files. Files must be in the same
// directory because the bindings (.xjb) file does not declare relative
// paths to schema (.xsd) files.
def xjcTempSourceDir = file("${temporaryDir}/xjc")
xjcTempSourceDir.mkdirs()
ant.copy(
todir: "${xjcTempSourceDir}",
overwrite: true) {
fileSet(
dir: xsdFilesDir,
includes: '**.xsd')
}
ant.copy(
todir: "${xjcTempSourceDir}",
overwrite: true,
file: bindingsFile)
ant.taskdef(
name: 'xjc',
classname: 'com.sun.tools.xjc.XJCTask',
classpath: configurations.jaxb.asPath)
ant.xjc(
destdir: "${generatedDir}",
binding: "${xjcTempSourceDir}/bindings.xjb",
removeOldOutput: 'yes', extension: 'true') {
fileTree(
dir: new File("$xjcTempSourceDir"),
include: ['**/*.xsd'])
.addToAntBuilder(ant, 'schema', FileCollection.AntType.FileSet)
// -npa: do not generate package-info.java files. They will be generated
// below.
arg(line: '-npa -quiet -extension')
}
new File(pkgInfoMap).eachLine { line ->
def (packageName, namespace) = line.split()
ant.copy(
tofile: "${outputDir}/${packageName}/package-info.java",
overwrite: true,
file: "${pkgInfoTemplate}") {
filterSet() {
filter(token: 'PACKAGE', value: packageName)
filter(token: 'NAMESPACE', value: namespace)
}
}
}
execInBash(
"find . -name *.java -exec sed -i -e '/" + /\* <p>$/ + "/d' {} +",
generatedDir)
}
}

compileJava.dependsOn jaxbToJava

task findGoldenImages(type: JavaExec) {
classpath = sourceSets.test.runtimeClasspath
mainClass = 'google.registry.webdriver.GoldenImageFinder'
Expand Down
226 changes: 104 additions & 122 deletions core/gradle.lockfile

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions db/buildscript-gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
com.fasterxml.jackson.core:jackson-annotations:2.22=classpath
gradle.plugin.org.flywaydb:gradle-plugin-publishing:12.2.0=classpath
org.flywaydb.flyway:org.flywaydb.flyway.gradle.plugin:12.2.0=classpath
org.flywaydb:flyway-core:13.9.0=classpath
org.flywaydb:flyway-database-cockroachdb:13.9.0=classpath
org.flywaydb:flyway-database-postgresql:13.9.0=classpath
org.flywaydb:flyway-core:13.10.0=classpath
org.flywaydb:flyway-database-cockroachdb:13.10.0=classpath
org.flywaydb:flyway-database-postgresql:13.10.0=classpath
empty=
8 changes: 4 additions & 4 deletions db/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ org.codehaus.plexus:plexus-component-annotations:2.1.0=checkstyle
org.codehaus.plexus:plexus-container-default:2.1.0=checkstyle
org.codehaus.plexus:plexus-utils:3.3.0=checkstyle
org.conscrypt:conscrypt-openjdk-uber:2.6.0=deploy_jar,runtimeClasspath,testRuntimeClasspath
org.flywaydb:flyway-core:13.9.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.flywaydb:flyway-database-cockroachdb:13.9.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.flywaydb:flyway-database-postgresql:13.9.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.flywaydb:flyway-core:13.10.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.flywaydb:flyway-database-cockroachdb:13.10.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.flywaydb:flyway-database-postgresql:13.10.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.freemarker:freemarker:2.3.35=testRuntimeClasspath
org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath
org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt
Expand Down Expand Up @@ -185,7 +185,7 @@ org.ow2.asm:asm:9.10.1=deploy_jar,runtimeClasspath,testRuntimeClasspath
org.ow2.asm:asm:9.8=testCompileClasspath
org.ow2.asm:asm:9.9=jacocoAnt
org.pcollections:pcollections:4.0.1=annotationProcessor,testAnnotationProcessor
org.postgresql:postgresql:42.7.13=deploy_jar,runtimeClasspath,testRuntimeClasspath
org.postgresql:postgresql:42.7.14=deploy_jar,runtimeClasspath,testRuntimeClasspath
org.reflections:reflections:0.10.2=checkstyle
org.rnorth.duct-tape:duct-tape:1.0.8=compileClasspath,testCompileClasspath,testRuntimeClasspath
org.slf4j:jcl-over-slf4j:1.7.36=testRuntimeClasspath
Expand Down
2 changes: 2 additions & 0 deletions docs/code-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Within the Nomulus repository there are a few notable subprojects:
registrar console frontend
* `proxy` contains code for the EPP proxy, which relays port 700 requests to
the core EPP services
* `xjc` contains code for XML marshalling/unmarshalling and generation of the
corresponding Java classes
* `core` contains the bulk of the core Nomulus code, including request
handling+serving, backend, actions, etc

Expand Down
Loading
Loading