-
Notifications
You must be signed in to change notification settings - Fork 340
/
build.gradle
148 lines (129 loc) · 3.47 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
/*
* PCGen base build using the Gradle tool. This file specifies the core build tasks
* and refers to other files in the code/gradle directory for additional tasks
* for specific output.
*
* Developer build: gradle
* Incremental dev build: gradle build
* Full build: gradle all
*/
plugins {
id 'java'
id 'eclipse'
id "jacoco"
id 'ivy-publish'
id 'checkstyle'
id 'pmd'
id "com.github.spotbugs" version '4.7.5'
id 'com.github.ben-manes.versions' version '0.39.0'
}
group = 'net.sourceforge.pcgen'
description = """PCGen base library"""
defaultTasks 'clean', 'build'
sourceCompatibility = "1.11"
targetCompatibility = "1.11"
ext {
majorVersion = 1
minorVersion = 0
}
repositories {
mavenCentral()
}
dependencies {
testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: '1.8.0'
testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: '1.8.0'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.8.0'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.8.0'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.0'
}
sourceSets {
main {
java {
srcDirs 'code/src/java'
}
}
test {
java {
srcDirs 'code/src/test'
}
}
}
def testSources = ['**/testsupport/**', '**/Abstract**TestCase', '**/*Test']
test {
useJUnitPlatform()
reports {
junitXml.enabled = true
html.enabled = false
}
systemProperties 'property': 'value'
}
jacocoTestReport {
afterEvaluate {
getSourceDirectories().setFrom(files(classDirectories.files.collect {fileTree(dir: it, exclude: testSources)}))
}
reports {
html {
enabled true
}
}
}
// Calculate the version number - runs in the parse phase
allprojects {
ext.buildTimestamp = new Date().format('yyyy-MM-dd HH:mm:ss Z')
if (System.env.BUILD_NUMBER) {
project.version = "$majorVersion.$minorVersion.$System.env.BUILD_NUMBER"
}
else {
project.version = "$majorVersion.$minorVersion"
}
}
task echoVer() doLast {
println "${project.name} Version: ${project.version} (${buildTimestamp})"
}
jar {
manifest {
attributes 'Implementation-Title': 'PCGenBaseLibrary', 'Implementation-Version': project.version,
'Built-On': buildTimestamp
}
}
task sourceJar(type: Jar) {
from sourceSets.main.java
classifier "sources"
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// Rules for how we publish our artifacts in ivy compliant format
publishing {
repositories {
ivy {
name "fileRepo"
url '/var/www/librepo'
}
}
publications {
ivy(IvyPublication) {
from components.java
configurations {
sources {}
javadoc {}
}
artifact(sourceJar) {
type "sources"
conf "sources"
}
artifact(javadocJar) {
type "javadoc"
conf "javadoc"
}
descriptor.withXml {
asNode().info[0].appendNode('description', description)
}
}
}
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
apply from: 'gradle/reporting.gradle'