This repository has been archived by the owner on Sep 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
167 lines (141 loc) · 4.93 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
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Build dependencies
buildscript {
// Extra properties (valid for all projects if defined here)
ext {
junitJupiterVersion = "5.6.0"
}
// Repositories for build scripts
repositories {
// Maven
mavenCentral()
// Sonatype repositories
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Plugins and defaults
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'signing'
group "it.burning"
version '1.2.11'
idea {
module {
// Override output directories
inheritOutputDirs = false
outputDir = compileJava.destinationDir
testOutputDir = compileTestJava.destinationDir
}
}
sourceSets {
main {
resources {
srcDirs "src/main/resources"
}
}
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
java {
withJavadocJar()
withSourcesJar()
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Repositories
repositories {
// Maven
mavenCentral()
// Sonatype repositories
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Dependencies
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:$junitJupiterVersion")
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Compiler flags
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
// Warn about deprecations
options.compilerArgs << "-Xlint:deprecation"
// Warn about unchecked casts
options.compilerArgs << "-Xlint:unchecked"
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Unit testing
test {
useJUnitPlatform()
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Publishing
publishing {
repositories {
maven {
name = "OSSRH"
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 = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId = 'cron-expression-descriptor'
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Cron Expression Descriptor'
description = 'A Java library that converts cron expressions into human readable descriptions'
url = 'https://github.com/voidburn/cron-expression-descriptor'
licenses {
license {
name = 'MIT'
url = 'https://github.com/voidburn/cron-expression-descriptor/blob/master/LICENSE'
}
}
developers {
developer {
id = 'voidburn'
name = 'Luca Vignaroli'
email = 'luca@burning.it'
}
}
scm {
connection = 'scm:git:https://github.com/voidburn/cron-expression-descriptor.git'
developerConnection = 'scm:git:https://github.com/voidburn/cron-expression-descriptor.git'
url = 'https://github.com/voidburn/cron-expression-descriptor'
}
}
}
}
}
signing {
def signingKey = System.getenv("BURNING_GPG_KEY")
def signingPassword = System.getenv("BURNING_GPG_PASSPHRASE")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}