/
build.gradle.kts
74 lines (63 loc) · 1.86 KB
/
build.gradle.kts
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
plugins {
`java-library`
id("org.metaborg.gradle.config.root-project") version "0.5.6"
id("org.metaborg.gitonium") version "0.1.5"
id("org.metaborg.devenv.spoofax.gradle.langspec") version "0.1.34" apply false
}
val spoofax2Version: String = System.getProperty("spoofax2Version")
val spoofax2BaselineVersion: String = System.getProperty("spoofax2BaselineVersion")
val spoofax2DevenvVersion: String = System.getProperty("spoofax2DevenvVersion")
allprojects {
apply(plugin = "java-library")
group = "org.metaborg.devenv"
ext["spoofax2Version"] = spoofax2Version
ext["spoofax2BaselineVersion"] = spoofax2BaselineVersion
ext["spoofax2DevenvVersion"] = spoofax2DevenvVersion
java {
withSourcesJar()
withJavadocJar()
}
tasks.withType<JavaCompile>{
options.encoding = "UTF-8"
options.compilerArgs = options.compilerArgs + listOf("-Xdoclint:none")
}
tasks.withType<Javadoc>{
options{
this as CoreJavadocOptions
addStringOption("Xdoclint:none","-quiet")
encoding = "UTF-8"
quiet()
charset("UTF-8")
}
}
// Use the org.metaborg:*:2.6.0-SNAPSHOT dependencies instead of the Spoofax 3 dependencies
configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "org.metaborg.devenv") {
useTarget("org.metaborg:${requested.name}:${spoofax2Version}")
}
}
}
// Ugh, need to encode sourcesJar due to multiple gradle.config plugins
metaborg {
javaCreateSourcesJar = false
}
val sourcesJar = tasks.getByName<Jar>("sourcesJar") {
dependsOn("classes")
from(sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME).allJava)
archiveClassifier.set("sources")
}
tasks {
assemble {
dependsOn("sourcesJar")
}
}
artifacts {
add(Dependency.DEFAULT_CONFIGURATION, sourcesJar)
}
}
subprojects {
metaborg {
configureSubProject()
}
}