forked from osiam/osiam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
200 lines (178 loc) · 5.27 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
plugins {
id 'antlr'
id 'java'
id 'groovy'
id 'war'
id 'jacoco'
id 'maven'
id 'maven-publish'
id 'com.github.hierynomus.license' version '0.14.0'
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'com.jfrog.bintray' version '1.8.0'
id 'com.github.ben-manes.versions' version '0.17.0'
id 'org.springframework.boot' version '1.5.10.RELEASE'
}
group = 'org.osiam'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
publishing {
publications {
OsiamPublication(MavenPublication) {
from components.web
groupId 'org.osiam'
artifactId 'osiam'
if (project.version == 'latest') {
version 'latest-SNAPSHOT'
} else {
version project.version
}
}
}
repositories {
maven {
name 'JFrog OSS snapshot repository'
if (project.version == 'latest') {
url 'https://oss.jfrog.org/artifactory/oss-snapshot-local'
} else {
url 'https://api.bintray.com/maven/osiam/OSIAM/org.osiam:osiam/;publish=1'
}
credentials {
username System.getenv('BINTRAY_USER')
password System.getenv('BINTRAY_KEY')
}
}
}
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
publish = true
override = true
filesSpec {
from 'build/libs/osiam.war'
into "osiam/${project.version}"
rename '(.+)\\.(.+)', "\$1-${project.version}.\$2"
}
pkg {
repo = 'downloads'
name = 'osiam'
userOrg = 'osiam'
licenses = ['MIT']
vcsUrl = 'https://github.com/osiam/osiam.git'
version {
name = project.version
released = new Date()
gpg {
sign = true
passphrase = System.getenv('GPG_PASSPHRASE')
}
}
}
}
war {
archiveName = 'osiam.war'
version = project.version
}
springBoot {
executable = true
}
ext {
generatedSourcesDir = new File("${projectDir}/build/generated")
generatedSourcesJavaDir = new File(generatedSourcesDir, "/java")
}
configurations {
jpaModelGen
}
ext['spock.version'] = '1.1-groovy-2.4'
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
compile 'org.springframework.boot:spring-boot-starter-thymeleaf'
compile 'org.springframework.boot:spring-boot-starter-security'
compile 'org.springframework.boot:spring-boot-starter-actuator'
compile 'org.springframework.security.oauth:spring-security-oauth2'
compile 'org.springframework.security:spring-security-ldap'
compile 'org.springframework.boot:spring-boot-devtools'
compile 'org.flywaydb:flyway-core'
compile 'org.postgresql:postgresql'
compile 'mysql:mysql-connector-java'
compile 'com.h2database:h2'
compile 'com.zaxxer:HikariCP'
compile 'joda-time:joda-time'
compile 'org.aspectj:aspectjrt'
compile 'org.aspectj:aspectjweaver'
compile 'org.hibernate:hibernate-validator'
compile 'org.apache.tika:tika-core:1.17'
compile 'com.google.guava:guava:24.0-jre'
compile 'org.antlr:antlr4:4.6'
testCompile 'org.codehaus.groovy:groovy-all'
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'org.spockframework:spock-core'
testCompile 'cglib:cglib-nodep:3.2.6'
testCompile 'org.objenesis:objenesis:2.6'
testCompile 'com.jayway.restassured:json-path:2.9.0'
testCompile 'com.jayway.jsonpath:json-path:2.4.0'
testCompile 'nl.jqno.equalsverifier:equalsverifier:1.7.8'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
antlr 'org.antlr:antlr4:4.6'
jpaModelGen 'org.hibernate:hibernate-jpamodelgen'
}
sourceSets {
main {
java {
srcDir generatedSourcesJavaDir
}
}
}
task generateJPAMetaModel(type: JavaCompile, group: 'build', description: 'Generate JPA Meta Models') {
source = sourceSets.main.java
outputs.dir generatedSourcesJavaDir
destinationDir = generatedSourcesJavaDir
classpath = configurations.compile + configurations.jpaModelGen
options.compilerArgs = [
"-proc:only"
]
}
generateGrammarSource {
outputDirectory = generatedSourcesJavaDir
arguments += ["-visitor", "-long-messages"]
}
compileJava {
dependsOn generateJPAMetaModel
}
license {
mapping {
g4 = 'JAVADOC_STYLE'
}
excludes(["**/*_.java", "**/LogicalOperatorRules*.java", "**/*.json"])
}
jacoco {
toolVersion = "0.7.7.201606060606"
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.enabled true
}
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/ * _ * ',
'**/LogicalOperatorRules*'
])
})
}
}
check.dependsOn jacocoTestReport
tasks.coveralls {
group = 'Coverage reports'
description = 'Uploads the aggregated coverage report to Coveralls'
dependsOn jacocoTestReport
onlyIf {
System.env.'COVERALLS_REPO_TOKEN'
}
}