forked from groovyzk/grailszk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
102 lines (89 loc) · 3.56 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
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "io.github.gradle-nexus:publish-plugin:1.0.0"
}
}
allprojects {
apply plugin: "java-library"
apply plugin: "signing"
apply plugin: "maven-publish"
group "$project.group"
version "$project.version"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
javadoc {
failOnError = false
}
}
apply plugin: "io.github.gradle-nexus.publish-plugin"
ext {
isReleaseVersion = !version.endsWith("SNAPSHOT")
it."signing.keyId" = project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : System.getenv('SIGNING_KEY_ID')
it."signing.secretKeyRingFile" = project.hasProperty("signing.secretKeyRingFile") ? project.getProperty('signing.secretKeyRingFile') : "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg"
it."signing.password" = project.hasProperty("signing.password") ? project.getProperty('signing.password') : System.getenv('SIGNING_PASSWORD')
}
subprojects {
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
maven(MavenPublication) {
from components.java
pom {
name = project.name.replace('-', ' ').capitalize()
description = 'A Grails plugin that gives special support for building ZK applications'
url = 'https://github.com/groovyzk/grailszk'
licenses {
license {
name = 'LGPL 3.0'
url = 'https://github.com/groovyzk/grailszk/blob/main/LICENSE'
}
}
developers {
developer {
id = 'maiconandsilva'
name = 'Maicon Mauricio'
email = 'maicon.dev@pm.me'
}
}
scm {
url = 'https://github.com/groovyzk/grailszk/tree/main'
connection = 'scm:git:git://github.com/groovyzk/grailszk.git'
developerConnection = 'scm:git:ssh://github.com:groovyzk/grailszk.git'
}
}
}
}
}
afterEvaluate {
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
sign publishing.publications.maven
}
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
}
nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
}