-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
86 lines (74 loc) · 2 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
plugins {
id 'java'
id 'maven-publish'
}
//
group 'media.hiway'
version '1.1.0'
java.sourceCompatibility = JavaVersion.VERSION_11
//
ext {
keycloakVersion = '22.0.1'
}
repositories {
mavenCentral()
}
dependencies {
compileOnly "org.keycloak:keycloak-core:$keycloakVersion"
compileOnly "org.keycloak:keycloak-server-spi:$keycloakVersion"
compileOnly "org.keycloak:keycloak-server-spi-private:$keycloakVersion"
compileOnly "org.keycloak:keycloak-services:$keycloakVersion"
testImplementation "org.keycloak:keycloak-services:$keycloakVersion"
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
}
// Define tasks to create JARs with custom names based on the environment
task jarDev(type: Jar) {
archiveBaseName.set('druid-social-identity-provider-dev')
archiveVersion.set(version)
from sourceSets.main.output
// Include the development properties file
from('config-dev.properties') {
rename { 'config.properties' } // Ensures it's named correctly upon inclusion
into('config')
}
}
task jarProd(type: Jar) {
archiveBaseName.set('druid-social-identity-provider-prod')
archiveVersion.set(version)
from sourceSets.main.output
// Include the production properties file
from('config-prod.properties') {
rename { 'config.properties' } // Ensures it's named correctly upon inclusion
into('config')
}
}
// Define build task to depend on specific jar task based on the environment
task buildDev {
dependsOn jarDev
}
task buildProd {
dependsOn jarProd
}
// Default build task
build {
dependsOn buildProd // Change to buildProd for production by default if needed
}
test {
useJUnitPlatform()
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}
// run 'gradle wrapper' to regenerate gradle/ folder
wrapper {
gradleVersion = "8.0.2"
distributionType = Wrapper.DistributionType.BIN
}