-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
82 lines (67 loc) · 3.09 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
import org.apache.tools.ant.taskdefs.condition.Os
plugins {
id "java-library"
}
ext {
slf4jVersion = '2.0.13'
awsSDKVersion='1.12.712'
bouncyCastleVersion = '1.78'
}
defaultTasks 'clean', 'buildCSR'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
group = 'io.github.quotidian-ennui'
repositories {
mavenCentral()
}
def asFileUrl(filepath) {
return "file:///" + new java.net.URI(null, filepath, null).toASCIIString();
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 60, "minutes"
resolutionStrategy.dependencySubstitution {
substitute module('commons-logging:commons-logging') using module("org.slf4j:jcl-over-slf4j:$slf4jVersion")
// Redirect bouncy castle jdk15on to jdk18on
substitute module('org.bouncycastle:bcprov-jdk15on') using module("org.bouncycastle:bcprov-jdk18on:$bouncyCastleVersion")
substitute module('org.bouncycastle:bcprov-ext-jdk15on') using module("org.bouncycastle:bcprov-ext-jdk18on:$bouncyCastleVersion")
substitute module('org.bouncycastle:bcpkix-jdk15on') using module("org.bouncycastle:bcpkix-jdk18on:$bouncyCastleVersion")
substitute module('org.bouncycastle:bcmail-jdk15on') using module("org.bouncycastle:bcmail-jdk18on:$bouncyCastleVersion")
substitute module('org.bouncycastle:bcutil-jdk15on') using module("org.bouncycastle:bcutil-jdk18on:$bouncyCastleVersion")
substitute module('org.bouncycastle:bcpg-jdk15on') using module("org.bouncycastle:bcpg-jdk18on:$bouncyCastleVersion")
substitute module('org.bouncycastle:bcjmail-jdk15on') using module("org.bouncycastle:bcjmail-jdk18on:$bouncyCastleVersion")
substitute module('org.bouncycastle:bctls-jdk15on') using module("org.bouncycastle:bctls-jdk18on:$bouncyCastleVersion")
}
}
dependencies {
implementation ("com.amazonaws:aws-java-sdk-kms:$awsSDKVersion")
implementation ("org.bouncycastle:bcprov-jdk18on:$bouncyCastleVersion")
implementation ("org.bouncycastle:bcpkix-jdk18on:$bouncyCastleVersion")
implementation ("org.bouncycastle:bcmail-jdk18on:$bouncyCastleVersion")
implementation (platform("com.fasterxml.jackson:jackson-bom:2.17.0"))
implementation ("org.slf4j:slf4j-api:$slf4jVersion")
runtimeOnly ("org.slf4j:slf4j-simple:$slf4jVersion")
runtimeOnly ("org.slf4j:jcl-over-slf4j:$slf4jVersion")
if (JavaVersion.current().ordinal() >= JavaVersion.VERSION_1_9.ordinal()) {
runtimeOnly ("javax.xml.bind:jaxb-api:2.3.1")
}
}
task LauncherJar(type: Jar) {
archiveAppendix = "launcher"
ext.launcherClasspath = { ->
def verifyLibs = [
configurations.runtimeClasspath.collect { asFileUrl(it.getCanonicalPath()) }.join(' '),
asFileUrl(jar.archivePath.getCanonicalPath())
]
return verifyLibs.join(' ')
}
manifest {
attributes ("Class-Path": launcherClasspath())
}
}
task buildCSR(type: JavaExec, dependsOn: [jar, LauncherJar]) {
group = 'Execution'
description = 'Generate a CSR'
classpath = files(LauncherJar.archivePath)
mainClass = 'io.github.quotidianennui.CertRequestBuilder'
args "$projectDir/build.properties"
}