-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
116 lines (98 loc) · 2.32 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
import org.apache.tools.ant.taskdefs.condition.Os
plugins {
id 'java'
id 'application'
id 'maven-publish'
id 'jacoco'
}
group = 'net.shrimpworks'
version = "1.5"
if (System.getenv().containsKey("BUILD_NUMBER")) {
version += ".${System.env.BUILD_NUMBER}"
} else version += ".DEV"
mainClassName = 'net.shrimpworks.unreal.dependencies.Main'
application {
mainModule = 'shrimpworks.unreal.dependencies'
}
compileJava {
options.release = 17
}
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://code.shrimpworks.za.net/artefacts"
}
}
publishing {
repositories {
maven {
name = "ShrimpWorks"
url = 'https://code.shrimpworks.za.net/artefacts/'
authentication {
basic(BasicAuthentication)
}
credentials(PasswordCredentials) {
username = "${System.env.ARTEFACTS_USER}"
password = "${System.env.ARTEFACTS_PASSWORD}"
}
}
}
publications {
maven(MavenPublication) {
from components.java
}
}
}
dependencies {
implementation 'net.shrimpworks:unreal-package-lib:1.12.26'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
}
jar {
manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Main-Class': mainClassName,
)
}
}
task execJar(type: Jar) {
archiveClassifier = "exec"
archiveFileName = "${archiveBaseName.get()}-${archiveClassifier.get()}.${archiveExtension.get()}"
from sourceSets.main.output
dependsOn configurations.runtimeClasspath
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Main-Class': mainClassName,
'Class-Path': configurations.runtimeClasspath.files.collect { it.getName() }.join(' ')
)
}
// build the fat executable jar file
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
// run the script which builds the executable
if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
doLast {
project.exec {
commandLine(
"$projectDir/etc/build-launcher.sh",
"$projectDir/etc/launcher.sh",
"${destinationDirectory.get()}/${archiveFileName.get()}",
"${destinationDirectory.get()}/${archiveBaseName.get()}")
}
}
}
}
test {
useJUnitPlatform()
}
jacocoTestReport {
reports {
xml.required = true
}
}