Merge pull request #280 from DataDog/tyler/errorprone

Add the errorprone compiler.
This commit is contained in:
Tyler Benson 2018-04-06 11:09:57 +08:00 committed by GitHub
commit 0c10a19e06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 9 deletions

View File

@ -59,7 +59,7 @@ jobs:
- run: - run:
name: Build Project name: Build Project
command: GRADLE_OPTS="-Dorg.gradle.jvmargs=-Xmx2G -Xms512M" ./gradlew clean check -x test --stacktrace --no-daemon command: GRADLE_OPTS="-Dorg.gradle.jvmargs=-Xmx2G -Xms512M" ./gradlew clean check -x test --parallel --stacktrace --no-daemon --max-workers=6
- save_cache: - save_cache:
key: dd-trace-java-{{ checksum "dd-trace-java.gradle" }}-{{ .Branch }}-{{ .Revision }} key: dd-trace-java-{{ checksum "dd-trace-java.gradle" }}-{{ .Branch }}-{{ .Revision }}
@ -106,7 +106,7 @@ jobs:
- run: - run:
name: Run Trace Agent Tests name: Run Trace Agent Tests
command: ./gradlew traceAgentTest --parallel --stacktrace --no-daemon command: ./gradlew traceAgentTest --parallel --stacktrace --no-daemon --max-workers=6
- run: - run:
name: Save Artifacts to (project-root)/build name: Save Artifacts to (project-root)/build
@ -129,7 +129,7 @@ jobs:
- run: - run:
name: Verify Version Scan name: Verify Version Scan
command: ./gradlew verifyVersionScan --parallel --stacktrace --no-daemon command: ./gradlew verifyVersionScan --parallel --stacktrace --no-daemon --max-workers=6
- run: - run:
name: Save Artifacts to (project-root)/build name: Save Artifacts to (project-root)/build

View File

@ -26,9 +26,9 @@ public class TracerInstaller {
public static void logVersionInfo() { public static void logVersionInfo() {
// version classes log important info // version classes log important info
// in static initializers // in static initializers
DDTraceOTInfo.VERSION.toString(); final String s = DDTraceOTInfo.VERSION.toString();
DDTraceApiInfo.VERSION.toString(); final String s1 = DDTraceApiInfo.VERSION.toString();
DDJavaAgentInfo.VERSION.toString(); final String s2 = DDJavaAgentInfo.VERSION.toString();
log.debug(GlobalTracer.class.getName() + " loaded on " + GlobalTracer.class.getClassLoader()); log.debug(GlobalTracer.class.getName() + " loaded on " + GlobalTracer.class.getClassLoader());
log.debug( log.debug(
AgentInstaller.class.getName() + " loaded on " + AgentInstaller.class.getClassLoader()); AgentInstaller.class.getName() + " loaded on " + AgentInstaller.class.getClassLoader());

View File

@ -11,7 +11,7 @@ public class DDTraceApiInfo {
static { static {
String v; String v;
try { try {
final StringBuffer sb = new StringBuffer(); final StringBuilder sb = new StringBuilder();
final BufferedReader br = final BufferedReader br =
new BufferedReader( new BufferedReader(

View File

@ -5,11 +5,13 @@ buildscript {
dependencies { dependencies {
classpath "io.franzbecker:gradle-lombok:1.8" classpath "io.franzbecker:gradle-lombok:1.8"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.18" classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.18"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
classpath "net.ltgt.gradle:gradle-errorprone-plugin:0.0.13"
} }
} }
plugins { plugins {
id 'com.gradle.build-scan' version '1.13'
id 'com.github.sherter.google-java-format' version '0.6' id 'com.github.sherter.google-java-format' version '0.6'
} }
@ -32,6 +34,17 @@ task traceAgentTest {}
// Applied here to allow publishing of artifactory build info // Applied here to allow publishing of artifactory build info
apply from: "${rootDir}/gradle/publish.gradle" apply from: "${rootDir}/gradle/publish.gradle"
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
def isCI = System.getenv("CI") != null
if (isCI) {
publishAlways()
tag 'CI'
}
}
ext.gradleWrapperVersion = '4.6' ext.gradleWrapperVersion = '4.6'
task wrapper(type: Wrapper) { task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion gradleVersion = gradleWrapperVersion

View File

@ -15,7 +15,7 @@ public class DDTraceOTInfo {
static { static {
String v; String v;
try { try {
final StringBuffer sb = new StringBuffer(); final StringBuilder sb = new StringBuilder();
final BufferedReader br = final BufferedReader br =
new BufferedReader( new BufferedReader(

View File

@ -11,6 +11,14 @@ lombok { // optional: values below are the defaults
sha256 = "c5178b18caaa1a15e17b99ba5e4023d2de2ebc18b58cde0f5a04ca4b31c10e6d" sha256 = "c5178b18caaa1a15e17b99ba5e4023d2de2ebc18b58cde0f5a04ca4b31c10e6d"
} }
if (JavaVersion.current().isJava8Compatible()) {
apply plugin: "net.ltgt.errorprone"
tasks.withType(JavaCompile) {
// workaround for: https://github.com/google/error-prone/issues/780
options.compilerArgs += ['-Xep:ParameterName:OFF']
}
}
apply plugin: "eclipse" apply plugin: "eclipse"
eclipse { eclipse {
classpath { classpath {