-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.gradle
142 lines (127 loc) · 4.3 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
plugins {
id 'java-library'
id 'jacoco'
id 'maven-publish'
id 'signing'
id 'idea'
id "org.sonarqube" version "6.0.1.5171"
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.9"
id 'io.codearte.nexus-staging' version '0.30.0'
}
group = 'net.joshka'
version = '5.10.2-r0'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
ext.isRunningOnTravis = System.getenv("CI") == "true"
description = """net.joshka:junit-json-params"""
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs << '-parameters'
options.deprecation = true
}
repositories {
mavenCentral()
}
dependencies {
api platform('org.junit:junit-bom:5.11.4')
api 'org.junit.jupiter:junit-jupiter-api'
api 'org.junit.jupiter:junit-jupiter-params'
// jakarta.json-api is not exposed on any public members, so does not need
// to be exposed to use the library
implementation 'jakarta.json:jakarta.json-api:2.1.3'
// this is the reference implementation of jakarta.json, a consumer of this
// library needs to bring their own version (probably this)
testImplementation 'org.eclipse.parsson:parsson:1.1.7'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'org.assertj:assertj-core:3.27.0'
testImplementation 'org.mockito:mockito-core:5.14.2'
}
test {
useJUnitPlatform()
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'JUnit JSON Params'
description = 'JUnit 5 JSON Parameterized Tests library'
url = 'http://www.joshka.net/junit-json-params/'
inceptionYear = '2018'
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'joshka'
name = 'Josh McKinney'
url = 'http://www.joshka.net'
}
}
scm {
connection = 'scm:git:https://github.com/joshka/junit-json-params.git'
developerConnection = 'scm:git:https://github.com/joshka/junit-json-params.git'
url = 'https://github.com/joshka/junit-json-params/'
}
issueManagement {
system = 'Github'
url = 'https://github.com/joshka/junit-json-params/issues'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "$buildDir/repos/releases"
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
url = isReleaseVersion ? releasesRepoUrl : snapshotsRepoUrl
}
maven {
name = 'OSSRH'
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = isReleaseVersion ? releasesRepoUrl : snapshotsRepoUrl
credentials(PasswordCredentials) {
username = isRunningOnTravis ? '' : sonatypeUsername
password = isRunningOnTravis ? '' : sonatypePassword
}
}
}
}
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
useGpgCmd()
sign publishing.publications.mavenJava
}
idea.project.settings {
compiler {
javac {
// Necessary for JsonConverter as method parameters otherwise have names like 'arg0', ...
javacAdditionalOptions "-parameters"
}
}
}
nexusStaging {
packageGroup 'net.joshka'
stagingProfileId '2751a733b7e537'
}
sonar {
properties {
property "sonar.projectKey", "joshka_junit-json-params"
property "sonar.organization", "joshka-github"
property "sonar.host.url", "https://sonarcloud.io"
}
}