forked from leonardehrenfried/opening-hours-evaluator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
113 lines (98 loc) · 3.27 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
plugins {
id 'maven-publish'
id 'signing'
id 'java-library'
id "com.diffplug.spotless" version "5.1.1"
id 'com.github.ksoichiro.console.reporter' version '0.6.2'
id 'io.codearte.nexus-staging' version '0.21.2'
id 'com.palantir.git-version' version '0.12.3'
}
group 'io.leonard'
version gitVersion()
sourceCompatibility = 11
repositories {
mavenCentral()
}
compileJava {
options.compilerArgs << '-parameters'
}
ext {
junitVersion = '5.6.2'
parserVersion = '0.25.0'
}
dependencies {
api group: 'ch.poole', name: 'OpeningHoursParser', version: parserVersion
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitVersion
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: junitVersion
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitVersion
// because we bundle everything up as a fat jar, this needs to be here a second time
testImplementation group: 'ch.poole', name: 'OpeningHoursParser', version: parserVersion
}
spotless {
java {
importOrder()
removeUnusedImports()
googleJavaFormat()
}
}
test {
useJUnitPlatform()
}
//-- begin maven-publish.publish spell --
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'OpenStreetMap Opening Hours evaluator'
description = 'Evaluator for OpenStreetMap-formatted opening hours'
url = 'https://github.com/leonardehrenfried/opening-hours-evaluator'
licenses {
license {
name = 'MIT'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'leonardehrenfried'
name = 'Leonard Ehrenfried'
email = 'mail@leonard.io'
}
}
scm {
connection = 'scm:git:https://github.com/leonardehrenfried/opening-hours-evaluator.git'
developerConnection = 'scm:git:https://github.com/leonardehrenfried/opening-hours-evaluator.git'
url = 'https://github.com/leonardehrenfried/opening-hours-parser'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username project.findProperty('nexusUsername') ?: 'secured'
password project.findProperty('nexusPassword') ?: 'secured'
}
}
}
}
nexusStaging {
delayBetweenRetriesInMillis = 15 * 1000
}
signing {
sign publishing.publications
}