-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
179 lines (154 loc) · 4.8 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
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
//Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '4.+')
}
}
plugins {
id "com.github.spotbugs" version "5.0.12"
id 'java'
id 'idea'
id 'maven-publish'
id 'jacoco'
id 'signing'
}
apply plugin: 'com.jfrog.artifactory'
// set the java version
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}
group = 'com.codingrodent.microprocessor'
task setVersion {
if (System.env.BUILD_NUMBER) {
version = projectVersionMajor + '.' + projectVersionMinor + '.' + System.env.BUILD_NUMBER
} else {
version = projectVersionMajor + '.' + projectVersionMinor + '.' + projectVersionBuild
}
}
jar {
baseName = projectName
manifest
{
attributes 'Implementation-Title': projectName,
'Implementation-Version': version
}
}
javadoc {
options.addBooleanOption('html5', true)
}
artifacts {
archives sourcesJar
archives javadocJar
}
repositories {
mavenCentral()
}
jacoco {
toolVersion = "0.8.8"
}
test {
useJUnitPlatform()
maxParallelForks = 1
filter
{
includeTestsMatching "com.codingrodent.microprocessor.*"
}
jacoco {
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
classDumpDir = file("$buildDir/jacoco/classpathdumps")
}
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}
spotbugs {
toolVersion = '4.7.2'
ignoreFailures = false
effort = 'max'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
artifactId= 'Z80Processor'
groupId= 'com.codingrodent.microprocessor'
name= 'com.codingrodent.microprocessor.Z80Processor'
description= 'A Z80 Microprocessor core in Java'
url= 'https://github.com/codesqueak/Z80Processor'
scm {
url= 'https://github.com/codesqueak/Z80Processor'
connection= 'scm:git:git://github.com/codesqueak/Z80Processor.git'
developerConnection= 'scm:git:ssh://github.com:codesqueak/Z80Processor.git'
}
licenses {
license {
name= 'The Apache Software License, Version 2.0'
url= 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution ='repo'
}
}
developers {
developer {
id= 'codesqueak'
name= 'codesqueak'
organizationUrl ='http://www.codesqueak.com'
// organization 'codesqueak'
}
}
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
artifactory {
contextUrl = "${artifactory_contextUrl}" //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = 'gradle-dev-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
defaults {
// Reference to Gradle publications defined in the build script.
// This is how we tell the Artifactory Plugin which artifacts should be
// published to Artifactory.
publications('mavenJava')
publishArtifacts = true
// Properties to be attached to the published artifacts.
properties = ['qa.level': 'basic', 'dev.team': 'core']
// Publish generated POM files to Artifactory (true by default)
publishPom = true
}
}
}
// check.dependsOn jacocoTestReport
dependencies {
implementation group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: '4.7.2'
//
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.1'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.9.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.8.0'
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
}
wrapper {
gradleVersion = '7.5.1'
distributionType = Wrapper.DistributionType.BIN
}