-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
81 lines (71 loc) · 2.81 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
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
ext {
isRelease = project.findProperty('release') == 'true'
versionSuffix = project.findProperty('release') != 'true' ? '-SNAPSHOT' : ''
}
group = 'io.github.azahnen'
version = '1.0.0' + versionSuffix
repositories {
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
//TODO: currently a release has to be done locally because of the gpg key
//TODO: currently a release will only create a staging repository that has to be released manually, see https://central.sonatype.org/pages/ossrh-guide.html
// that could be automated with the nexus-staging-gradle-plugin, see https://github.com/gradle-nexus/publish-plugin/
publishing {
repositories {
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isRelease ? releaseRepo : snapshotRepo
credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user"
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password"
}
}
}
publications {
mavenJava(MavenPublication) {
pom {
groupId = project.group
name = project.name
description = 'Dagger with less boilerplate'
url = 'https://github.com/azahnen/dagger-auto'
from components.java
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection = 'scm:git:git@github.com:azahnen/dagger-auto.git'
developerConnection = 'scm:git:git@github.com:azahnen/dagger-auto.git'
url = 'https://github.com/azahnen/dagger-auto'
}
developers {
developer {
id = 'azahnen'
name = 'Andreas Zahnen'
//email = 'bmf@gmx.li'
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
tasks.withType(Sign) {
onlyIf { isRelease }
}
}