Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added OSGi metadata via build #3477

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ buildscript {
'protobuf': '3.10.0',
'jaxb': '2.3.1',
'robovm': '2.3.9',
'bnd': '5.1.2',
'equinox': '3.16.0'
]
ext.deps = [
'kotlinStdLib': "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}",
Expand Down Expand Up @@ -36,6 +38,10 @@ buildscript {
'wireRuntime': 'com.squareup.wire:wire-runtime:2.2.0',
'jsoup': 'org.jsoup:jsoup:1.12.1',
'robovm': "com.mobidevelop.robovm:robovm-rt:${versions.robovm}",
'bnd': "biz.aQute.bnd:biz.aQute.bnd.gradle:${versions.bnd}",
'bndResolve': "biz.aQute.bnd:biz.aQute.resolve:${versions.bnd}",
'equinox': "org.eclipse.platform:org.eclipse.osgi:${versions.equinox}",
'kotlinStdlibOsgi': "org.jetbrains.kotlin:kotlin-osgi-bundle:${versions.kotlin}"
]

dependencies {
Expand All @@ -47,6 +53,7 @@ buildscript {
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.0'
classpath 'gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9'
classpath "com.mobidevelop.robovm:robovm-gradle-plugin:${versions.robovm}"
classpath deps.bnd
}
repositories {
mavenCentral()
Expand Down Expand Up @@ -144,4 +151,16 @@ subprojects {
jvmTarget = '1.8'
}
}

ext.applyOsgi = { project ->
project.apply plugin: 'biz.aQute.bnd.builder'

project.sourceSets {
osgi
}

project.jar { t ->
t.setClasspath(project.sourceSets.osgi['compileClasspath'] + project.sourceSets.main['compileClasspath'])
}
}
}
19 changes: 13 additions & 6 deletions retrofit-adapters/guava/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit2.adapter.guava
Import-Package: \
org.checkerframework.checker.*;resolution:=optional,\
*
Automatic-Module-Name: retrofit2.adapter.guava
Bundle-SymbolicName: com.squareup.retrofit2.adapter.guava
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -11,9 +24,3 @@ dependencies {
testImplementation deps.assertj
testImplementation deps.mockwebserver
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.adapter.guava'
}
}
17 changes: 11 additions & 6 deletions retrofit-adapters/java8/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit2.adapter.java8
Import-Package: *
Automatic-Module-Name: retrofit2.adapter.java8
Bundle-SymbolicName: com.squareup.retrofit2.adapter.java8
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -10,9 +21,3 @@ dependencies {
testImplementation deps.guava
testImplementation deps.mockwebserver
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.adapter.java8'
}
}
17 changes: 11 additions & 6 deletions retrofit-adapters/rxjava/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit2.adapter.rxjava
Import-Package: *
Automatic-Module-Name: retrofit2.adapter.rxjava
Bundle-SymbolicName: com.squareup.retrofit2.adapter.rxjava
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -11,9 +22,3 @@ dependencies {
testImplementation deps.guava
testImplementation deps.mockwebserver
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.adapter.rxjava'
}
}
17 changes: 11 additions & 6 deletions retrofit-adapters/rxjava2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit2.adapter.rxjava2
Import-Package: *
Automatic-Module-Name: retrofit2.adapter.rxjava2
Bundle-SymbolicName: com.squareup.retrofit2.adapter.rxjava2
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -12,9 +23,3 @@ dependencies {
testImplementation deps.guava
testImplementation deps.mockwebserver
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.adapter.rxjava2'
}
}
17 changes: 11 additions & 6 deletions retrofit-adapters/rxjava3/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit2.adapter.rxjava3
Import-Package: *
Automatic-Module-Name: retrofit2.adapter.rxjava3
Bundle-SymbolicName: com.squareup.retrofit2.adapter.rxjava3
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -12,9 +23,3 @@ dependencies {
testImplementation deps.guava
testImplementation deps.mockwebserver
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.adapter.rxjava3'
}
}
17 changes: 11 additions & 6 deletions retrofit-adapters/scala/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit2.adapter.scala
Import-Package: *
Automatic-Module-Name: retrofit2.adapter.scala
Bundle-SymbolicName: com.squareup.retrofit2.adapter.scala
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -11,9 +22,3 @@ dependencies {
testImplementation deps.guava
testImplementation deps.mockwebserver
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.adapter.scala'
}
}
17 changes: 11 additions & 6 deletions retrofit-converters/gson/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit2.converter.gson
Import-Package: *
Automatic-Module-Name: retrofit2.converter.gson
Bundle-SymbolicName: com.squareup.retrofit2.converter.gson
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -10,9 +21,3 @@ dependencies {
testImplementation deps.assertj
testImplementation deps.mockwebserver
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.converter.gson'
}
}
17 changes: 11 additions & 6 deletions retrofit-converters/guava/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit.converter.guava
Import-Package: *
Automatic-Module-Name: retrofit2.converter.guava
Bundle-SymbolicName: com.squareup.retrofit2.converter.guava
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -10,9 +21,3 @@ dependencies {
testImplementation deps.assertj
testImplementation deps.mockwebserver
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.converter.guava'
}
}
17 changes: 11 additions & 6 deletions retrofit-converters/jackson/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit2.converter.jackson
Import-Package: *
Automatic-Module-Name: retrofit2.converter.jackson
Bundle-SymbolicName: com.squareup.retrofit2.converter.jackson
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -10,9 +21,3 @@ dependencies {
testImplementation deps.assertj
testImplementation deps.mockwebserver
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.converter.jackson'
}
}
17 changes: 11 additions & 6 deletions retrofit-converters/java8/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit.converter.java8
Import-Package: *
Automatic-Module-Name: retrofit2.converter.java8
Bundle-SymbolicName: com.squareup.retrofit2.converter.java8
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -10,9 +21,3 @@ dependencies {
testImplementation deps.mockwebserver
testImplementation deps.findBugsAnnotations
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.converter.java8'
}
}
17 changes: 11 additions & 6 deletions retrofit-converters/jaxb/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit2.converter.jaxb
Import-Package: *
Automatic-Module-Name: retrofit2.converter.jaxb
Bundle-SymbolicName: com.squareup.retrofit2.converter.jaxb
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -12,9 +23,3 @@ dependencies {
testImplementation deps.mockwebserver
testImplementation deps.findBugsAnnotations
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.converter.jaxb'
}
}
17 changes: 11 additions & 6 deletions retrofit-converters/moshi/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'com.vanniktech.maven.publish'
applyOsgi(this)

jar {
// MANIFEST.MF, including OSGi bnd instructions.
bnd '''
Export-Package: retrofit2.converter.moshi
Import-Package: *
Automatic-Module-Name: retrofit2.converter.moshi
Bundle-SymbolicName: com.squareup.retrofit2.converter.moshi
'''
}

dependencies {
api project(':retrofit')
Expand All @@ -10,9 +21,3 @@ dependencies {
testImplementation deps.assertj
testImplementation deps.mockwebserver
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'retrofit2.converter.moshi'
}
}