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:
Lai Jiang 2019-10-31 17:04:35 -04:00 committed by GitHub
parent 03bbb2c057
commit aaca6651c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 116 additions and 170 deletions

View file

@ -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 "]"

View file

@ -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

View file

@ -1,4 +1,3 @@
// See build.xml and make_pkginfo.sh which preprocess this into actual files.
@XmlSchema(
elementFormDefault = XmlNsForm.QUALIFIED,
namespace = "@NAMESPACE@",

View 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