mirror of
https://github.com/google/nomulus.git
synced 2025-06-07 04:55:42 +02:00
Move the documentation package to its own subproject (#722)
This makes it easier to later migrate the package to Java 11. If we move and migrate in a single PR, because of the portion of the contents that s changed, git will have trouble recognizing that some files are renamed *and* modified and treat them as distinct files, making code review difficult.
This commit is contained in:
parent
a802be2a9b
commit
04f032e226
13 changed files with 47 additions and 61 deletions
|
@ -82,11 +82,6 @@ sourceSets {
|
||||||
main {
|
main {
|
||||||
java {
|
java {
|
||||||
srcDirs += generatedDir
|
srcDirs += generatedDir
|
||||||
// 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) {
|
|
||||||
exclude 'google/registry/documentation/**'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
resources {
|
resources {
|
||||||
exclude '**/*.xjb'
|
exclude '**/*.xjb'
|
||||||
|
@ -853,22 +848,6 @@ task generateGoldenImages(type: FilteringTest) {
|
||||||
}
|
}
|
||||||
generateGoldenImages.finalizedBy(findGoldenImages)
|
generateGoldenImages.finalizedBy(findGoldenImages)
|
||||||
|
|
||||||
task flowDocsTool(type: JavaExec) {
|
|
||||||
systemProperty 'test.projectRoot', rootProject.projectRootDir
|
|
||||||
systemProperty 'test.resourcesDir', resourcesDir
|
|
||||||
|
|
||||||
classpath = sourceSets.main.runtimeClasspath
|
|
||||||
main = 'google.registry.documentation.FlowDocumentationTool'
|
|
||||||
|
|
||||||
def arguments = []
|
|
||||||
if (rootProject.flowDocsFile) {
|
|
||||||
arguments << "--output_file=${rootProject.flowDocsFile}"
|
|
||||||
} else {
|
|
||||||
arguments << "--output_file=${rootProject.projectRootDir}/docs/flows.md"
|
|
||||||
}
|
|
||||||
args arguments
|
|
||||||
}
|
|
||||||
|
|
||||||
task standardTest(type: FilteringTest) {
|
task standardTest(type: FilteringTest) {
|
||||||
includeAllTests()
|
includeAllTests()
|
||||||
exclude fragileTestPatterns
|
exclude fragileTestPatterns
|
||||||
|
|
|
@ -1,38 +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.
|
|
||||||
|
|
||||||
|
|
||||||
# Generate javadoc for the project
|
|
||||||
|
|
||||||
if (( $# != 3 )); then
|
|
||||||
echo "Usage: $0 JAVADOC ZIP OUT" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
JAVADOC_BINARY="$1"
|
|
||||||
ZIP_BINARY="$2"
|
|
||||||
TARGETFILE="$3"
|
|
||||||
TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/generate_javadoc.XXXXXXXX")"
|
|
||||||
PWDDIR="$(pwd)"
|
|
||||||
|
|
||||||
"${JAVADOC_BINARY}" -d "${TMPDIR}" \
|
|
||||||
$(find java -name \*.java) \
|
|
||||||
-tag error:t:'EPP Errors' \
|
|
||||||
-subpackages google.registry \
|
|
||||||
-exclude google.registry.dns:google.registry.proxy:google.registry.monitoring.blackbox
|
|
||||||
cd "${TMPDIR}"
|
|
||||||
"${PWDDIR}/${ZIP_BINARY}" -rXoq "${PWDDIR}/${TARGETFILE}" .
|
|
||||||
cd -
|
|
||||||
rm -rf "${TMPDIR}"
|
|
44
docs/build.gradle
Normal file
44
docs/build.gradle
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
// Copyright 2020 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.
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
def deps = rootProject.dependencyMap
|
||||||
|
|
||||||
|
compile deps['com.beust:jcommander']
|
||||||
|
compile deps['com.google.code.findbugs:jsr305']
|
||||||
|
compile deps['com.google.flogger:flogger']
|
||||||
|
compile deps['com.google.guava:guava']
|
||||||
|
compile deps['com.google.re2j:re2j']
|
||||||
|
compile project(':core')
|
||||||
|
compile project(':util')
|
||||||
|
|
||||||
|
testCompile deps['com.google.truth:truth']
|
||||||
|
testCompile deps['com.thoughtworks.qdox:qdox']
|
||||||
|
testCompile deps['org.junit.jupiter:junit-jupiter-api']
|
||||||
|
testCompile deps['org.junit.jupiter:junit-jupiter-engine']
|
||||||
|
}
|
||||||
|
|
||||||
|
task flowDocsTool(type: JavaExec) {
|
||||||
|
systemProperty 'test.projectRoot', rootProject.projectRootDir
|
||||||
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
|
main = 'google.registry.documentation.FlowDocumentationTool'
|
||||||
|
|
||||||
|
def arguments = []
|
||||||
|
if (rootProject.flowDocsFile) {
|
||||||
|
arguments << "--output_file=${rootProject.flowDocsFile}"
|
||||||
|
} else {
|
||||||
|
arguments << "--output_file=${rootProject.projectRootDir}/docs/flows.md"
|
||||||
|
}
|
||||||
|
args arguments
|
||||||
|
}
|
|
@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test;
|
||||||
class FlowDocumentationTest {
|
class FlowDocumentationTest {
|
||||||
private static final Path GOLDEN_MARKDOWN_FILEPATH = getProjectRoot().resolve("docs/flows.md");
|
private static final Path GOLDEN_MARKDOWN_FILEPATH = getProjectRoot().resolve("docs/flows.md");
|
||||||
|
|
||||||
private static final String UPDATE_COMMAND = "./gradlew :core:flowDocsTool";
|
private static final String UPDATE_COMMAND = "./gradlew :docs:flowDocsTool";
|
||||||
private static final String UPDATE_INSTRUCTIONS =
|
private static final String UPDATE_INSTRUCTIONS =
|
||||||
Joiner.on('\n')
|
Joiner.on('\n')
|
||||||
.join(
|
.join(
|
|
@ -15,7 +15,7 @@
|
||||||
package google.registry.documentation;
|
package google.registry.documentation;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static org.junit.Assert.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
|
@ -30,6 +30,7 @@ rootProject.name = 'nomulus'
|
||||||
include 'common'
|
include 'common'
|
||||||
include 'core'
|
include 'core'
|
||||||
include 'db'
|
include 'db'
|
||||||
|
include 'docs'
|
||||||
include 'integration'
|
include 'integration'
|
||||||
include 'networking'
|
include 'networking'
|
||||||
include 'processor'
|
include 'processor'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue