Skip to content

Commit afe0a3b

Browse files
committed
Fix OSGi bundling problems & take newest version of bnd-platform
1 parent 99b4b7a commit afe0a3b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+5925
-1
lines changed

build.gradle

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'org.standardout:bnd-platform:1.7.0'
98
classpath 'com.github.missedone:gradle-bintray-p2-plugin:1.2.0'
109
}
1110
}
@@ -169,6 +168,32 @@ platform {
169168
}
170169
}
171170

171+
bundle(group: 'guru.nidi', name: 'graphviz-java', version: graphvizVersion) {
172+
bnd {
173+
instruction 'Import-Package', "!org.graalvm.polyglot,*"
174+
}
175+
}
176+
177+
bundle(group: 'com.eclipsesource.j2v8', name: 'j2v8_linux_x86_64', version: '4.6.0') {
178+
bnd {
179+
}
180+
}
181+
182+
bundle(group: 'com.eclipsesource.j2v8', name: 'j2v8_macosx_x86_64', version: '4.6.0') {
183+
bnd {
184+
}
185+
}
186+
187+
bundle(group: 'com.eclipsesource.j2v8', name: 'j2v8_win32_x86', version: '4.6.0') {
188+
bnd {
189+
}
190+
}
191+
192+
bundle(group: 'com.eclipsesource.j2v8', name: 'j2v8_win32_x86_64', version: '4.6.0') {
193+
bnd {
194+
}
195+
}
196+
172197
featureId 'org.contextmapper.contextmap.generator.feature'
173198
featureName 'ContextMappers Context Map Generator'
174199
featureVersion project.version.toString().endsWith('SNAPSHOT') ? project.version.toString().replace("SNAPSHOT", "") + new SimpleDateFormat("YYYYMMddHHmmss").format(new Date()) : project.version.toString()

buildSrc/build.gradle

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
2+
buildscript {
3+
repositories {
4+
jcenter()
5+
}
6+
dependencies {
7+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5'
8+
}
9+
}
10+
11+
apply plugin: 'groovy'
12+
apply plugin: 'maven'
13+
apply plugin: 'signing'
14+
apply plugin: 'eclipse'
15+
apply plugin: 'com.jfrog.bintray'
16+
apply plugin: 'maven-publish'
17+
18+
19+
repositories {
20+
jcenter()
21+
}
22+
23+
group = 'org.standardout'
24+
version = '1.8.0-SNAPSHOT'
25+
26+
sourceCompatibility = '1.7'
27+
targetCompatibility = '1.7'
28+
29+
jar {
30+
// include license into jar
31+
into 'META-INF', {
32+
from 'LICENSE'
33+
}
34+
}
35+
36+
dependencies {
37+
compile gradleApi()
38+
compile 'biz.aQute.bnd:biz.aQute.bndlib:3.5.0'
39+
compile 'org.osgi:osgi.core:6.0.0'
40+
compile 'commons-io:commons-io:2.4'
41+
compile 'de.undercouch:gradle-download-task:3.1.1'
42+
compile localGroovy()
43+
}
44+
45+
// package groovydoc into a jar file
46+
task packageJavadoc(type: Jar, dependsOn: 'groovydoc') {
47+
from groovydoc.destinationDir
48+
classifier = 'javadoc'
49+
}
50+
51+
// package source into a jar file
52+
task packageSources(type: Jar) {
53+
from sourceSets.main.allSource
54+
classifier = 'sources'
55+
}
56+
57+
// define artifacts for upload
58+
artifacts {
59+
archives jar
60+
archives packageJavadoc
61+
archives packageSources
62+
}
63+
64+
def configurePom(def pom) {
65+
// ensure correct artifact ID
66+
pom.artifactId = 'bnd-platform'
67+
68+
// pom file details
69+
pom.project {
70+
name 'bnd-platform'
71+
packaging 'jar'
72+
description 'Build OSGi bundles and Eclipse Update Sites from existing JARs, e.g. from Maven repositories (Plugin for Gradle)'
73+
url 'https://github.com/stempler/bnd-platform'
74+
75+
scm {
76+
url 'scm:git:https://github.com/stempler/bnd-platform.git'
77+
connection 'scm:git:https://github.com/stempler/bnd-platform.git'
78+
developerConnection 'scm:git:https://github.com/stempler/bnd-platform.git'
79+
}
80+
81+
licenses {
82+
license {
83+
name 'The Apache Software License, Version 2.0'
84+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
85+
distribution 'repo'
86+
}
87+
}
88+
89+
developers {
90+
developer {
91+
id 'stempler'
92+
name 'Simon Templer'
93+
email 'simon@templer.cc'
94+
}
95+
}
96+
}
97+
}
98+
99+
install {
100+
repositories.mavenInstaller {
101+
// ensure correct artifact ID when installing locally
102+
configurePom(pom)
103+
}
104+
}
105+
106+
// sign all artifacts
107+
signing {
108+
required {
109+
// NOTE: skipping does only work if no gradle properties specifying the key are present
110+
gradle.taskGraph.hasTask('uploadArchives')
111+
}
112+
sign configurations.archives
113+
}
114+
115+
uploadArchives {
116+
repositories {
117+
mavenDeployer {
118+
// sign artifacts before upload
119+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
120+
121+
// upload to sonatype OSS (snapshot/release)
122+
repository(url: this.version.endsWith('-SNAPSHOT') ?
123+
'https://oss.sonatype.org/content/repositories/snapshots' :
124+
'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
125+
authentication(userName: this.hasProperty('sonatypeUsername') ? sonatypeUsername : '',
126+
password: this.hasProperty('sonatypePassword') ? sonatypePassword : '')
127+
}
128+
129+
configurePom(pom)
130+
}
131+
}
132+
}
133+
134+
// groovydoc task work-around
135+
136+
configurations {
137+
jansi.extendsFrom(runtime)
138+
}
139+
groovydoc {
140+
groovyClasspath = project.configurations.jansi
141+
}
142+
dependencies {
143+
jansi 'org.fusesource.jansi:jansi:1.11'
144+
}
145+
146+
// bintray
147+
148+
bintray { // task bintrayUpload
149+
user = project.getProperty('bintrayUser')
150+
key = project.getProperty('bintrayApiKey')
151+
152+
configurations = ['archives']
153+
154+
dryRun = false
155+
publish = !project.version.endsWith('-SNAPSHOT')
156+
pkg {
157+
def githubUrl = 'https://github.com/stempler/bnd-platform'
158+
repo = 'gradle-plugins'
159+
name = 'bnd-platform'
160+
desc = '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.'
161+
websiteUrl = githubUrl
162+
issueTrackerUrl = "$githubUrl/issues"
163+
vcsUrl = "${githubUrl}.git"
164+
licenses = ['Apache-2.0']
165+
labels = ['gradle', 'bnd', 'osgi', 'p2', 'eclipse', 'tycho']
166+
publicDownloadNumbers = true
167+
// version descriptor
168+
version {
169+
name = project.version
170+
attributes = ['gradle-plugin': "org.standardout.bnd-platform:${project.group}:bnd-platform"]
171+
}
172+
}
173+
174+
}
175+
176+
publishing {
177+
publications {
178+
MyPublication(MavenPublication) {
179+
from components.java
180+
groupId "${group}"
181+
artifactId 'bnd-platform'
182+
version "${version}"
183+
}
184+
}
185+
}
186+

buildSrc/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# override in gradle user home
2+
bintrayUser=
3+
bintrayApiKey=

0 commit comments

Comments
 (0)