plugins { id "io.github.goooler.osgi" version "0.8.6" } apply plugin: 'io.github.goooler.osgi' configurations { embedOsgi } dependencies { implementation project(path: ':svnkit') implementation project(path: ':svnkit-javahl16') implementation 'org.eclipse.core:runtime:3.10.0-v20140318-2214' embedOsgi project(path: ':svnkit', transitive: false, configuration: 'jar_archive') embedOsgi project(path: ':svnkit-javahl16', transitive: false, configuration: 'jar_archive') embedOsgi 'de.regnis.q.sequence:sequence-library:1.0.4' embedOsgi 'com.jcraft:jsch.agentproxy.connector-factory:0.0.9' embedOsgi 'org.lz4:lz4-java:1.4.1' embedOsgi 'org.apache.sshd:sshd-core:2.9.3' embedOsgi 'org.apache.sshd:sshd-common:2.9.3' embedOsgi 'net.i2p.crypto:eddsa:0.3.0' embedOsgi('com.jcraft:jsch.agentproxy.svnkit-trilead-ssh2:0.0.9') { transitive = false } } //classes { // doLast { // configurations.embedOsgi.files.each { f -> // if (f.name.endsWith('.jar') || f.name.endsWith('.zip')) { // copy { // into 'build/classes/main' // from zipTree(f) // exclude 'META-INF/**' // } // } // } // } //} jar { dependsOn(":svnkit:jar") dependsOn(":svnkit-javahl16:jar") ext { bundleName = rootProject.group bundleSymbolicName = 'SVNKit pure Java Subversion Library' if (rootProject.release && rootProject.buildNumber.startsWith("snapshot")) { bundleVersion = rootProject.version.replace('-snapshot', '.snapshot').replace('-', '.') } else { bundleVersion = rootProject.version.replace('-SNAPSHOT', '.SNAPSHOT').replace('-', '.') + (rootProject.release ? '.' : '_') + buildNumber } bundleVendor = 'TMate Software' println "OSGi version: ${bundleVersion}" } from { configurations.embedOsgi.collect { it.isDirectory() ? it : zipTree(it) } } archiveBaseName = bundleName manifest { attributes ( 'Bundle-SymbolicName': bundleName, 'Bundle-Version': bundleVersion, 'Bundle-Vendor': bundleVendor, 'Bundle-Name': bundleSymbolicName, 'Bundle-RequiredExecutionEnvironment' : 'JavaSE-' + targetCompatibility, 'Bundle-Activator' : 'org.tmatesoft.svn.core.SVNKitActivator', 'Bundle-ActivationPolicy' : 'lazy', 'Build-Version' : rootProject.version, 'Build-Number' : rootProject.buildNumber, 'Eclipse-BundleShape' : 'jar', 'Require-Bundle': 'net.java.dev.jna;bundle-version="[3.2.7,5.6.0]";resolution:=optional,' + 'com.trilead.ssh2;bundle-version="[1.0.0,2.0.0)",' + 'org.tmatesoft.sqljet;bundle-version="[1.0.5,2.0.0)",' + 'org.eclipse.core.runtime;bundle-version="[3.0.0,4.0.0)"') instruction ('Export-Package','*;version=' + bundleVersion) instruction ('Import-Package', '!*') } }