mirror of
https://github.com/google/nomulus
synced 2026-01-07 14:05:44 +00:00
Make compilation work on Windows (#331)
* Make the Gradle upload plugin work on Windows * Remove the bash script to generate package-info.java file * Minor changes to the format
This commit is contained in:
@@ -76,9 +76,9 @@ sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDirs += generatedDir
|
||||
// Javadoc API is deprecated and removed in Java 12.
|
||||
// Javadoc API is deprecated in Java 11 and removed in Java 12.
|
||||
// TODO(jianglai): re-enable after migrating to the new Javadoc API
|
||||
if ((JavaVersion.current().majorVersion as Integer) > 11) {
|
||||
if ((JavaVersion.current().majorVersion as Integer) >= 11) {
|
||||
exclude 'google/registry/documentation/**'
|
||||
}
|
||||
}
|
||||
@@ -88,9 +88,9 @@ sourceSets {
|
||||
}
|
||||
test {
|
||||
java {
|
||||
// Javadoc API is deprecated and removed in Java 12.
|
||||
// Javadoc API is deprecated in Java 11 and removed in Java 12.
|
||||
// TODO(jianglai): re-enable after migrating to the new Javadoc API
|
||||
if ((JavaVersion.current().majorVersion as Integer) > 11) {
|
||||
if ((JavaVersion.current().majorVersion as Integer) >= 11) {
|
||||
exclude 'google/registry/documentation/**'
|
||||
}
|
||||
}
|
||||
@@ -290,12 +290,12 @@ dependencies {
|
||||
task jaxbToJava {
|
||||
def xsdFilesDir = "${javaDir}/google/registry/xml/xsd"
|
||||
def bindingsFile = "${javaDir}/google/registry/xjc/bindings.xjb"
|
||||
def pkgInfoGenerator = "${javaDir}/google/registry/xjc/make_pkginfo.sh"
|
||||
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, pkgInfoGenerator
|
||||
inputs.files bindingsFile, pkgInfoTemplate, pkgInfoMap
|
||||
outputs.dir outputDir
|
||||
|
||||
doLast {
|
||||
@@ -333,11 +333,17 @@ task jaxbToJava {
|
||||
// below.
|
||||
arg(line: '-npa -quiet -extension')
|
||||
}
|
||||
exec {
|
||||
workingDir "${generatedDir}"
|
||||
|
||||
executable pkgInfoGenerator
|
||||
args pkgInfoTemplate, outputDir
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -413,8 +419,10 @@ task soyToJS {
|
||||
"--allowExternalCalls", "false",
|
||||
"--srcs", "${soyFiles.join(',')}",
|
||||
"--shouldProvideRequireSoyNamespaces", "true",
|
||||
"--compileTimeGlobalsFile", "${resourcesSourceDir}/google/registry/ui/globals.txt",
|
||||
"--deps", "${deps.join(',')}"
|
||||
"--compileTimeGlobalsFile", "${resourcesSourceDir}/google/registry/ui/globals.txt"
|
||||
if (deps != "") {
|
||||
args "--deps", "${deps.join(',')}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +534,12 @@ task compileProdJS(type: JavaExec) {
|
||||
|
||||
compileJava.dependsOn jaxbToJava
|
||||
compileJava.dependsOn soyToJava
|
||||
compileJava.dependsOn compileProdJS
|
||||
// The Closure JS compiler does not support Windows. It is fine to disable it if all we want to do
|
||||
// is to complile the Java code on Windows.
|
||||
if (!System.properties['os.name'].toLowerCase().contains('windows')) {
|
||||
compileJava.dependsOn compileProdJS
|
||||
assemble.dependsOn compileProdJS
|
||||
}
|
||||
|
||||
// stylesheetsToJavascript must happen after processResources, which wipes the
|
||||
// resources folder before copying data into it.
|
||||
@@ -537,7 +550,6 @@ compileProdJS.dependsOn rootProject.npmInstall
|
||||
compileProdJS.dependsOn processResources
|
||||
compileProdJS.dependsOn processTestResources
|
||||
compileProdJS.dependsOn soyToJS
|
||||
assemble.dependsOn compileProdJS
|
||||
|
||||
task karmaTest(type: Exec) {
|
||||
dependsOn ':npmInstall'
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
tmp="$(mktemp -d "${TMPDIR:-/tmp}/list_generated_files.XXXXXXXX")"
|
||||
[[ "${tmp}" != "" ]] || exit 1
|
||||
trap "rm -rf ${tmp}" EXIT
|
||||
|
||||
base="${PWD}"
|
||||
export LC_ALL=C
|
||||
|
||||
cd "${tmp}"
|
||||
cp "${base}/java/google/registry/xjc/bindings.xjb" .
|
||||
cp "${base}"/java/google/registry/xml/xsd/*.xsd .
|
||||
"${base}/third_party/java/jaxb/jaxb-xjc" -extension -d "${tmp}" -b *.xjb *.xsd \
|
||||
| sed -ne s@google/registry/xjc/@@p \
|
||||
| grep -v package-info.java \
|
||||
| sort \
|
||||
> xjc_generated_files
|
||||
|
||||
cat <<EOF
|
||||
#
|
||||
# .'\`\`'. ...
|
||||
# :o o \`....'\` ;
|
||||
# \`. O :'
|
||||
# \`': \`.
|
||||
# \`:. \`.
|
||||
# : \`. \`.
|
||||
# \`..'\`... \`.
|
||||
# \`... \`.
|
||||
# DO NOT EDIT \`\`... \`.
|
||||
# THIS FILE \`\`\`\`\`.
|
||||
#
|
||||
# When you make changes to the XML schemas (*.xsd) or the JAXB bindings file
|
||||
# (bindings.xjb), you must regenerate this file with the following commands:
|
||||
#
|
||||
# bazel run java/google/registry/xjc:list_generated_files | tee /tmp/lol
|
||||
# mv /tmp/lol java/google/registry/xjc/generated_files.bzl
|
||||
#
|
||||
EOF
|
||||
|
||||
echo
|
||||
echo "pkginfo_generated_files = ["
|
||||
while read package; do
|
||||
printf ' "%s/package-info.java",\n' "${package}"
|
||||
done < <(awk -F/ '{print $1}' xjc_generated_files | sort -u)
|
||||
echo "]"
|
||||
|
||||
echo
|
||||
echo "xjc_generated_files = ["
|
||||
while read path; do
|
||||
printf ' "%s",\n' "${path}"
|
||||
done <xjc_generated_files
|
||||
echo "]"
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
[[ $# != 2 ]] && { echo "usage: $0 TEMPLATE OUTDIR" >&2; exit 1; }
|
||||
|
||||
template="$1"
|
||||
outdir="$2"
|
||||
|
||||
create() {
|
||||
package=$1
|
||||
namespace=$2
|
||||
sed -e "s,@PACKAGE@,${package},g" \
|
||||
-e "s,@NAMESPACE@,${namespace},g" \
|
||||
< "${template}" \
|
||||
> "${outdir}/${package}/package-info.java"
|
||||
}
|
||||
|
||||
create contact urn:ietf:params:xml:ns:contact-1.0
|
||||
create domain urn:ietf:params:xml:ns:domain-1.0
|
||||
create dsig http://www.w3.org/2000/09/xmldsig#
|
||||
create epp urn:ietf:params:xml:ns:epp-1.0
|
||||
create eppcom urn:ietf:params:xml:ns:eppcom-1.0
|
||||
create fee06 urn:ietf:params:xml:ns:fee-0.6
|
||||
create fee11 urn:ietf:params:xml:ns:fee-0.11
|
||||
create fee12 urn:ietf:params:xml:ns:fee-0.12
|
||||
create host urn:ietf:params:xml:ns:host-1.0
|
||||
create iirdea urn:ietf:params:xml:ns:iirdea-1.0
|
||||
create launch urn:ietf:params:xml:ns:launch-1.0
|
||||
create mark urn:ietf:params:xml:ns:mark-1.0
|
||||
create rde urn:ietf:params:xml:ns:rde-1.0
|
||||
create rdecontact urn:ietf:params:xml:ns:rdeContact-1.0
|
||||
create rdedomain urn:ietf:params:xml:ns:rdeDomain-1.0
|
||||
create rdeeppparams urn:ietf:params:xml:ns:rdeEppParams-1.0
|
||||
create rdeheader urn:ietf:params:xml:ns:rdeHeader-1.0
|
||||
create rdehost urn:ietf:params:xml:ns:rdeHost-1.0
|
||||
create rdeidn urn:ietf:params:xml:ns:rdeIDN-1.0
|
||||
create rdenndn urn:ietf:params:xml:ns:rdeNNDN-1.0
|
||||
create rdenotification urn:ietf:params:xml:ns:rdeNotification-1.0
|
||||
create rdepolicy urn:ietf:params:xml:ns:rdePolicy-1.0
|
||||
create rderegistrar urn:ietf:params:xml:ns:rdeRegistrar-1.0
|
||||
create rdereport urn:ietf:params:xml:ns:rdeReport-1.0
|
||||
create rgp urn:ietf:params:xml:ns:rgp-1.0
|
||||
create secdns urn:ietf:params:xml:ns:secDNS-1.1
|
||||
create smd urn:ietf:params:xml:ns:signedMark-1.0
|
||||
@@ -1,4 +1,3 @@
|
||||
// See build.xml and make_pkginfo.sh which preprocess this into actual files.
|
||||
@XmlSchema(
|
||||
elementFormDefault = XmlNsForm.QUALIFIED,
|
||||
namespace = "@NAMESPACE@",
|
||||
|
||||
27
core/src/main/java/google/registry/xjc/package-info.map
Normal file
27
core/src/main/java/google/registry/xjc/package-info.map
Normal file
@@ -0,0 +1,27 @@
|
||||
contact urn:ietf:params:xml:ns:contact-1.0
|
||||
domain urn:ietf:params:xml:ns:domain-1.0
|
||||
dsig http://www.w3.org/2000/09/xmldsig#
|
||||
epp urn:ietf:params:xml:ns:epp-1.0
|
||||
eppcom urn:ietf:params:xml:ns:eppcom-1.0
|
||||
fee06 urn:ietf:params:xml:ns:fee-0.6
|
||||
fee11 urn:ietf:params:xml:ns:fee-0.11
|
||||
fee12 urn:ietf:params:xml:ns:fee-0.12
|
||||
host urn:ietf:params:xml:ns:host-1.0
|
||||
iirdea urn:ietf:params:xml:ns:iirdea-1.0
|
||||
launch urn:ietf:params:xml:ns:launch-1.0
|
||||
mark urn:ietf:params:xml:ns:mark-1.0
|
||||
rde urn:ietf:params:xml:ns:rde-1.0
|
||||
rdecontact urn:ietf:params:xml:ns:rdeContact-1.0
|
||||
rdedomain urn:ietf:params:xml:ns:rdeDomain-1.0
|
||||
rdeeppparams urn:ietf:params:xml:ns:rdeEppParams-1.0
|
||||
rdeheader urn:ietf:params:xml:ns:rdeHeader-1.0
|
||||
rdehost urn:ietf:params:xml:ns:rdeHost-1.0
|
||||
rdeidn urn:ietf:params:xml:ns:rdeIDN-1.0
|
||||
rdenndn urn:ietf:params:xml:ns:rdeNNDN-1.0
|
||||
rdenotification urn:ietf:params:xml:ns:rdeNotification-1.0
|
||||
rdepolicy urn:ietf:params:xml:ns:rdePolicy-1.0
|
||||
rderegistrar urn:ietf:params:xml:ns:rdeRegistrar-1.0
|
||||
rdereport urn:ietf:params:xml:ns:rdeReport-1.0
|
||||
rgp urn:ietf:params:xml:ns:rgp-1.0
|
||||
secdns urn:ietf:params:xml:ns:secDNS-1.1
|
||||
smd urn:ietf:params:xml:ns:signedMark-1.0
|
||||
Reference in New Issue
Block a user