blob: 22fb3815e9644c53b9e49dcd5a3bf47b8a4cc1cf [file] [log] [blame]
import java.util.jar.JarEntry
import java.util.jar.JarOutputStream
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
import java.util.zip.ZipOutputStream
def customOrder(ZipEntry a, ZipEntry b) {
if (a.name == 'META-INF/MANIFEST.MF' && b.name == 'META-INF/MANIFEST.MF') return 0
if (a.name == 'META-INF/MANIFEST.MF') return -1
if (b.name == 'META-INF/MANIFEST.MF') return 1
return a.name.compareTo(b.name)
}
project(':kernel:org.eclipse.virgo.kernel.agent.dm') {
dependencies {
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testCompile project(':test:org.eclipse.virgo.test.stubs')
testRuntime "org.aspectj:aspectjrt:${project.aspectjVersion}"
compile group: "org.slf4j", name: "slf4j-api", version: slf4jVersion
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi.services", version: osgiServicesVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.equinox.region", version: equinoxRegionVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.core", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.context", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.beans", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.gemini.blueprint", name: "gemini-blueprint-core", version: geminiBlueprintVersion, ext: "jar"
compile group: "org.eclipse.gemini.blueprint", name: "gemini-blueprint-extender", version: geminiBlueprintVersion, ext: "jar"
compile project(':util:org.eclipse.virgo.util.osgi')
compile project(':medic:org.eclipse.virgo.medic')
compile project(':nano:org.eclipse.virgo.nano.core')
}
}
project(':kernel:org.eclipse.virgo.kernel.artifact') {
dependencies {
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testRuntime group: "org.eclipse.virgo.mirrored", name: "org.apache.commons.dbcp", version: commonsDbcpVersion, configuration: "compile", ext: "jar"
compile group: "org.slf4j", name: "slf4j-api", version: slf4jVersion
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi.services", version: osgiServicesVersion, configuration: "compile", ext: "jar"
compile project(':util:org.eclipse.virgo.util.common')
compile project(':util:org.eclipse.virgo.util.io')
compile project(':util:org.eclipse.virgo.util.osgi.manifest')
compile project(':util:org.eclipse.virgo.util.parser.manifest')
compile project(':nano:org.eclipse.virgo.nano.core')
compile project(':repository:org.eclipse.virgo.repository')
}
}
project(':kernel:org.eclipse.virgo.kernel.deployer') {
dependencies {
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testCompile project(':medic:org.eclipse.virgo.medic.test')
testCompile project(':test:org.eclipse.virgo.test.stubs')
testRuntime "org.aspectj:aspectjrt:${project.aspectjVersion}"
testRuntime group: "org.eclipse.virgo.mirrored", name: "org.eclipse.equinox.region", version: equinoxRegionVersion, configuration: "compile", ext: "jar"
compile group: "org.slf4j", name: "slf4j-api", version: slf4jVersion
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi.services", version: osgiServicesVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.beans", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.context", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.core", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.gemini.blueprint", name: "gemini-blueprint-core", version: geminiBlueprintVersion, ext: "jar"
compile project(':kernel:org.eclipse.virgo.kernel.artifact')
compile project(':kernel:org.eclipse.virgo.kernel.osgi')
compile project(':kernel:org.eclipse.virgo.kernel.services')
compile project(':medic:org.eclipse.virgo.medic')
compile project(':nano:org.eclipse.virgo.nano.core')
compile project(':nano:org.eclipse.virgo.nano.deployer.api')
compile project(':nano:org.eclipse.virgo.nano.deployer.hot')
compile project(':repository:org.eclipse.virgo.repository')
compile project(':util:org.eclipse.virgo.util.common')
compile project(':util:org.eclipse.virgo.util.io')
compile project(':util:org.eclipse.virgo.util.jmx')
compile project(':util:org.eclipse.virgo.util.math')
compile project(':util:org.eclipse.virgo.util.osgi.manifest')
if (System.properties['weaving.enabled'] == 'true') {
aspectpath project(':medic:org.eclipse.virgo.medic')
aspectpath project(':nano:org.eclipse.virgo.nano.core')
aspectpath project(':util:org.eclipse.virgo.util.jmx')
}
}
}
project(':kernel:org.eclipse.virgo.kernel.deployer.dm') {
dependencies {
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testCompile project(':medic:org.eclipse.virgo.medic.test')
testCompile project(':test:org.eclipse.virgo.test.stubs')
testRuntime "org.aspectj:aspectjrt:${project.aspectjVersion}"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.beans", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.context", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.core", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.gemini.blueprint", name: "gemini-blueprint-core", version: geminiBlueprintVersion, ext: "jar"
compile project(':kernel:org.eclipse.virgo.kernel.agent.dm')
compile project(':kernel:org.eclipse.virgo.kernel.deployer')
compile project(':medic:org.eclipse.virgo.medic')
compile project(':nano:org.eclipse.virgo.nano.core')
if (System.properties['weaving.enabled'] == 'true') {
aspectpath project(':medic:org.eclipse.virgo.medic')
}
}
}
project(':kernel:org.eclipse.virgo.kernel.dmfragment') {
dependencies {
compile group: "org.slf4j", name: "slf4j-api", version: slf4jVersion
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.beans", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.context", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.context.support", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.core", version: springframeworkVersion, ext: "jar"
compile group: "org.eclipse.gemini.blueprint", name: "gemini-blueprint-core", version: geminiBlueprintVersion, ext: "jar"
compile project(':kernel:org.eclipse.virgo.kernel.agent.dm')
compile project(':kernel:org.eclipse.virgo.kernel.osgi')
compile project(':kernel:org.eclipse.virgo.kernel.deployer')
compile project(':medic:org.eclipse.virgo.medic')
compile project(':nano:org.eclipse.virgo.nano.core')
if (System.properties['weaving.enabled'] == 'true') {
aspectpath project(':medic:org.eclipse.virgo.medic')
}
}
}
project(':kernel:org.eclipse.virgo.kernel.model') {
dependencies {
testCompile group: "org.slf4j", name: "slf4j-api", version: slf4jVersion
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testCompile group: "org.eclipse.virgo.mirrored", name: "org.springframework.beans", version: springframeworkVersion, ext: "jar"
testCompile group: "org.eclipse.virgo.mirrored", name: "org.springframework.context", version: springframeworkVersion, ext: "jar"
testCompile group: "org.eclipse.virgo.mirrored", name: "org.springframework.core", version: springframeworkVersion, ext: "jar"
testCompile project(':test:org.eclipse.virgo.test.stubs')
testCompile project(':kernel:org.eclipse.virgo.kernel.stubs')
testRuntime group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi.services", version: osgiServicesVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.equinox.region", version: equinoxRegionVersion, configuration: "compile", ext: "jar"
compile project(':kernel:org.eclipse.virgo.kernel.osgi')
compile project(':kernel:org.eclipse.virgo.kernel.deployer')
compile project(':medic:org.eclipse.virgo.medic')
compile project(':nano:org.eclipse.virgo.nano.core')
compile project(':nano:org.eclipse.virgo.nano.deployer.api')
compile project(':util:org.eclipse.virgo.util.jmx')
aspectpath project(':nano:org.eclipse.virgo.nano.core')
if (System.properties['weaving.enabled'] == 'true') {
aspectpath project(':medic:org.eclipse.virgo.medic')
aspectpath project(':util:org.eclipse.virgo.util.jmx')
}
}
}
project(':kernel:org.eclipse.virgo.kernel.osgi') {
dependencies {
compile group: "org.slf4j", name: "slf4j-api", version: slf4jVersion
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi.services", version: osgiServicesVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.equinox.region", version: equinoxRegionVersion, configuration: "compile", ext: "jar"
compile project(':util:org.eclipse.virgo.util.osgi.manifest')
compile project(':medic:org.eclipse.virgo.medic')
compile project(':nano:org.eclipse.virgo.nano.core')
compile project(':kernel:org.eclipse.virgo.kernel.artifact')
aspectpath project(':nano:org.eclipse.virgo.nano.core')
}
}
project(':kernel:org.eclipse.virgo.kernel.equinox.extensions') {
dependencies {
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testCompile project(':test:org.eclipse.virgo.test.stubs')
testRuntime "org.aspectj:aspectjrt:${project.aspectjVersion}"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
}
}
project(':kernel:org.eclipse.virgo.kernel.stubs') {
dependencies {
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile project(':util:org.eclipse.virgo.util.common')
compile project(':util:org.eclipse.virgo.util.osgi.manifest')
compile project(':nano:org.eclipse.virgo.nano.core')
compile project(':nano:org.eclipse.virgo.nano.deployer.api')
compile project(':kernel:org.eclipse.virgo.kernel.artifact')
compile project(':kernel:org.eclipse.virgo.kernel.deployer')
compile project(':kernel:org.eclipse.virgo.kernel.osgi')
}
}
project(':kernel:org.eclipse.virgo.kernel.services') {
dependencies {
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testCompile project(':test:org.eclipse.virgo.test.stubs')
testCompile project(':medic:org.eclipse.virgo.medic.test')
testRuntime "org.aspectj:aspectjrt:${project.aspectjVersion}"
compile group: "org.slf4j", name: "slf4j-api", version: slf4jVersion
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.beans", version: springframeworkVersion, ext: "jar"
compile project(':util:org.eclipse.virgo.util.math')
compile project(':util:org.eclipse.virgo.util.io')
compile project(':util:org.eclipse.virgo.util.osgi.manifest')
compile project(':medic:org.eclipse.virgo.medic')
compile project(':nano:org.eclipse.virgo.nano.core')
compile project(':repository:org.eclipse.virgo.repository')
compile project(':kernel:org.eclipse.virgo.kernel.artifact')
}
task rewriteJar(dependsOn: jar) {
tasks['uploadArchives'].dependsOn('rewriteJar')
tasks['assemble'].dependsOn('rewriteJar')
String jarFileName
// store name of the created jar file
jar.outputs.files.each {
println it.getPath()
jarFileName = it.getPath()
}
doLast() {
ZipFile jarFile = new ZipFile(jarFileName)
println "------------"
println "Reordering content of jar file ${jarFileName}:"
println "------------"
new ZipFile(jarFileName).entries().findAll{ !it.directory }.each { println it.name }
println "------------"
String cloneFileName = new File(jarFileName).path + "-clone"
FileOutputStream fos = new FileOutputStream(cloneFileName)
String manifest
jarFile.entries().findAll { it.name == "META-INF/MANIFEST.MF" }.each {
manifest = jarFile.getInputStream(it).text
}
println "------------"
println manifest
println "------------"
JarOutputStream jarOutputStream = new JarOutputStream(fos,
new java.util.jar.Manifest(new ByteArrayInputStream(manifest.getBytes(java.nio.charset.Charset.forName("UTF-8")))))
println "------------"
byte[] readBuffer = new byte[2156]
jarFile.entries().findAll { !it.directory && !(it.name == "META-INF/MANIFEST.MF") }.sort( {a,b -> customOrder(a,b) } ).each {
println "adding ${it.name} to ${cloneFileName}"
jarOutputStream.putNextEntry(new JarEntry(it.name))
jarOutputStream << jarFile.getInputStream(it)
}
jarOutputStream.finish()
println "finished writing ${cloneFileName}"
println "------------"
println "from ${cloneFileName} to ${jarFileName}"
println "within ${file(cloneFileName).parentFile.path} is ${file(cloneFileName).name}"
println "rename ${file(cloneFileName).name} -> ${file(jarFileName).name}"
delete file(jarFileName)
copy {
from file(file(cloneFileName).parentFile.path)
into file(file(cloneFileName).parentFile.path)
rename { String fileName ->
fileName.replace(file(cloneFileName).name, file(jarFileName).name)
}
}
delete file(cloneFileName)
println "------------"
println "Reordered content of jar file ${jarFileName}:"
println "------------"
new ZipFile(jarFileName).entries().findAll{ !it.directory }.each { println it.name }
println "------------"
}
}
}
project(':kernel:org.eclipse.virgo.kernel.userregion') {
dependencies {
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testCompile project(':test:org.eclipse.virgo.test.stubs')
testCompile project(':medic:org.eclipse.virgo.medic.test')
testCompile project(':repository:org.eclipse.virgo.repository')
testRuntime group: "org.eclipse.virgo.mirrored", name: "org.apache.commons.logging", version: commonsLoggingVersion, ext: "jar"
testRuntime group: "org.eclipse.virgo.mirrored", name: "org.apache.commons.codec", version: commonsCodecVersion, ext: "jar"
testRuntime group: "org.eclipse.virgo.mirrored", name: "org.springframework.beans", version: springframeworkVersion, ext: "jar"
testRuntime group: "org.eclipse.virgo.mirrored", name: "org.springframework.core", version: springframeworkVersion, ext: "jar"
testRuntime "org.aspectj:aspectjrt:${project.aspectjVersion}"
compile group: "org.slf4j", name: "slf4j-api", version: slf4jVersion
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi.services", version: osgiServicesVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.equinox.region", version: equinoxRegionVersion, configuration: "compile", ext: "jar"
compile project(':util:org.eclipse.virgo.util.common')
compile project(':util:org.eclipse.virgo.util.math')
compile project(':util:org.eclipse.virgo.util.io')
compile project(':util:org.eclipse.virgo.util.osgi')
compile project(':util:org.eclipse.virgo.util.osgi.manifest')
compile project(':util:org.eclipse.virgo.util.parser.manifest')
compile project(':medic:org.eclipse.virgo.medic')
compile project(':nano:org.eclipse.virgo.nano.core')
compile project(':nano:org.eclipse.virgo.nano.deployer.api')
compile project(':repository:org.eclipse.virgo.repository')
compile project(':kernel:org.eclipse.virgo.kernel.artifact')
compile project(':kernel:org.eclipse.virgo.kernel.osgi')
compile project(':kernel:org.eclipse.virgo.kernel.deployer')
compile project(':kernel:org.eclipse.virgo.kernel.services')
compile project(':kernel:org.eclipse.virgo.kernel.equinox.extensions')
}
}
project(':kernel:org.eclipse.virgo.kernel.userregionfactory') {
dependencies {
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testCompile project(':test:org.eclipse.virgo.test.stubs')
testRuntime "org.aspectj:aspectjrt:${project.aspectjVersion}"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi.services", version: osgiServicesVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.equinox.region", version: equinoxRegionVersion, configuration: "compile", ext: "jar"
compile project(':util:org.eclipse.virgo.util.parser.launcher')
compile project(':util:org.eclipse.virgo.util.osgi')
compile project(':util:org.eclipse.virgo.util.osgi.manifest')
compile project(':util:org.eclipse.virgo.util.parser.manifest')
compile project(':medic:org.eclipse.virgo.medic')
compile project(':nano:org.eclipse.virgo.nano.core')
compile project(':kernel:org.eclipse.virgo.kernel.osgi')
}
}
project(':kernel:org.eclipse.virgo.shell.command') {
dependencies {
testCompile group: "org.slf4j", name: "slf4j-nop", version: slf4jVersion
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testCompile project(':test:org.eclipse.virgo.test.stubs')
testRuntime "org.aspectj:aspectjrt:${project.aspectjVersion}"
compile group: "org.slf4j", name: "slf4j-api", version: slf4jVersion
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi.services", version: osgiServicesVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.equinox.region", version: equinoxRegionVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.apache.felix.gogo.runtime", version: gogoRuntimeVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.springframework.core", version: springframeworkVersion, ext: "jar"
compile project(':kernel:org.eclipse.virgo.kernel.deployer')
compile project(':kernel:org.eclipse.virgo.kernel.model')
compile project(':kernel:org.eclipse.virgo.kernel.osgi')
compile project(':medic:org.eclipse.virgo.medic')
compile project(':nano:org.eclipse.virgo.nano.deployer.api')
compile project(':repository:org.eclipse.virgo.repository')
compile project(':util:org.eclipse.virgo.util.common')
compile project(':util:org.eclipse.virgo.util.io')
compile project(':util:org.eclipse.virgo.util.osgi')
compile project(':util:org.eclipse.virgo.util.osgi.manifest')
if (System.properties['weaving.enabled'] == 'true') {
aspectpath project(':medic:org.eclipse.virgo.medic')
}
}
}
project(':kernel:org.eclipse.virgo.management.fragment') {
dependencies {
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.equinox.region", version: equinoxRegionVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.gemini.management", version: geminiManagementVersion, configuration: "compile", ext: 'jar'
}
}
project(':kernel:org.eclipse.virgo.management.console') {
dependencies {
testCompile group: "org.slf4j", name: "slf4j-nop", version: slf4jVersion
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testCompile group: "org.eclipse.virgo.mirrored", name: "org.springframework.core", version: springframeworkVersion, ext: "jar"
testCompile group: "org.eclipse.virgo.mirrored", name: "org.springframework.web", version: springframeworkVersion, ext: "jar"
testCompile group: "org.eclipse.virgo.mirrored", name: "org.springframework.test", version: springframeworkVersion,ext: "jar"
testCompile group: "org.eclipse.virgo.mirrored", name: "org.mozilla.javascript", version: mozillaJavascriptVersion, configuration: "compile", ext: "jar"
testCompile group: "org.eclipse.virgo.mirrored", name: "org.apache.commons.logging", version: commonsLoggingVersion, ext: "jar"
testCompile group: "commons-io", name: "commons-io", version: commonsIoVersion, ext: "jar"
compile group: "org.slf4j", name: "slf4j-api", version: slf4jVersion
compile group: "org.eclipse.virgo.mirrored", name: "javax.servlet", version: javaxServletVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi.services", version: osgiServicesVersion, configuration: "compile", ext: "jar"
compile group: "org.eclipse.virgo.mirrored", name: "org.eclipse.gemini.management", version: geminiManagementVersion, configuration: "compile", ext: 'jar'
compile group: "commons-fileupload", name: "commons-fileupload", version: commonsFileuploadVersion, ext: "jar"
compile group: "org.jolokia", name: "jolokia-osgi", version: jolokiaVersion, ext: "jar"
}
}