-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
128 lines (104 loc) · 3.49 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
117
118
119
120
121
122
123
124
125
126
127
128
/*
* Copyright 2021 Schibsted. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
*/
plugins {
id('java')
id('application')
id 'org.beryx.runtime' version '1.12.7'
}
repositories {
mavenCentral()
}
mainClassName = 'com.schibsted.security.artishock.ArtishockCli'
def version = '0.0.1'
dependencies {
implementation('org.apache.logging.log4j:log4j-core:2.19.0')
implementation('org.slf4j:slf4j-simple:1.7.30')
implementation('com.google.guava:guava:30.0-jre')
implementation('com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.2')
implementation('com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.12.2')
implementation("com.squareup.okhttp3:okhttp:4.9.0")
implementation("io.airlift:airline:0.8")
implementation("org.jfrog.artifactory.client:artifactory-java-client-services:2.13.0")
implementation("org.codehaus.groovy:groovy:3.0.6") // Force upgrade in artifactory client
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.register('uberJar', Jar) {
archiveClassifier = 'uber'
duplicatesStrategy = 'exclude'
from sourceSets.main.output
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
manifest {
attributes 'Main-Class': 'com.schibsted.security.artishock.ArtishockCli'
attributes 'Multi-Release': 'true'
}
}
runtime {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
imageZip = file("$buildDir/artishock.zip")
additive = true
modules = ["jdk.crypto.ec"]
jpackage {
skipInstaller = true
imageName = "artishock"
}
targetPlatform("linux") {
jdkHome = jdkDownload("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.4.1%2B1/OpenJDK17U-jdk_x64_linux_hotspot_17.0.4.1_1.tar.gz", {
archiveExtension="tar.gz"
})
}
targetPlatform("win") {
jdkHome = jdkDownload("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.4.1%2B1/OpenJDK17U-jdk_x64_windows_hotspot_17.0.4.1_1.zip", {
archiveExtension="zip"
})
}
targetPlatform("mac") {
jdkHome = jdkDownload("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.4.1%2B1/OpenJDK17U-jdk_x64_mac_hotspot_17.0.4.1_1.tar.gz", {
archiveExtension="tar.gz"
})
}
}
jar {
enabled = true
manifest {
attributes(
'Bundle-License': 'https://www.apache.org/licenses/LICENSE-2.0.txt',
'Implementation-Version': version,
'Implementation-URL': 'https://github.com/schibsted/artishock'
)
}
}
// Copy LICENSE and NOTICE into the JAR
tasks.withType(Jar) {
from(project.projectDir) {
include 'LICENSE', 'NOTICE'
into 'META-INF'
}
}
// Copy LICENSE and NOTICE into the legal directory in each image
def license = "${project.projectDir}/LICENSE"
def notice = "${project.projectDir}/NOTICE"
task copyToLinuxImage(type: Copy) {
dependsOn("runtime")
from license, notice
into "${project.buildDir}/image/artishock-linux/legal/"
}
task copyToMacImage(type: Copy) {
dependsOn("runtime")
from license, notice
into "${project.buildDir}/image/artishock-mac/legal/"
}
task copyToWinImage(type: Copy) {
dependsOn("runtime")
from license, notice
into "${project.buildDir}/image/artishock-win/legal/"
}
runtimeZip.dependsOn('copyToLinuxImage')
runtimeZip.dependsOn('copyToMacImage')
runtimeZip.dependsOn('copyToWinImage')