-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
145 lines (120 loc) · 3.63 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
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
//junit 5 reporter
classpath 'com.kncept.junit5.reporter:junit-reporter:1.2.0'
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'com.kncept.junit5.reporter'
apply plugin: 'maven'
apply plugin: 'signing'
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.kncept.mirage'
version = '0.2-SNAPSHOT'
test {
useJUnitPlatform()
classpath = project.sourceSets.test.runtimeClasspath + files("${projectDir}/src/test/java")
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
jar.manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Vendor' : 'kncept',
'Implementation-Version': project.version,
'Implementation-Author': 'Nicholas Krul', //non standard
'Created-By': System.getProperty('java.version'),
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Source-Compatibility': project.sourceCompatibility,
'Target-Compatibility': project.targetCompatibility
)
}
artifacts {
archives javadocJar, sourcesJar
}
//Allow building but disable signing if the gpg config isn't available
signing {
sign configurations.archives
}
signArchives.onlyIf {new File('gradle.properties').exists()}
task wrapper(type: Wrapper) {
description = 'gradlew'
gradleVersion = '4.8'
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
//hoist properties if gradle.properties exists
String username = null
String password = null
if (project.hasProperty('ossrhUsername')) {
username = ossrhUsername
}
if (project.hasProperty('ossrhPassword')) {
password = ossrhPassword
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: username, password: password)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: username, password: password)
}
pom.project {
name 'Junit Dataprovider'
packaging 'jar'
// optionally artifactId can be defined here
description 'A parser that is capable of handling awkward and dynamic formats with ease'
url 'https://github.com/nkrul/universal-parser'
scm {
connection 'scm:https://github.com/nkrul/mirage.git'
developerConnection 'scm:https://github.com/nkrul/mirage.git'
url 'https://github.com/nkrul/mirage'
}
licenses {
license {
name 'GNU GENERAL PUBLIC LICENSE v3'
url 'https://github.com/nkrul/universal-parser/blob/master/LICENSE'
}
}
developers {
developer {
id 'nkrul'
name 'Nicholas Krul'
email 'nicholas.krul@gmail.com'
}
}
}
}
}
}
dependencies {
//JUnit5 dependencies
testCompile 'org.junit.jupiter:junit-jupiter-api:5.2.0'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.2.0'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.2.0'
testCompile 'org.apiguardian:apiguardian-api:1.0.0'
compile 'org.jboss.forge.roaster:roaster-api:2.20.1.Final'
runtime 'org.jboss.forge.roaster:roaster-jdt:2.20.1.Final'
compile 'com.github.javaparser:javaparser-symbol-solver-core:3.6.10'
}