diff --git a/gradle/scripts/.gitrepo b/gradle/scripts/.gitrepo index 49b42fdeda..8da17a9cc8 100644 --- a/gradle/scripts/.gitrepo +++ b/gradle/scripts/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/line/gradle-scripts.git branch = master - commit = b4670707c10f3eb59925b7edcd65aa83f6547eeb - parent = ff5d53d6186fbafc6d8a7b68084b389ef65eca99 - cmdver = 0.4.1 + commit = 5282f3234cad321ba23074663a940286a37030f4 + parent = 85e0c4f5296916c0f802377cb8ca9d01cae1ac96 + cmdver = 0.1.0 method = merge diff --git a/gradle/scripts/lib/common-dependencies.gradle b/gradle/scripts/lib/common-dependencies.gradle index e75bcf346b..ea5fb52d01 100644 --- a/gradle/scripts/lib/common-dependencies.gradle +++ b/gradle/scripts/lib/common-dependencies.gradle @@ -22,7 +22,17 @@ rootProject.ext { } } -def managedDependencyVersions = [:] +def managedDependencyVersions = new TreeMap() { + @Override + String get(Object key) { + def value = super.get(key) + if (value != null) { + return value + } else { + throw new IllegalArgumentException("Missing managed dependency: ${key}") + } + } +} def managedDependencyExclusions = [:].withDefault { [] } def managedDependencyOverrides = [] as Set rootProject.ext.dependenciesYaml.forEach { String key, value -> @@ -216,12 +226,10 @@ rootProject.ext { def groupId = entry.key entry.value.forEach { String artifactId, Map props -> if (props.containsKey('javadocs')) { - def version = String.valueOf(managedDependencyVersions["${groupId}:${artifactId}"]) props['javadocs'].each { url -> list.add([ groupId: groupId, artifactId: artifactId, - version: version, url: url ]) } @@ -244,9 +252,12 @@ configure(rootProject) { task managedVersions( group: 'Build', description: 'Generates the file that contains dependency versions.') { + + def f = file("${project.buildDir}/managed_versions.yml") inputs.properties managedDependencyVersions + outputs.file(f) + doLast { - def f = file("${project.buildDir}/managed_versions.yml") f.parentFile.mkdir() f.withWriter('UTF-8') { new Yaml().dump(managedDependencyVersions, it) diff --git a/gradle/scripts/lib/common-git.gradle b/gradle/scripts/lib/common-git.gradle index 276e0de33f..510a1ad61c 100644 --- a/gradle/scripts/lib/common-git.gradle +++ b/gradle/scripts/lib/common-git.gradle @@ -1,4 +1,5 @@ -import static org.gradle.internal.os.OperatingSystem.* +import static org.gradle.internal.os.OperatingSystem.WINDOWS +import static org.gradle.internal.os.OperatingSystem.current rootProject.ext { // The path to the 'git' command diff --git a/gradle/scripts/lib/java-coverage.gradle b/gradle/scripts/lib/java-coverage.gradle index 691a19e2f9..0f0738f2dd 100644 --- a/gradle/scripts/lib/java-coverage.gradle +++ b/gradle/scripts/lib/java-coverage.gradle @@ -4,6 +4,10 @@ if (!jacocoEnabled) { return } +// Override JaCoCo version if needed +def jacocoVersion = managedVersions.containsKey('org.jacoco:org.jacoco.ant') ? + managedVersions['org.jacoco:org.jacoco.ant'] : JacocoPlugin.DEFAULT_JACOCO_VERSION + // Collect JaCoCo execution data for all modules. configure(projectsWithFlags('java')) { if (project.hasFlags('no_aggregation')) { @@ -14,6 +18,10 @@ configure(projectsWithFlags('java')) { project.addFlags('coverage') + jacoco { + toolVersion = jacocoVersion + } + tasks.withType(Test) { jacoco { enabled = true @@ -35,7 +43,7 @@ configure(rootProject) { } dependencies { - jacocoAnt "org.jacoco:org.jacoco.ant:${JacocoPlugin.DEFAULT_JACOCO_VERSION}" + jacocoAnt "org.jacoco:org.jacoco.ant:${jacocoVersion}" } task jacocoTestReport(type: JacocoReport) { diff --git a/gradle/scripts/lib/java-javadoc.gradle b/gradle/scripts/lib/java-javadoc.gradle index d32e179d52..6c64036763 100644 --- a/gradle/scripts/lib/java-javadoc.gradle +++ b/gradle/scripts/lib/java-javadoc.gradle @@ -299,7 +299,7 @@ allprojects { } project.ext.javadocLinks.each { - addOfflineLink("${it['groupId']}/${it['artifactId']}/${it['version']}", it['url']) + addOfflineLink("${it['groupId']}/${it['artifactId']}", it['url']) } } } diff --git a/gradle/scripts/lib/java-rpc-proto.gradle b/gradle/scripts/lib/java-rpc-proto.gradle index b95ecac819..a3d59a2428 100644 --- a/gradle/scripts/lib/java-rpc-proto.gradle +++ b/gradle/scripts/lib/java-rpc-proto.gradle @@ -40,7 +40,7 @@ configure(projectsWithFlags('java')) { } if (project.ext.hasFlag('kotlin-grpc')) { kotlinGrpc { - artifact = "io.grpc:protoc-gen-grpc-kotlin:${managedVersions['io.grpc:protoc-gen-grpc-kotlin']}" + artifact = "io.grpc:protoc-gen-grpc-kotlin:${managedVersions['io.grpc:protoc-gen-grpc-kotlin']}:jdk7@jar" } } diff --git a/gradle/scripts/lib/java-rpc-thrift.gradle b/gradle/scripts/lib/java-rpc-thrift.gradle index 92092c5157..05fe265b5a 100644 --- a/gradle/scripts/lib/java-rpc-thrift.gradle +++ b/gradle/scripts/lib/java-rpc-thrift.gradle @@ -2,9 +2,12 @@ def libDir = "${buildscript.sourceFile.parentFile}" configure(projectsWithFlags('java')) { def thriftJsonEnabled = true + def fullCamel = false + ext { thriftVersion = null thriftPath = null + enableThriftFullCamel = { fullCamel = true } disableThriftJson = { thriftJsonEnabled = false } } @@ -35,7 +38,7 @@ configure(projectsWithFlags('java')) { srcDirs = [srcDirs] } - def includeDirs = project.findProperty(sourceSet.getTaskName('', 'thriftIncludeDirs'))?: [] + def includeDirs = project.findProperty(sourceSet.getTaskName('', 'thriftIncludeDirs')) ?: [] if (!(includeDirs instanceof Iterable) || includeDirs instanceof CharSequence) { includeDirs = [includeDirs] } @@ -64,9 +67,13 @@ configure(projectsWithFlags('java')) { }.each { sourceFile -> logger.info("Using ${actualThriftPath} to generate Java sources from ${sourceFile}") project.mkdir(javaOutputDir) + def javaGenerator = 'java' + if (fullCamel) { + javaGenerator = 'java:fullcamel' + } project.exec { commandLine actualThriftPath - args '-gen', 'java', '-out', javaOutputDir + args '-gen', javaGenerator, '-out', javaOutputDir includeDirs.each { args '-I', it } diff --git a/gradle/scripts/lib/java.gradle b/gradle/scripts/lib/java.gradle index bbe2b659ba..816eabad4c 100644 --- a/gradle/scripts/lib/java.gradle +++ b/gradle/scripts/lib/java.gradle @@ -46,24 +46,11 @@ configure(projectsWithFlags('java')) { // Set the sensible compiler options. tasks.withType(JavaCompile) { - def task = delegate sourceCompatibility = project.findProperty('javaSourceCompatibility') ?: '1.8' targetCompatibility = project.findProperty('javaTargetCompatibility') ?: '1.8' options.encoding = 'UTF-8' options.warnings = false options.compilerArgs += '-parameters' - project.configurations.each { Configuration cfg -> - if (cfg.name == 'annotationProcessor' || cfg.name.endsWith('AnnotationProcessor')) { - cfg.withDependencies { deps -> - // Use incremental compilation only when there are no annotation processors, - // because it seems to cause compilation errors for some processors such as Lombok. - def useIncrementalCompilation = deps.size() == 0 - options.incremental = useIncrementalCompilation - logger.info("${useIncrementalCompilation ? 'Enabling' : 'Disabling'} " + - "incremental compilation for '${task.path}'") - } - } - } } // Enable full exception logging for test failures. @@ -93,18 +80,11 @@ configure(projectsWithFlags('java')) { def dependencyTask = project.tasks.findByName("checkstyle${sourceSet.name.capitalize()}") if (dependencyTask instanceof Checkstyle) { tasks.checkstyle.dependsOn dependencyTask - - // Run checkstyle as soon as possible after compilation to get feedback earlier. - tasks.named(sourceSet.compileJavaTaskName).configure { - finalizedBy dependencyTask - } } } - project.ext.getLintTask().dependsOn tasks.checkstyle - - test { - dependsOn tasks.lint - } + def lintTask = project.ext.getLintTask() + lintTask.dependsOn tasks.checkstyle + tasks.check.dependsOn lintTask } } diff --git a/gradle/scripts/lib/thrift/0.14/thrift.linux-x86_64 b/gradle/scripts/lib/thrift/0.14/thrift.linux-x86_64 new file mode 100755 index 0000000000..ab3c03ca89 Binary files /dev/null and b/gradle/scripts/lib/thrift/0.14/thrift.linux-x86_64 differ diff --git a/gradle/scripts/lib/thrift/0.14/thrift.osx-x86_64 b/gradle/scripts/lib/thrift/0.14/thrift.osx-x86_64 new file mode 100755 index 0000000000..bdc450c2a5 Binary files /dev/null and b/gradle/scripts/lib/thrift/0.14/thrift.osx-x86_64 differ diff --git a/gradle/scripts/lib/thrift/0.14/thrift.windows-x86_32 b/gradle/scripts/lib/thrift/0.14/thrift.windows-x86_32 new file mode 100644 index 0000000000..28d086bfd7 Binary files /dev/null and b/gradle/scripts/lib/thrift/0.14/thrift.windows-x86_32 differ diff --git a/gradle/scripts/lib/thrift/0.14/thrift.windows-x86_64 b/gradle/scripts/lib/thrift/0.14/thrift.windows-x86_64 new file mode 100644 index 0000000000..28d086bfd7 Binary files /dev/null and b/gradle/scripts/lib/thrift/0.14/thrift.windows-x86_64 differ diff --git a/gradle/scripts/settings-flags.gradle b/gradle/scripts/settings-flags.gradle index 0ec11329aa..711fdd4f9a 100644 --- a/gradle/scripts/settings-flags.gradle +++ b/gradle/scripts/settings-flags.gradle @@ -1,6 +1,7 @@ -import java.util.concurrent.ConcurrentHashMap import org.gradle.util.GradleVersion; +import java.util.concurrent.ConcurrentHashMap + import static java.util.Objects.requireNonNull // Ensure the Gradle version first of all. @@ -150,3 +151,4 @@ static void afterProjectsWithFlags(Project project, Iterable flags, Closure