Skip to content

Commit

Permalink
Upgrade build infrastructure and gradle 4.2 (#32)
Browse files Browse the repository at this point in the history
* Upgrade to gradle 4.2
* Upgrade gradle plugins
    * Baseline 0.16.0
    * Nebula dependency recommender 5.0.0
    * Nebula publishing 5.1.1
    * Gradle configuration resolver 0.3.0
Inferred annotation processors 1.2.12
  • Loading branch information
schlosna authored Sep 29, 2017
1 parent 431a3f8 commit ba44bd3
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 20 deletions.
13 changes: 11 additions & 2 deletions .baseline/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<property name="message" value="Whitespace at end-of-line"/>
</module>
<module name="SuppressionFilter"> <!-- baseline-gradle: README.md -->
<property name="file" value="${samedir}/checkstyle-suppressions.xml"/>
<property name="file" value="${config_loc}/checkstyle-suppressions.xml"/>
</module>
<module name="SuppressWarningsFilter"/> <!-- baseline-gradle: README.md -->
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
Expand Down Expand Up @@ -73,7 +73,16 @@
</module>
<module name="AvoidStarImport"/> <!-- Java Style Guide: No wildcard imports -->
<module name="AvoidStaticImport"> <!-- Java Style Guide: No static imports -->
<property name="excludes" value="org.junit.Assert.*,org.junit.Assume.*,org.hamcrest.Matchers.*,org.mockito.ArgumentMatchers.*,org.mockito.Mockito.*,org.mockito.Matchers.*,org.assertj.core.api.Assertions.*,com.google.common.base.Preconditions.*,org.apache.commons.lang3.Validate.*,com.google.common.truth.Truth.*"/>
<property name="excludes" value="
java.util.Collections.*,java.util.stream.Collectors.*,
org.junit.Assert.*,org.junit.Assume.*,
org.hamcrest.CoreMatchers.*,org.hamcrest.Matchers.*,org.hamcrest.MatcherAssert.*,
org.hamcrest.core.AllOf.*,org.hamcrest.core.Is.*,org.hamcrest.core.StringContains.*,org.hamcrest.core.IsEqual.*,
org.hamcrest.collection.IsMapContaining.*,
org.mockito.ArgumentMatchers.*,org.mockito.Mockito.*,org.mockito.Matchers.*,
org.assertj.core.api.Assertions.*,
com.google.common.base.Preconditions.*,com.google.common.truth.Truth.*,
org.apache.commons.lang3.Validate.*"/>
</module>
<module name="ClassTypeParameterName"> <!-- Java Style Guide: Type variable names -->
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
Expand Down
2 changes: 1 addition & 1 deletion .baseline/eclipse/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
Expand Down
1 change: 1 addition & 0 deletions .baseline/idea/intellij-java-palantir-style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="1" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
Expand Down
15 changes: 8 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ buildscript {
}

dependencies {
classpath "com.palantir.baseline:gradle-baseline-java:${baselineVersion}"
classpath 'com.netflix.nebula:nebula-dependency-recommender:5.0.0'
classpath 'com.netflix.nebula:nebula-publishing-plugin:5.1.1'
classpath 'com.palantir.baseline:gradle-baseline-java:0.16.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.palantir:jacoco-coverage:0.4.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.7.2'
classpath 'gradle.plugin.com.palantir.configurationresolver:gradle-configuration-resolver-plugin:0.2.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:1.2.3'
classpath 'com.netflix.nebula:nebula-dependency-recommender:3.6.3'
classpath 'com.netflix.nebula:nebula-publishing-plugin:4.9.1'
classpath 'com.palantir.configurationresolver:gradle-configuration-resolver-plugin:0.3.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:1.2.12'
}
}

Expand Down Expand Up @@ -83,6 +82,8 @@ allprojects {
dependencies {
// Adds a dependency on the Baseline configuration files. Typically use
// the same version as the plugin itself.
baseline "com.palantir.baseline:gradle-baseline-java-config:${baselineVersion}@zip"
baseline group: 'com.palantir.baseline', name: 'gradle-baseline-java-config', ext: 'zip'
}

task wrapper(type: Wrapper) {
}
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
javaVersion = 1.8
baselineVersion = 0.14.0
18 changes: 14 additions & 4 deletions gradle/java.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'org.inferred.processors' // installs the "processor" configuration needed for baseline-error-prone
apply plugin: 'com.palantir.baseline-error-prone'
apply plugin: 'com.palantir.baseline-checkstyle'
apply plugin: 'com.palantir.baseline-eclipse'
apply plugin: 'com.palantir.baseline-idea'
apply plugin: 'com.palantir.configuration-resolver'
apply plugin: 'com.palantir.jacoco-coverage'

jacocoCoverage {
fileThreshold 0.5
fileThreshold 0.0, ~"Immutable_.*\\.java"
jacocoTestReport {
reports {
xml.enabled true
}
afterEvaluate {
classDirectories = project.files(classDirectories.files.collect {
// Exclusion path is project-relative and has a base of compiled classes
fileTree(dir: it, exclude: '**/Immutable*.class')
})
}
}

tasks.jacocoTestReport.dependsOn(tasks.test)
tasks.check.dependsOn(tasks.jacocoTestReport)

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed May 10 11:00:43 EDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-bin.zip
6 changes: 3 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down
1 change: 1 addition & 0 deletions versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ com.google.code.findbugs:* = 3.0.1
com.google.code.findbugs:jFormatString = 3.0.0
com.google.guava:* = 18.0
com.google.truth:* = 0.30
com.palantir.baseline:* = 0.16.0
com.palantir.remoting1:* = 1.0.0
com.palantir.safe-logging:safe-logging = 0.1.1
io.dropwizard.metrics:metrics-core = 3.1.5
Expand Down

0 comments on commit ba44bd3

Please sign in to comment.