-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle
189 lines (165 loc) · 5.94 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
/*
* Copyright ish group pty ltd 2021.
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*/
buildscript {
ext {
log4j2Version = '2.17.2'
cayenneVersion = '4.1.1'
jettyVersion = '10.0.7'
mariadbVersion = '2.7.4'
googleGuiceVersion = '4.2.2'
groovyVersion = '2.5.15'
bouncycastleVersion = '1.67'
bootiqueVersion = '1.2'
cfxVersion = '3.3.5'
//latest jackson version 2.12.2 (no any conflicts with spring, see AbstractApplicationContext), same version jasper uses also
jacksonVersion = '2.12.2'
javaxActivationVersion = '1.2.0'
}
repositories {
mavenCentral()
}
dependencies {
classpath "org.apache.cayenne.plugins:cayenne-gradle-plugin:$cayenneVersion"
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.39.0' // adds the task 'dependencyUpdates -Drevision=release'
id 'com.github.node-gradle.node' version '3.1.1' apply false
id 'com.github.psxpaul.execfork' version '0.1.15' apply false
id 'idea'
id 'org.barfuin.gradle.taskinfo' version '1.2.0' // adds the task 'tiTree [some task]' and the task 'tiOrder [some task]'
id 'java'
id 'groovy'
id 'maven-publish'
}
subprojects {
repositories {
maven {
url = uri("https://repo.e-iceblue.com/nexus/content/groups/public/")
content {
includeGroup "e-iceblue"
}
}
mavenCentral()
maven {
//needed for itext
url "https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/"
}
}
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'maven-publish'
// java-library required since we release separate server-jar artifact, needed as plugin dependency
// added it exactly here since api dep doesn't work without that plugin
apply plugin: 'java-library'
sourceCompatibility = 11
// get the version from the command line properties
version = project.hasProperty('releaseVersion') && project.releaseVersion ? project.releaseVersion : "99-SNAPSHOT"
version = version.replace('v','') // remove the leading v from the version
dependencies {
// we are using server-jar and all api dep (log4j+groovy) for plugins
//so it is important to use api config,
//implementation config do not export the libs to level down (plugins project)
api "org.apache.logging.log4j:log4j-api:$log4j2Version"
api "org.apache.logging.log4j:log4j-core:$log4j2Version"
api "org.apache.logging.log4j:log4j-slf4j-impl:$log4j2Version"
api "org.apache.logging.log4j:log4j-jcl:$log4j2Version"
api "org.codehaus.groovy:groovy:$groovyVersion"
api "org.codehaus.groovy:groovy-datetime:$groovyVersion"
api "org.codehaus.groovy:groovy-json:$groovyVersion"
api "org.codehaus.groovy:groovy-jsr223:$groovyVersion"
api "org.codehaus.groovy:groovy-macro:$groovyVersion"
api "org.codehaus.groovy:groovy-xml:$groovyVersion"
api "org.codehaus.groovy:groovy-templates:$groovyVersion"
api "org.codehaus.groovy:groovy-xml:$groovyVersion"
api "org.codehaus.groovy:groovy-dateutil:$groovyVersion"
implementation 'javax.annotation:javax.annotation-api:1.3.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.0'
testImplementation 'org.junit.vintage:junit-vintage-engine:5.8.0' // needed for dbunit https://sourceforge.net/p/dbunit/feature-requests/222/
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'org.dbunit:dbunit:2.7.0'
testImplementation "org.codehaus.groovy:groovy-test-junit5:$groovyVersion"
testImplementation "org.codehaus.groovy:groovy-sql:$groovyVersion"
}
// uncomment when dbunit is detached from junit
// configurations {
// testImplementation.exclude group: 'junit' // exclude junit4
// }
group = 'ish.oncourse.angel'
publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/ishgroup/oncourse"
credentials {
username = System.getenv("GITHUB_ACTOR") ?: gitUsername
password = System.getenv("GITHUB_TOKEN") ?: gitPassword
}
}
}
}
ext.sharedManifest = manifest {
attributes 'Release-Version': version,
'Built-Date': new Date().format("dd-MMM-yyy"),
'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion,
'Implementation-Version': System.getProperty('build_number') ?: 'local',
'SCM-Revision': System.getProperty('svn_revision') ?: 'development',
'Permissions': 'all-permissions',
'Codebase': '*',
'Application-Name': 'onCourse',
'Trusted-Library': 'true'
}
ext {
testFailed = false
}
test {
useJUnitPlatform()
systemProperties 'java.awt.headless': 'true',
'java.locale.providers': 'COMPAT,SPI'
maxHeapSize = '3000M'
maxParallelForks = 1
ignoreFailures = true
// log each starting test
beforeTest {
descriptor -> logger.lifecycle("Running: " + descriptor)
}
reports {
junitXml.enabled = true
}
afterSuite { desc, result ->
if (result.resultType == TestResult.ResultType.FAILURE) {
testFailed = true
}
}
doLast {
if (testFailed) {
throw new Exception("tests failed, exit code == 1")
}
}
}
}
task testReport(type: TestReport) {
destinationDir = file("$buildDir/reports/tests")
// Include the results from the `test` task in all subprojects
reportOn subprojects*.test
}
// Skip beta and other non-final releases in the update report
dependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'b', 'rc', 'cr', 'm', 'pr', 'preview', 'ea'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}