-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
112 lines (94 loc) · 2.76 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
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
plugins {
`java-library`
`maven-publish`
`antlr`
id("com.github.ben-manes.versions") version "0.46.0"
}
val releaseRepository = "https://nexus.livinglogic.de/repository/maven-releases"
val snapshotRepository = "https://nexus.livinglogic.de/repository/maven-snapshots"
repositories {
mavenLocal()
maven{
url=uri(releaseRepository)
name="llnexus"
}
maven{
url=uri("https://nexus.livinglogic.de/repository/maven-central")
name="maven-central"
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<Javadoc> {
options.encoding = "UTF-8"
}
dependencies {
implementation("org.apache.commons:commons-lang3:3.11")
implementation("org.apache.commons:commons-text:1.10.0")
implementation("commons-collections:commons-collections:3.2.2")
antlr("org.antlr:antlr:3.5.2")
implementation("com.googlecode.json-simple:json-simple:1.1.1")
implementation("com.lambdaworks:scrypt:1.4.0")
testImplementation("junit:junit:4.13.1")
testImplementation("com.oracle.database.jdbc:ojdbc6:11.2.0.4")
}
group = "com.livinglogic"
description = "Java implementation of the UL4 templating language"
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications.create<MavenPublication>("UL4") {
from(components["java"])
}
repositories {
maven {
url = uri(if (project.version.toString().endsWith("SNAPSHOT")) snapshotRepository else releaseRepository)
name = "LLNexus"
credentials {
username = System.getProperty("llnexusUsername")
password = System.getProperty("llnexusPassword")
}
}
}
}
tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet")
}
task("execute_ul4", JavaExec::class) {
classpath = sourceSets["main"].runtimeClasspath
standardInput = System.`in`
mainClass.set("com.livinglogic.ul4.Tester")
}
task("execute_ul4on", JavaExec::class) {
classpath = sourceSets["main"].runtimeClasspath
standardInput = System.`in`
mainClass.set("com.livinglogic.ul4on.Tester")
}
task("copyDependencies", Copy::class) {
configurations.compileClasspath.get()
.filter { it.extension == "jar" }
.forEach { from(it.absolutePath).into("$buildDir/dependencies") }
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.addAll(listOf("-Xlint:deprecation"/*, "-Xlint:unchecked"*/))
}
tasks.named("sourcesJar") {
dependsOn(":generateGrammarSource")
}
tasks.register("createVersionTxt") {
doLast {
val version = findProperty("version") // returns "unspecified" if no version is set
val dir = "src/main/resources/com/livinglogic/ul4"
mkdir(dir)
file("${dir}/version.txt").writeText("${version}")
}
}
tasks.named("compileJava") {
dependsOn(":createVersionTxt")
}