-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
98 lines (83 loc) · 2.59 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
plugins {
id 'java'
id 'maven-publish'
id 'application'
}
def getGitRef() {
try {
final def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (final Throwable ignored) {
return 'unknown'
}
}
final String semver = "${version_major}.${version_minor}.${version_patch}"
String build_number = System.getenv('PROMOTED_NUMBER')
if (build_number == null)
build_number = System.getenv('BUILD_NUMBER')
if (build_number == null)
build_number = getGitRef()
version = "${semver}+${build_number}"
group = 'li.cil.sedna'
java.toolchain {
languageVersion = JavaLanguageVersion.of(17)
vendor = JvmVendorSpec.ADOPTOPENJDK
}
repositories {
mavenCentral()
["fnuecke/sedna", "fnuecke/buildroot", "fnuecke/ceres"].forEach(repo -> {
maven {
url = uri("https://maven.pkg.github.com/${repo}")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GPR_USER")
password = project.findProperty("gpr.key") ?: System.getenv("GPR_KEY")
}
}
})
}
def tryProject(final projectName, final libraryName) {
findProject(projectName) ?: libraryName
}
dependencies {
implementation 'commons-io:commons-io:2.11.0'
implementation 'it.unimi.dsi:fastutil:8.5.8'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.apache.logging.log4j:log4j-api:2.17.0'
implementation 'org.apache.logging.log4j:log4j-core:2.17.0'
implementation 'org.ow2.asm:asm-commons:9.2'
implementation 'org.ow2.asm:asm:9.1'
implementation 'org.jline:jline:3.20.0'
implementation 'org.jline:jline-terminal-jna:3.20.0'
implementation 'net.java.dev.jna:jna:5.9.0'
implementation tryProject(':modules:ceres', 'li.cil.ceres:ceres:0.0.4')
implementation tryProject(':modules:sedna', 'li.cil.sedna:sedna:2.0.7')
implementation tryProject(':modules:sedna-buildroot', 'li.cil.sedna:sedna-buildroot:0.0.8')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url System.getenv('MAVEN_PATH')
}
}
}
application {
mainClassName = 'li.cil.sedna.cli.Main'
}
run {
standardInput = System.in
standardOutput = System.out
}
test {
useJUnitPlatform()
}