Skip to content
Merged
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
23 changes: 23 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ plugins {
id "com.jfrog.artifactory" version "${artifactoryPluginVersion}" apply false
id "com.github.node-gradle.node" version "${gradleNodePluginVersion}" apply false
id "org.owasp.dependencycheck" version "${owaspDependencyCheckPluginVersion}" apply false
id "net.ltgt.errorprone" version "${errorPronePluginVersion}" apply false
id "io.github.ben-manes.versions" version "0.61.0"
id "org.labkey.build.multiGit"
}
Expand Down Expand Up @@ -66,6 +67,28 @@ allprojects {
compile.options.encoding = 'UTF-8'
compile.options.compilerArgs << '-parameters' // Preserve method parameter names for Spring AI reflection
}
// -PerrorProne enforces @CompileTimeConstant at call sites
if (project.hasProperty('errorProne'))
{
project.pluginManager.withPlugin('java') {
project.apply plugin: 'net.ltgt.errorprone'
project.dependencies {
errorprone "com.google.errorprone:error_prone_core:${googleErrorProneAnnotationsVersion}"
errorprone "com.uber.nullaway:nullaway:${nullAwayVersion}"
}
project.tasks.withType(JavaCompile).configureEach {
options.errorprone {
disableAllChecks = true
disableWarningsInGeneratedCode = true
error("CompileTimeConstant")
warn("DereferenceWithNullBranch", "EqualsIncompatibleType", "LockNotBeforeTry", "MustBeClosedChecker",
"NonAtomicVolatileUpdate", "NullAway", "StreamResourceLeak", "WaitNotInLoop")
option("NullAway:OnlyNullMarked", "true")
option("NullAway:AcknowledgeRestrictiveAnnotations", "true")
}
}
}
}
}

// We need the tomcat home directory to run UI tests from within IntelliJ.
Expand Down
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ useLocalBuild
# Uncomment the following line when using SSL for your embedded tomcat server
#useSsl

# Uncomment to compile with Error Prone, see build.gradle for configured error/warning checks
#errorProne=1

# the URL for the artifact repository where our build plugins are housed
# as well as the build artifacts. (Be careful not to include a trailing slash
# in the context URL or you will get a 500 error from artifactory.)
Expand Down Expand Up @@ -64,6 +67,8 @@ artifactoryPluginVersion=6.0.4
gradleNodePluginVersion=7.1.0
gradlePluginsVersion=11.2.0
owaspDependencyCheckPluginVersion=13.0.0
errorPronePluginVersion=5.2.0
nullAwayVersion=0.14.3

# Versions of node and npm to use during the build. If set, these versions
# will be downloaded and used. If not set, the existing local installations will be used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ public Map.Entry<File,File> updateModule(File explodedModuleDirectory, File upda
List<Callable<Boolean>> undoList = new ArrayList<>();

// OK we got this far, let's give it a go
moduleLoading.lock();
try
{
moduleLoading.lock();
Files.move(existingArchive.toPath(), mvExistingArchive.toPath());
undoList.add(() -> {
Files.copy(mvExistingArchive.toPath(), existingArchive.toPath());
Expand Down Expand Up @@ -297,9 +297,9 @@ public Map.Entry<File, File> newModule(File newArchive, File target) throws IOEx

List<Callable<Boolean>> undoList = new ArrayList<>();

moduleLoading.lock();
try
{
moduleLoading.lock();
Files.move(newArchive.toPath(), target.toPath());
undoList.add(() -> {
Files.deleteIfExists(target.toPath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public static void main(String... rawArgs)

synchronized(runner)
{
runner.wait();
while (true)
runner.wait();
}
}
catch (Throwable t)
Expand Down
Loading