-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
84 lines (71 loc) · 1.7 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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id "org.ajoberstar.grgit" version '4.0.2'
}
apply plugin: "base"
apply plugin: 'java'
apply plugin: 'java-library'
defaultTasks "clean", "createPluginZip"
sourceCompatibility = 1.8
targetCompatibility = 1.8
def gitVersion = "none"
try {
gitVersion = "v${grgit.head().abbreviatedId}"
} catch(Exception e) {
// Ignore it
}
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyy.MMdd.HHmmss')
return formattedDate
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src']
}
}
}
def spLibs = fileTree(dir: 'lib')
spLibs.include "identityiq*.jar"
spLibs.include "connector*.jar"
dependencies {
implementation spLibs
implementation group: 'commons-logging', name: 'commons-logging', version: '1.1.3'
implementation group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.1'
implementation(group: 'org.glassfish.jersey.bundles', name: 'jaxrs-ri', version: '2.22.2') {
transitive = false
}
}
task createPluginZip(type: Zip) {
archiveName = archivesBaseName + ".${gitVersion}.zip"
into('jars') {
from jar
}
into('import/install') {
from("config") {
include "**"
exclude "*Example*"
}
}
into('import/upgrade') {
from("config") {
include "AuditConfig.xml"
include "ServiceDefinition-*"
}
}
from('.') {
include 'manifest.xml'
include 'db/**'
filter { it.replace("%%BUILD_VERSION%%", getDate() + "." + gitVersion) }
}
}
createPluginZip {
dependsOn 'jar'
}