-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
122 lines (109 loc) · 3.38 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
plugins {
id 'java-gradle-plugin'
id 'maven-publish'
id 'signing'
id "io.github.gradle-nexus.publish-plugin" version "1.2.0"
}
repositories {
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
def snapshotSuffix = project.hasProperty('release') ? '' : '-SNAPSHOT'
group = GROUP
version = VERSION + snapshotSuffix
gradlePlugin {
automatedPublishing = false
plugins {
javaeePlugin {
id = 'foundation.icon.javaee'
implementationClass = 'foundation.icon.gradle.plugins.javaee.JavaeePlugin'
}
}
}
dependencies {
implementation 'foundation.icon:javaee-tooling:0.9.6'
implementation 'foundation.icon:icon-sdk:2.5.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
}
test {
useJUnitPlatform()
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier 'javadoc'
from javadoc.destinationDir
}
def repoUrl = 'https://github.com/icon-project/gradle-javaee-plugin'
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "iconfoundation"
name "icon.foundation"
email "foo@icon.foundation"
}
}
scm {
url repoUrl
}
}
publishing {
repositories {
maven {
name = 'mavenCentral'
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 = project.hasProperty('mavenCentralUsername') ? "$mavenCentralUsername" : ''
password = project.hasProperty('mavenCentralPassword') ? "$mavenCentralPassword" : ''
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('name', project.name)
root.appendNode('description', 'Gradle plugin for ICON JavaEE')
root.appendNode('url', repoUrl)
root.children().last() + pomConfig
}
}
}
}
signing {
required project.hasProperty('release')
if (project.hasProperty('signingKey')) {
def signingKey = project.findProperty("signingKey")
def signingPassword = project.findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.mavenJava
}
nexusPublishing {
packageGroup = GROUP
repositories {
sonatype {
stagingProfileId = findProperty('mavenProfileId') ?: System.getenv("STAGING_PROFILE_ID")
username = findProperty('mavenCentralUsername') ?: System.getenv("OSSRH_USERNAME")
password = findProperty('mavenCentralPassword') ?: System.getenv("OSSRH_PASSWORD")
}
}
}