-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
142 lines (121 loc) · 4.12 KB
/
build.gradle
File metadata and controls
142 lines (121 loc) · 4.12 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
plugins {
id 'java-library'
id 'application'
id 'idea'
id 'com.gradleup.shadow' version '8.3.6'
id 'maven-publish'
}
group = 'com.sinergise.sentinel'
version = '0.9.2'
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
idea {
module {
outputDir file('build/classes/main')
testOutputDir file('build/classes/test')
}
}
test {
useJUnitPlatform()
}
ext {
jerseyVersion = '3.1.10'
lombokVersion = '1.18.36'
log4jVersion = '2.17.1'
junitVersion = '5.8.2'
}
dependencies {
implementation platform('com.google.cloud:libraries-bom:26.26.0')
implementation platform('io.grpc:grpc-bom:1.67.1')
implementation 'com.google.cloud:google-cloud-storage'
implementation "info.picocli:picocli:4.0.4"
implementation "org.locationtech.jts:jts-core:1.16.1"
api "software.amazon.awssdk:s3:2.31.36"
implementation "com.twelvemonkeys.imageio:imageio-tiff:3.12.0"
implementation "org.wololo:jts2geojson:0.14.3"
implementation "de.grundid.opendatalab:geojson-jackson:1.14"
implementation "commons-cli:commons-cli:1.4"
implementation "org.glassfish.jersey.core:jersey-client:$jerseyVersion"
implementation "org.glassfish.jersey.inject:jersey-hk2:$jerseyVersion"
implementation "org.glassfish.jersey.media:jersey-media-json-jackson:$jerseyVersion"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.0"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.0"
// lombok
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
// logging
api "org.apache.logging.log4j:log4j-api:$log4jVersion"
implementation "org.apache.logging.log4j:log4j-core:$log4jVersion"
// required with newer JDKs
implementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.2"
runtimeOnly 'org.glassfish.jaxb:jaxb-runtime:4.0.5'
// testing
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}
application {
mainClassName = "com.sinergise.sentinel.byoctool.ByocTool"
}
// creates a slim JDK runtime for distribution
task createRuntime(type: Exec) {
doFirst() {
project.delete("${buildDir}/runtime")
}
String runtimePath = "${buildDir}/runtime"
workingDir project.projectDir
commandLine = [
"${System.getenv("JLINK_HOME")}/bin/jlink",
'--add-modules', 'java.base,java.desktop,jdk.unsupported,java.management,java.scripting,java.logging,java.sql,java.naming',
'--strip-debug',
'--no-header-files',
'--no-man-pages',
"--compress=2",
'--output', runtimePath
]
}
// creates application bundle (executable + runtime)
task jpackage(type: Exec, dependsOn: shadowJar) {
dependsOn createRuntime
workingDir project.projectDir
commandLine = [
"${System.getenv("JPACKAGE_HOME")}/bin/jpackage",
'--input', "${buildDir}/libs",
'--name', project.name,
'--main-class', project.mainClassName,
'--main-jar', "byoc-tool.jar",
'--runtime-image', "${buildDir}/runtime",
'--java-options', '-Dlog4j2.disable.jmx=true'
]
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
}
}
repositories {
maven {
credentials {
username System.getenv('artifactoryUser')
password System.getenv('artifactoryPassword')
}
url "${System.getenv('artifactoryUrl')}/libs-custom-local"
}
}
}