diff --git a/build.gradle b/build.gradle index fee8ea3ebc..187eb72efb 100644 --- a/build.gradle +++ b/build.gradle @@ -162,9 +162,9 @@ allprojects { suppressionFile = '.ci/dependency-checker/suppressedLibraries.xml' cveValidForHours = 1 format = 'ALL' - failOnError = project.getProperty('owasp.failOnError') + failOnError = project.property('owasp.failOnError') // by default CVSS is '11' which passes everything. Set between 0-10 to catch vulnerable deps - failBuildOnCVSS = project.getProperty('owasp.failBuildOnCVSS').toFloat() + failBuildOnCVSS = project.property('owasp.failBuildOnCVSS').toFloat() analyzers { assemblyEnabled = false @@ -180,7 +180,7 @@ allprojects { options.encoding = 'UTF-8' } - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) { kotlinOptions { languageVersion = "1.2" apiVersion = "1.2" @@ -208,8 +208,12 @@ allprojects { // Prevent the project from creating temporary files outside of the build directory. systemProperty 'java.io.tmpdir', buildDir.absolutePath + if (project.hasProperty('test.parallel') && project.property('test.parallel').toBoolean()) { + maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) as int ?: 1 + } + if (System.getProperty("test.maxParallelForks") != null) { - maxParallelForks = Integer.valueOf(System.getProperty("test.maxParallelForks")) + maxParallelForks = Integer.getInteger('test.maxParallelForks') logger.debug("System property test.maxParallelForks found - setting max parallel forks to $maxParallelForks for $project") } @@ -273,14 +277,6 @@ allprojects { } } -subprojects { - tasks.withType(Test) { - if (project.getProperty('test.parallel').toBoolean()) { - maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1 - } - } -} - // Check that we are running on a Java 8 JDK. The source/targetCompatibility values above aren't sufficient to // guarantee this because those are properties checked by the Java plugin, but we're using Kotlin. // diff --git a/gradle.properties b/gradle.properties index c9fc19fd4f..eec02efd03 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,7 @@ kotlin.incremental=true org.gradle.jvmargs=-XX:+UseG1GC -Xmx1g -Dfile.encoding=UTF-8 -org.gradle.caching=true +org.gradle.caching=false owasp.failOnError=false owasp.failBuildOnCVSS=11.0 -test.parallel=false \ No newline at end of file +compilation.allWarningsAsErrors=false +test.parallel=false