-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
116 lines (93 loc) · 3.12 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
plugins {
id 'groovy'
id 'maven-publish'
id 'signing'
}
group = 'org.gmetrics'
archivesBaseName = 'GMetrics'
version = '2.1.0'
description = 'GMetrics'
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://repo.maven.apache.org/maven2" }
}
dependencies {
def groovyVersion = "3.0.9"
def slf4jVersion = "1.7.32"
def junitVersion = "5.8.2"
implementation "org.codehaus.groovy:groovy:$groovyVersion"
implementation "org.codehaus.groovy:groovy-xml:$groovyVersion"
implementation "org.codehaus.groovy:groovy-ant:$groovyVersion"
implementation "org.codehaus.groovy:groovy-templates:$groovyVersion"
implementation "org.slf4j:slf4j-api:$slf4jVersion"
testImplementation(platform("org.junit:junit-bom:${junitVersion}"))
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testImplementation "org.slf4j:slf4j-simple:$slf4jVersion"
testImplementation 'org.codenarc:CodeNarc:3.0.1'
}
test {
useJUnitPlatform()
}
java {
withJavadocJar()
withSourcesJar()
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
required { gradle.taskGraph.hasTask(publish) }
sign publishing.publications
}
javadoc {
if (JavaVersion.current().java8Compatible) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
// Publish to Sonatype (OSSRH) Maven Repository
// See http://central.sonatype.org/pages/gradle.html
publishing {
publications {
maven(MavenPublication) {
from components.java
artifactId = 'GMetrics'
pom {
name = 'GMetrics'
description = 'The GMetrics project provides calculation and reporting of size and complexity metrics for Groovy source code.'
url = 'http://gmetrics.org'
scm {
connection = 'scm:git:[email protected]:dx42/gmetrics.git'
developerConnection = 'scm:git:[email protected]:dx42/gmetrics.git'
url = 'scm:git:[email protected]:dx42/gmetrics.git'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'chrismair'
name = 'Chris Mair'
email = '[email protected]'
}
}
}
}
}
repositories {
maven {
def releasesUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsUrl : releasesUrl
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}