-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.gradle
146 lines (124 loc) · 3.26 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
plugins {
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
id "signing"
id 'java-gradle-plugin'
id "groovy"
id "eclipse"
id "maven-publish"
id "com.gradle.plugin-publish" version "1.3.0"
id 'to.wetransform.semantic-release-version' version '2.1.2'
}
repositories {
mavenCentral()
}
group = 'org.standardout'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
jar {
// include license into jar
into 'META-INF', {
from 'LICENSE'
}
}
def isCI = "true".equals(System.getenv("CI"))
def isRelease = !version.endsWith('-SNAPSHOT')
dependencies {
implementation gradleApi()
implementation 'biz.aQute.bnd:biz.aQute.bndlib:6.4.1'
implementation 'org.osgi:osgi.core:8.0.0'
implementation 'commons-io:commons-io:2.18.0'
implementation 'de.undercouch:gradle-download-task:5.6.0'
implementation localGroovy()
// Testing
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
testImplementation("org.assertj:assertj-core:3.26.3")
}
test {
useJUnitPlatform()
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = '8.11.1'
}
gradlePlugin {
def githubUrl = 'https://github.com/stempler/bnd-platform'
website = githubUrl
vcsUrl = githubUrl
plugins {
bndPlatform {
id = 'org.standardout.bnd-platform'
implementationClass = 'org.standardout.gradle.plugin.platform.PlatformPlugin'
displayName = 'bnd-platform'
description = 'Build OSGi bundles and p2 repositories / Eclipse Update Sites from existing libraries and their dependencies, e.g. from Maven repositories. Useful for instance for creating a target platform for Eclipse/Equinox or Maven Tycho build from third party dependencies.'
tags.set(['bnd', 'osgi', 'p2', 'eclipse', 'tycho'])
}
}
}
nexusPublishing {
repositories {
sonatype()
}
}
def configurePom(pom) {
pom.description = 'Build OSGi bundles and Eclipse Update Sites from existing JARs, e.g. from Maven repositories (Plugin for Gradle)'
pom.url = 'https://github.com/stempler/bnd-platform'
pom.scm {
url = 'scm:git:https://github.com/stempler/bnd-platform.git'
connection = 'scm:git:https://github.com/stempler/bnd-platform.git'
developerConnection = 'scm:git:https://github.com/stempler/bnd-platform.git'
}
pom.licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
pom.developers {
developer {
id = 'stempler'
name = 'Simon Templer'
email = '[email protected]'
}
}
}
publishing {
publications {
pluginMaven(MavenPublication) {
groupId "${group}"
artifactId 'bnd-platform'
version "${version}"
pom {
name = 'bnd-platform'
packaging = 'jar'
configurePom(pom)
}
}
}
afterEvaluate {
publications {
bndPlatformPluginMarkerMaven {
pom { pom ->
configurePom(pom)
}
}
}
}
}
// sign all artifacts
signing {
if (isCI) { // use in ASCII armored key for CI
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
}
}
tasks.withType(Sign) {
onlyIf {
isRelease || isCI
}
}