-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
144 lines (115 loc) · 3.61 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
apply plugin: 'distribution'
apply plugin: 'idea'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
defaultTasks 'clean', 'distZip', 'distTar'
sourceCompatibility = 17
targetCompatibility = 17
group = 'net.unicon'
version = project.version
repositories {
mavenLocal()
mavenCentral()
maven { url "https://build.shibboleth.net/nexus/content/repositories/releases" }
maven { url "https://build.shibboleth.net/nexus/content/repositories/thirdparty" }
}
test.onlyIf { !Boolean.getBoolean('skip.tests') }
configurations {
provided
compile.extendsFrom provided
}
configurations.implementation.transitive = false
dependencies {
implementation "org.apereo.cas.client:cas-client-core:$project.casClientVersion"
compileOnly "jakarta.servlet:jakarta.servlet-api:$project.servletVersion"
compileOnly "net.shibboleth.idp:idp-authn-api:$project.shibIdpVersion"
compileOnly "net.shibboleth.idp:idp-saml-api:$project.shibIdpVersion"
compileOnly "org.apache.commons:commons-lang3:$project.commonLangVersion"
testImplementation "junit:junit:$project.junitVersion"
testImplementation "net.shibboleth.idp:idp-authn-api:$project.shibIdpVersion"
testImplementation "net.shibboleth.idp:idp-saml-api:$project.shibIdpVersion"
testImplementation "jakarta.servlet:jakarta.servlet-api:$project.servletVersion"
testImplementation "org.mockito:mockito-core:$project.mockitoVersion"
testImplementation "org.powermock:powermock-api-mockito2:$project.powermockVersion"
testImplementation "org.powermock:powermock-module-junit4:$project.powermockVersion"
}
test {
jvmArgs "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED"
}
distributions {
main {
distributionBaseName = 'shib-cas-authn'
contents {
from { 'build/dist-tmp' }
}
}
}
task prepDist() {
dependsOn jar
inputs.dir 'IDP_HOME/'
inputs.file 'LICENSE'
outputs.dir 'build/dist-tmp/'
doLast {
copy {
from('IDP_HOME')
from('LICENSE')
into 'build/dist-tmp/'
}
copy {
from (configurations.compile - configurations.provided)
from jar
into 'build/dist-tmp/edit-webapp/WEB-INF/lib'
}
}
}
distTar.dependsOn prepDist
distZip.dependsOn prepDist
task prepImageFiles() {
dependsOn jar
inputs.dir 'src/test/docker'
inputs.dir 'build/libs'
outputs.dir 'build/docker'
doLast {
copy {
from "src/test/docker/"
into 'build/docker/'
}
copy {
from "build/libs/"
into 'build/docker/shib_idp/shibboleth-idp/webapp/WEB-INF/lib/'
}
copy {
from "IDP_HOME/flows/"
into 'build/docker/shib_idp/shibboleth-idp/flows/'
}
copy {
from "IDP_HOME/edit-webapp/"
into 'build/docker/shib_idp/shibboleth-idp/webapp/'
}
}
}
task buildImage(type: Exec) {
dependsOn prepImageFiles
doFirst {
logger.lifecycle("Building the initial images may take a long time. Have plenty of bandwidth.")
}
workingDir 'build/docker'
commandLine 'docker-compose', 'build'
}
task up(type: Exec) {
dependsOn buildImage
workingDir 'build/docker'
commandLine 'docker-compose', 'up', '-d'
}
task stop(type: Exec) {
workingDir 'build/docker'
commandLine 'docker-compose', 'kill'
}
task down(type: Exec) {
dependsOn stop
workingDir 'build/docker'
commandLine 'docker-compose', 'rm', '-f'
}
if (new File('./build/docker/').exists()) {
clean.dependsOn down
}