-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle
196 lines (171 loc) · 5.6 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
buildscript {
repositories {
mavenCentral()
mavenLocal()
jcenter()
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 "4.6.0"
id 'java'
id 'idea'
id 'maven-publish'
id 'jacoco'
}
apply plugin: 'maven'
apply plugin: 'com.jfrog.artifactory'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
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
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
javadoc {
options.addBooleanOption('html5', true)
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task createPom {
doLast {
pom
{
project {
artifactId 'jackson-json-crypto'
groupId 'com.codingrodent'
name 'com.codingrodent.jackson.crypto'
description 'A Crypto Module for Jackson'
url 'https://github.com/codesqueak/jackson-json-crypto'
scm {
url 'https://github.com/codesqueak/jackson-json-crypto'
connection 'scm:git:git://github.com/codesqueak/jackson-json-crypto.git'
developerConnection 'scm:git:ssh://github.com:codesqueak/jackson-json-crypto.git'
}
licenses {
license {
name 'MIT License'
url 'https://opensource.org/licenses/MIT'
distribution 'repo'
}
}
developers {
developer {
id 'codesqueak'
name 'codesqueak'
email '[email protected]'
organizationUrl 'http://www.codesqueak.com'
// organization 'codesqueak'
}
}
}
}.writeTo("$buildDir/libs/" + projectName + "-" + version + ".pom")
}
}
artifacts {
archives sourcesJar
archives javadocJar
}
repositories {
mavenCentral()
}
jacoco {
toolVersion = "0.8.6"
reportsDir = file("$buildDir/customJacocoReportDir")
}
test {
useJUnitPlatform()
maxParallelForks = 1
filter
{
includeTestsMatching "com.codingrodent.jackson.*"
}
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.2.0'
ignoreFailures = false
effort = 'max'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
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
}
}
}
dependencies {
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.12.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.12.0'
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
implementation group: 'org.hibernate', name: 'hibernate-validator', version: '6.1.7.Final'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
implementation group: 'org.glassfish', name: 'javax.el', version: '3.0.0'
implementation group: 'javax.el', name: 'javax.el-api', version: '3.0.0'
//
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.7.0'
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.0'
testCompile group: 'org.easymock', name: 'easymock', version: '4.2'
testCompile group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
}
wrapper {
gradleVersion = '6.7.1'
distributionType = Wrapper.DistributionType.BIN
}