-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
201 lines (162 loc) · 6.31 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import java.text.SimpleDateFormat
import java.time.LocalDate
import java.util.zip.ZipFile
buildscript {
repositories { obj ->
maven {
url = uri("https://plugins.gradle.org/m2/")
}
mavenCentral()
mavenLocal()
}
dependencies {
classpath "org.ajoberstar.grgit:grgit-gradle:4.1.1"
classpath 'org.aspectj:aspectjrt:1.8.9'
classpath "org.asciidoctor:asciidoctor-gradle-jvm:3.3.2"
classpath "org.asciidoctor:asciidoctor-gradle-jvm-pdf:3.3.2"
if (JavaVersion.current().isJava11Compatible()) {
// This is not a plugin in Java 11+
} else {
classpath("gradle.plugin.org.jdrupes.mdoclet:gradle-plugin:1.0.10")
}
}
def iiqJar = file("./lib/sailpoint/identityiq.jar")
if (iiqJar.exists()) {
def searchString = "Implementation-Version: "
def file = new ZipFile(iiqJar)
def contents = file.entries()
.findAll { it.name.endsWith("MANIFEST.MF") }
.collect {
try (InputStream is = file.getInputStream(it)) {
return is.text
}
}
if (contents) {
def manifest = contents[0]
def line = manifest.readLines().find {
it.startsWith(searchString)
}
if (line) {
def iiqVersion = line.substring(searchString.length(), line.indexOf(" ", searchString.length() + 1))
project.extensions.add("iiqVersion", iiqVersion)
}
}
} else {
throw new StopActionException("You must add an 'identityiq.jar' to lib/sailpoint")
}
}
apply plugin: 'checkstyle'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: "org.ajoberstar.grgit"
apply plugin: "signing"
if (JavaVersion.current().isJava8()) {
apply plugin: "org.jdrupes.mdoclet"
}
static def getDistVersion() {
def branch = System.getenv('CI_COMMIT_BRANCH')
def now = new Date()
def format = new SimpleDateFormat("yyyyMM.dd.HHmmss")
def mavenVersion = format.format(now)
if (branch == null || branch != "main") {
return mavenVersion + "-SNAPSHOT"
} else {
return mavenVersion
}
}
/* This is where the compiler finds its inputs */
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test']
}
resources {
srcDirs = ['test']
}
}
}
def libRoot = project.getProperties().getOrDefault("idw.minimal.libpath", "lib")
group 'com.identityworksllc.iiq.common.minimal'
version getDistVersion()
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
/* Where to get dependency libraries */
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
/**
* Disables the Gradle Module Metadata, which breaks on the IIQ JARs that have
* no versions defined.
* https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html#sub:disabling-gmm-publication
*/
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}
configurations {
markdownDoclet
toolLibraries
implementation.extendsFrom toolLibraries
testRuntimeOnly.extendsFrom compileOnly
}
def includeLib = fileTree(dir: "${libRoot}/included")
includeLib.include "*.jar"
def spLib = fileTree(dir: "${libRoot}/sailpoint")
spLib.include ("identityiq.jar")
spLib.include ("connector-bundle-identityiq.jar")
dependencies {
markdownDoclet "org.jdrupes.mdoclet:doclet:2.1.0"
compileOnly spLib
compileOnly includeLib
toolLibraries 'info.picocli:picocli:4.+'
toolLibraries group: 'org.jline', name: 'jline', version: '3.+'
implementation group: 'org.glassfish.jersey.bundles', name: 'jaxrs-ri', version: '2.22.2'
implementation group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.1'
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
implementation group: 'org.apache.velocity', name: 'velocity', version: '1.7'
implementation group: 'javax.el', name: 'javax.el-api', version: '3.0.0'
implementation group: 'javax.faces', name: 'javax.faces-api', version: '2.3'
implementation group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'
implementation group: 'commons-lang', name: 'commons-lang', version: '2.6'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.1.3'
implementation group: 'log4j', name: 'log4j', version: '1.2.17'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.1'
implementation group: 'bsf', name: 'bsf', version: '2.4.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.16.1'
implementation group: 'org.springframework', name: 'spring-core', version: '5.2.15.RELEASE'
implementation group: 'com.google.guava', name: 'guava', version: '11.0.1'
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.11'
implementation (group: 'net.sf.jasperreports', name: 'jasperreports', version: '4.5.1'){
exclude group: 'org.bouncycastle'
exclude group: 'bouncycastle'
}
implementation group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4'
testImplementation group: 'com.googlecode.juniversalchardet', name: 'juniversalchardet', version: '1.0.3'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testImplementation spLib
testImplementation includeLib
testRuntimeOnly group: 'org.aspectj', name: 'aspectjrt', version: '1.9.20.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
compileOnly 'org.projectlombok:lombok:1.18.36'
annotationProcessor 'org.projectlombok:lombok:1.18.36'
testCompileOnly 'org.projectlombok:lombok:1.18.36'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.36'
}
test {
useJUnitPlatform()
}
apply from: "./scripts/build/java.include.gradle"
apply from: "./scripts/build/pub.include.gradle"
apply from: "./scripts/build/checkstyle.build.gradle"
apply from: "./scripts/build/tools.include.gradle"