-
Notifications
You must be signed in to change notification settings - Fork 466
/
Copy pathbuild.gradle
94 lines (87 loc) · 2.8 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
plugins {
id 'java-library'
id 'dev.equo.p2deps'
}
ext.artifactId = project.artifactIdLibExtra
version = rootProject.spotlessChangelog.versionNext
apply from: rootProject.file('gradle/java-setup.gradle')
apply from: rootProject.file('gradle/java-publish.gradle')
String VER_SOLSTICE = '1.3.1'
dependencies {
api project(':lib')
// misc useful utilities
implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
// needed by GitAttributesLineEndings
implementation "org.eclipse.jgit:org.eclipse.jgit:${VER_JGIT}"
implementation "com.googlecode.concurrent-trees:concurrent-trees:2.6.1"
// for eclipse
implementation "dev.equo.ide:solstice:${VER_SOLSTICE}"
// testing
testImplementation project(':testlib')
testImplementation "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
}
spotless {
java {
replaceRegex 'enforceSolsticeVersion', '"dev.equo.ide:solstice:(.*)"', '"dev.equo.ide:solstice:' + VER_SOLSTICE + '"'
}
}
apply from: rootProject.file('gradle/special-tests.gradle')
tasks.withType(Test).configureEach {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) {
// needed for EclipseCdtFormatterStepTest
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'
}
}
def NEEDS_P2_DEPS = [
// (alphabetic order please)
'cdt',
'groovy',
'jdt'
]
for (needsP2 in NEEDS_P2_DEPS) {
sourceSets.register(needsP2) {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
java {}
}
dependencies {
add("${needsP2}CompileOnly", "dev.equo.ide:solstice:${VER_SOLSTICE}")
}
}
jar {
for (needsP2 in NEEDS_P2_DEPS) {
from sourceSets.getByName(needsP2).output.classesDirs
}
}
tasks.withType(Test).configureEach {
dependsOn jar
doFirst {
classpath += jar.outputs.files
}
}
apply plugin: 'dev.equo.p2deps'
p2deps {
// (alphabetic order please)
into 'cdtCompileOnly', {
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'
p2repo 'https://download.eclipse.org/tools/cdt/releases/10.7/'
install 'org.eclipse.cdt.core'
}
into 'groovyCompileOnly', {
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'
p2repo 'https://groovy.jfrog.io/artifactory/plugins-release/org/codehaus/groovy/groovy-eclipse-integration/4.8.0/e4.26/'
install 'org.codehaus.groovy.eclipse.refactoring'
install 'org.codehaus.groovy.eclipse.core'
install 'org.eclipse.jdt.groovy.core'
install 'org.codehaus.groovy'
}
into 'jdtCompileOnly', {
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'
install 'org.eclipse.jdt.core'
}
}
// we'll hold the core lib to a high standard
spotbugs { reportLevel = 'low' } // low|medium|high (low = sensitive to even minor mistakes)