-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
119 lines (101 loc) · 2.52 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
plugins {
alias libs.plugins.kotlinJvm
alias libs.plugins.kotlinSerialization
alias libs.plugins.kotlinSpring apply false
alias libs.plugins.shadowJar apply false
}
def projectVersion = getEnv('VERSION', 'latest')
ext {
jvmSpecification = 17
initProjectName = 'jwc-app'
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven { url = uri('https://m2.dv8tion.net/releases') }
maven { url = uri('https://jitpack.io') }
maven {
url = uri('https://m2.miloszgilga.pl/private')
credentials {
username = getEnv('MAVEN_NAME')
password = getEnv('MAVEN_SECRET')
}
}
}
group = 'pl.jwizard'
version = projectVersion
}
subprojects {
apply plugin: getPluginId(libs.plugins.kotlinJvm)
apply plugin: getPluginId(libs.plugins.kotlinSpring)
if (project.name != rootProject.ext.initProjectName) {
apply plugin: 'java-library'
}
java {
sourceCompatibility = rootProject.ext.jvmSpecification
targetCompatibility = rootProject.ext.jvmSpecification
}
dependencies {
implementation libs.jwizardLib
implementation libs.kotlin
implementation libs.kotlinReflect
implementation libs.logbackCore
implementation libs.logbackClassic
implementation libs.slf4jApi
testImplementation libs.junitJupiter
testImplementation libs.junitJupiterEngine
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
compileKotlin {
kotlinOptions {
jvmTarget = rootProject.ext.jvmSpecification.toString()
freeCompilerArgs = [
'-Xjsr305=strict',
]
}
}
configurations.configureEach {
exclude group: 'commons-logging', module: 'commons-logging'
}
}
project(":${rootProject.ext.initProjectName}") {
apply plugin: getPluginId(libs.plugins.shadowJar)
jar {
manifest {
attributes(
'Main-Class': 'pl.jwizard.jwc.app.JWizardCoreEntrypointKt'
)
}
}
shadowJar {
archiveBaseName = 'jwizard-core'
archiveClassifier = ''
archiveVersion = ''
destinationDirectory = file("$rootDir/.bin")
}
}
clean {
doLast {
def binDir = file("$projectDir/.bin")
if (binDir.exists()) {
binDir.deleteDir()
}
}
}
tasks.register('shadowJar') {
dependsOn ":${rootProject.ext.initProjectName}:shadowJar"
}
// retrieves the value of an environment variable, with a fallback to a default value
static def getEnv(String name, Object defValue = '') {
return System.getenv("JWIZARD_$name") ?: defValue.toString()
}
// gets the plugin ID from a given PluginDependency provider
static def getPluginId(Provider<PluginDependency> accessor) {
return accessor.get().pluginId
}