-
Notifications
You must be signed in to change notification settings - Fork 134
/
build.gradle
155 lines (139 loc) · 6.45 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
apply plugin: 'groovy'
apply plugin: 'java-library'
apply plugin: 'com.palantir.external-publish-jar'
apply plugin: 'com.palantir.external-publish-gradle-plugin'
import org.gradle.api.internal.classpath.ModuleRegistry
import org.gradle.api.internal.project.ProjectInternal
dependencies {
implementation project(':gradle-junit-reports')
implementation gradleApi()
implementation 'org.apache.commons:commons-lang3'
implementation 'com.diffplug.spotless:spotless-plugin-gradle'
implementation 'com.github.ben-manes.caffeine:caffeine'
implementation 'com.google.guava:guava'
implementation 'net.ltgt.gradle:gradle-errorprone-plugin'
implementation 'org.apache.maven.shared:maven-dependency-analyzer', {
// Use maven-core rather than the legacy maven-project component
exclude group: 'org.apache.maven', module: 'maven-project'
}
runtimeOnly 'org.apache.maven:maven-core'
implementation 'commons-lang:commons-lang'
implementation 'com.palantir.javaformat:palantir-java-format-spi'
// Add an explicit dependency to ensure consumers can use JDK14 source compat
implementation 'org.ow2.asm:asm'
implementation 'com.googlecode.java-diff-utils:diffutils'
implementation 'com.palantir.gradle.utils:lazily-configured-mapping'
runtimeOnly 'com.palantir.javaformat:gradle-palantir-java-format'
testImplementation gradleTestKit()
testImplementation 'com.github.stefanbirkner:system-rules'
testImplementation 'com.netflix.nebula:nebula-test' // for better temp directory junit rule only
testImplementation 'junit:junit'
testImplementation 'net.lingala.zip4j:zip4j'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine', {
because 'allows JUnit 3 and JUnit 4 tests to run'
}
// necessary because of https://github.com/gradle/gradle/issues/16774
def toolingApiBuildersJar = (project as ProjectInternal).services.get(ModuleRegistry.class)
.getModule("gradle-tooling-api-builders")
.classpath
.asFiles
.first()
testRuntimeOnly(files(toolingApiBuildersJar))
annotationProcessor 'org.inferred:freebuilder'
compileOnly 'org.inferred:freebuilder'
annotationProcessor 'org.immutables:value'
compileOnly 'org.immutables:value::annotations'
}
tasks.test.dependsOn tasks.findByPath(':gradle-baseline-java-config:publishToMavenLocal')
tasks.test.dependsOn tasks.findByPath(':baseline-error-prone:publishToMavenLocal')
tasks.test.dependsOn tasks.findByPath(':baseline-refaster-javac-plugin:publishToMavenLocal')
tasks.test.dependsOn tasks.findByPath(':baseline-refaster-rules:publishToMavenLocal')
tasks.test.dependsOn tasks.publishToMavenLocal
test {
environment 'CIRCLE_ARTIFACTS', "${buildDir}/artifacts"
environment 'CIRCLE_TEST_REPORTS', "${buildDir}/circle-reports"
}
gradlePlugin {
plugins {
baselinePlugins {
id = 'com.palantir.baseline'
displayName = 'Palantir Baseline Plugins'
implementationClass = 'com.palantir.baseline.plugins.Baseline'
}
baselineCheckstylePlugin {
id = 'com.palantir.baseline-checkstyle'
displayName = 'Palantir Baseline Checkstyle Plugin'
implementationClass = 'com.palantir.baseline.plugins.BaselineCheckstyle'
}
baselineConfigPlugin {
id = 'com.palantir.baseline-config'
displayName = 'Palantir Baseline Configuration Plugin'
implementationClass = 'com.palantir.baseline.plugins.BaselineConfig'
}
baselineExactDependenciesPlugin {
id = 'com.palantir.baseline-exact-dependencies'
displayName = 'Palantir Baseline Exact Dependencies Plugin'
implementationClass = 'com.palantir.baseline.plugins.BaselineExactDependencies'
}
baselineEclipsePlugin {
id = 'com.palantir.baseline-eclipse'
displayName = 'Palantir Baseline Eclipse Plugin'
implementationClass = 'com.palantir.baseline.plugins.BaselineEclipse'
}
baselineIdeaPlugin {
id = 'com.palantir.baseline-idea'
displayName = 'Palantir Baseline IntelliJ Plugin'
implementationClass = 'com.palantir.baseline.plugins.BaselineIdea'
}
baselineClassUniquenessPlugin {
id = 'com.palantir.baseline-class-uniqueness'
displayName = 'Palantir Baseline Class Uniqueness Plugin'
implementationClass = 'com.palantir.baseline.plugins.BaselineClassUniquenessPlugin'
}
baselineCircleCiPlugin {
id = 'com.palantir.baseline-circleci'
displayName = 'Palantir Baseline CircleCi Plugin'
implementationClass = 'com.palantir.baseline.plugins.BaselineCircleCi'
}
baselineReleaseCompatibility {
id = 'com.palantir.baseline-release-compatibility'
displayName = 'Palantir Baseline Release Compatibility Plugin'
implementationClass = 'com.palantir.baseline.plugins.BaselineReleaseCompatibility'
}
baselinePreferProjectModules {
id = 'com.palantir.baseline-prefer-project-modules'
displayName = 'Palantir Baseline Prefer Project Modules Plugin'
implementationClass = 'com.palantir.baseline.plugins.BaselinePreferProjectModules'
}
}
}
pluginBundle {
website = 'https://github.com/palantir/gradle-baseline'
vcsUrl = 'https://github.com/palantir/gradle-baseline'
description = 'Baseline Java is a collection of Gradle plugins for configuring code quality tools in builds and generated Eclipse/IntelliJ projects.'
tags = ['java', 'checkstyle', 'code quality', 'eclipse', 'idea']
}
tasks.named('processResources').configure {
duplicatesStrategy 'include'
}
// Run `./gradlew test -Drecreate=true` to recreate all the expected
// generated code that we have checked into the repo.
tasks.withType(Test) {
systemProperty 'recreate', System.getProperty('recreate', 'false')
}
configurations {
checkstyleVersion
}
dependencies {
checkstyleVersion 'com.puppycrawl.tools:checkstyle'
}
task writeCheckstyleVersion() {
doLast {
file('src/main/resources/checkstyle.version').text = getVersion('com.puppycrawl.tools', 'checkstyle', configurations.checkstyleVersion)
}
}
if (gradle.startParameter.isWriteDependencyLocks()) {
gradle.startParameter.taskNames += 'writeCheckstyleVersion'
}