-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
151 lines (130 loc) · 4.87 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
plugins {
id 'io.freefair.lombok' version '6.1.0' apply false
id 'com.github.johnrengelman.shadow' version '5.2.0' apply false
id 'org.jenkins-ci.jpi' version '0.43.0' apply false
id 'com.palantir.git-version' version '0.12.3' apply false
}
allprojects {
apply plugin: 'com.palantir.git-version'
ext {
buildTimestamp = "${Instant.now().toString()}"
versionDetails = versionDetails()
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'idea'
// Lombok plugin is made conditional as ptai-i18n project raises duplicate classes
apply plugin: 'io.freefair.lombok'
apply plugin: 'maven-publish'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
group = "${rootGroup}"
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://repo.jenkins-ci.org/releases/' }
maven { url 'https://download.jetbrains.com/teamcity-repository/' }
maven { url 'https://nexus.pentaho.org/content/groups/omni/' }
}
dependencies {
// https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jacksonVersion}"
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
implementation "org.slf4j:slf4j-api:$slf4jVersion"
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}
test {
useJUnitPlatform() {
excludeTags 'integration', 'advanced'
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
task testsJar(type: Jar, dependsOn: testClasses) {
archiveClassifier = 'tests'
from sourceSets.test.output
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked"
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
// OpenAPI-generated files contain some javadoc issues, let's ignore them
// Also delomboked files are also generate warnings
options.addStringOption('Xdoclint:none', '-quiet')
}
jar {
manifest.attributes['Implementation-Version'] = project.version
manifest.attributes['Build-Time'] = buildTimestamp
manifest.attributes['Implementation-Vendor-Id'] = rootGroup
manifest.attributes['Implementation-Git-Hash'] = versionDetails.gitHash
manifest.attributes['Implementation-Git-Hash-Full'] = versionDetails.gitHashFull
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
artifact testsJar
suppressPomMetadataWarningsFor('testFixturesApiElements')
suppressPomMetadataWarningsFor('testFixturesRuntimeElements')
pom {
name = project.name
packaging = 'jar'
inceptionYear = '2018'
url = 'https://www.ptsecurity.com/ww-en/products/ai/'
description = project.description
scm {
url = 'https://github.com/ZhukovAN/ptaiPlugins'
connection = 'scm:git:https://github.com/ZhukovAN/ptaiPlugins.git'
developerConnection = 'scm:git:https://github.com/ZhukovAN/ptaiPlugins.git'
}
developers {
developer {
id = 'ZhukovAN'
name = 'Alexey Zhukov'
email = 'alexey.n.zhukov@gmail.com'
}
}
}
}
}
repositories {
mavenLocal()
}
}
def integrationTest = tasks.register('integrationTest', Test) {
useJUnitPlatform {
includeTags 'integration'
}
testLogging {
events 'passed', 'skipped', 'failed'
}
shouldRunAfter test
}
def advancedTest = tasks.register('advancedTest', Test) {
useJUnitPlatform {
includeTags 'advanced'
}
testLogging {
events 'passed', 'skipped', 'failed'
}
shouldRunAfter test
}
}
wrapper {
gradleVersion = '7.1'
}