-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
165 lines (129 loc) · 4.49 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
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'java'
id 'com.github.kt3k.coveralls' version '2.10.1'
id "io.freefair.lombok" version "4.1.6"
id 'com.github.johnrengelman.shadow' version '5.2.0'
}
apply plugin: 'jacoco'
apply plugin: 'maven'
apply plugin: 'signing'
group = 'com.sonalake'
version = '1.0.0'
sourceCompatibility = '11'
// a parameter is defined if it's been passed in and isn't blank
ext.isParameterDefined = { String paramName ->
return project.hasProperty(paramName) && !project.getProperties().get(paramName).toString().isBlank();
}
// some configs of interest to the developer
// don't try to sign and release if we have the settings we care about
ext.isForSigning = isParameterDefined("signing.keyId") && isParameterDefined("signing.password")
// don't try to publish to OSSRH if there is no username/password
ext.isForOssrhPublishing = isParameterDefined('ossrhUsername') && isParameterDefined('ossrhPassword')
// is this a release or a snapshot
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
// don't try to publish the gradle plugin if there is no key/secret
ext.isForPluginPublishing = isParameterDefined('gradle.publish.key') && isParameterDefined('gradle.publish.secret')
repositories {
jcenter()
mavenCentral()
maven { url "https://repo.spring.io/plugins-release/" }
maven { url "https://maven.geomajas.org/" }
}
dependencies {
implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '5.5.1.201910021850-r'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
implementation 'org.jgrapht:jgrapht-core:1.5.0'
implementation 'org.jgrapht:jgrapht-io:1.5.0'
implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
implementation group: 'org.freemarker', name: 'freemarker', version: '2.3.29'
implementation group: 'com.beust', name: 'jcommander', version: '1.78'
// Use JUnit Jupiter API for testing.
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
// Use JUnit Jupiter Engine for testing.
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
testImplementation "org.mockito:mockito-inline:3.11.2"
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.11.2'
}
jacocoTestReport {
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
jar {
manifest {
attributes(
'Main-Class': 'com.sonalake.shotgun.App'
)
}
}
signing {
sign configurations.archives
}
tasks.withType(Sign) {
onlyIf { isForSigning }
}
if (isForOssrhPublishing) {
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name = 'swagger-changelog-gradle-plugin'
packaging 'jar'
// optionally artifactId can be defined here
description 'Build an asciidoc swagger changelog from a nexus history'
url = 'https://github.com/sonalake/shotgun'
scm {
connection = 'scm:git:[email protected]:sonalake/shotgun.git'
developerConnection = 'scm:git:[email protected]:sonalake/shotgun.git'
url = 'https://github.com/sonalake/shotgun'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'daniel-bray-sonalake'
name 'Daniel Bray'
email '[email protected]'
}
}
}
}
}
}
}