blob: 98453373d4b19fc7b45cbe7fbf4c0eacc70289eb [file] [log] [blame]
import aspectj.AspectJPlugin
import virgobuild.Config
import virgobuild.VirgoToolsPlugin
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0"
}
}
plugins {
id "io.spring.dependency-management" version "1.0.7.RELEASE" apply false
id "biz.aQute.bnd.builder" version "4.2.0" apply false
id "com.github.spotbugs" version "1.7.1" apply false
}
apply plugin: VirgoToolsPlugin
ext {
aspectjVersion = "1.9.3"
javaProjects = [
project(':nano:org.eclipse.virgo.nano.authentication'),
project(':nano:org.eclipse.virgo.nano.shutdown'),
project(':test:org.eclipse.virgo.test.stubs'),
project(':test:org.eclipse.virgo.test.launcher'),
project(':test:org.eclipse.virgo.test.framework'),
project(':test:org.eclipse.virgo.test.tools'),
project(':test:org.eclipse.virgo.test.test'),
project(':kernel:org.eclipse.virgo.kernel.stubs'),
project(':medic:org.eclipse.virgo.medic.test'),
project(':kernel:org.eclipse.virgo.kernel.deployer.test'),
project(':kernel:org.eclipse.virgo.kernel.test'),
project(':util:org.eclipse.virgo.util.integrationtest'),
// project(':medic:org.eclipse.virgo.medic.integrationtest'),
project(':packaging:nano:org.eclipse.virgo.nano.smoketest'),
project(':packaging:kernel:org.eclipse.virgo.kernel.smoketest'),
project(':packaging:tomcat-server:org.eclipse.virgo.tomcat.smoketest'),
]
osgiProjects = [
project(':kernel:org.eclipse.virgo.kernel.equinox.extensions'),
project(':util:org.eclipse.virgo.util.common'),
project(':util:org.eclipse.virgo.util.env'),
project(':util:org.eclipse.virgo.util.io'),
project(':util:org.eclipse.virgo.util.jmx'),
project(':util:org.eclipse.virgo.util.math'),
project(':util:org.eclipse.virgo.util.osgi'),
project(':util:org.eclipse.virgo.util.osgi.manifest'),
project(':util:org.eclipse.virgo.util.parser.launcher'),
project(':util:org.eclipse.virgo.util.parser.manifest'),
project(':test:org.eclipse.virgo.test.launcher'),
project(':medic:org.eclipse.virgo.medic'),
project(':medic:org.eclipse.virgo.medic.core'),
project(':medic:org.eclipse.virgo.medic.logbackclassicfragment'),
project(':medic:org.eclipse.virgo.medic.logbackcorefragment'),
project(':nano:org.eclipse.virgo.nano.core'),
project(':nano:org.eclipse.virgo.nano.deployer'),
project(':nano:org.eclipse.virgo.nano.deployer.api'),
project(':nano:org.eclipse.virgo.nano.deployer.hot'),
project(':nano:org.eclipse.virgo.nano.management'),
project(':nano:org.eclipse.virgo.nano.management.controller'),
project(':nano:org.eclipse.virgo.nano.services.concurrent'),
project(':nano:org.eclipse.virgo.nano.services.ds'),
project(':repository:org.eclipse.virgo.repository'),
// Gemini Blueprint tracker/extensions
project(':kernel:org.eclipse.virgo.kernel.agent.dm'),
project(':kernel:org.eclipse.virgo.kernel.dmfragment'),
project(':kernel:org.eclipse.virgo.kernel.kerneldmfragment'),
project(':kernel:org.eclipse.virgo.kernel.artifact'),
project(':kernel:org.eclipse.virgo.kernel.deployer'),
// a test bundle running inside an OSGi container
project(':kernel:org.eclipse.virgo.kernel.deployer.test'),
// FIXME Equinox migration - rename to deployer.blueprint
project(':kernel:org.eclipse.virgo.kernel.deployer.dm'),
project(':kernel:org.eclipse.virgo.kernel.osgi'),
project(':kernel:org.eclipse.virgo.kernel.services'),
project(':kernel:org.eclipse.virgo.kernel.model'),
project(':kernel:org.eclipse.virgo.kernel.userregionfactory'),
project(':kernel:org.eclipse.virgo.shell.command'),
project(':kernel:org.eclipse.virgo.kernel.userregion'),
project(':web:org.eclipse.virgo.web.core'),
project(':web:org.eclipse.virgo.web.dm'),
project(':web:org.eclipse.virgo.web.tomcat.support'),
// web.virgo.enterprise - virgo-reloaded, only?
project(':web:org.eclipse.virgo.web.enterprise.appdeployer'),
project(':web:org.eclipse.virgo.web.enterprise.applistener'),
project(':web:org.eclipse.virgo.web.enterprise.catalina.fragment.webbeans'),
project(':web:org.eclipse.virgo.web.enterprise.javax.persistence.extension'),
project(':web:org.eclipse.virgo.web.enterprise.javax.persistence.provider.initializer'),
project(':web:org.eclipse.virgo.web.enterprise.jsf.support'),
project(':web:org.eclipse.virgo.web.enterprise.openejb.fragment.bval'),
project(':web:org.eclipse.virgo.web.enterprise.openejb.fragment.jotm'),
project(':web:org.eclipse.virgo.web.enterprise.openejb.fragment.jpa'),
project(':web:org.eclipse.virgo.web.enterprise.openejb.fragment.webbeans'),
project(':web:org.eclipse.virgo.web.enterprise.openejb.initialiser'),
project(':web:org.eclipse.virgo.web.enterprise.openejb.jpa.integration'),
project(':web:org.eclipse.virgo.web.enterprise.openejb.tomcat.factory'),
project(':web:org.eclipse.virgo.web.enterprise.openwebbeans.initialiser'),
project(':web:org.eclipse.virgo.web.enterprise.persistence.openejb.classloading.hook'),
project(':web:org.eclipse.virgo.web.enterprise.security'),
project(':web:org.eclipse.virgo.web.enterprise.security.openejb.classloading.hook'),
project(':web:org.eclipse.virgo.web.enterprise.security.valve'),
project(':web:org.eclipse.virgo.web.enterprise.services.accessor'),
project(':web:org.eclipse.virgo.web.servlet.adapter'),
project(':web:org.eclipse.virgo.web.spring.integration'),
project(':web:org.eclipse.virgo.web.war.deployer'),
project(':apps:org.eclipse.virgo.apps.splash'),
project(':kernel:org.eclipse.virgo.management.console'),
project(':kernel:org.eclipse.virgo.management.fragment'),
project(':apps:org.eclipse.virgo.apps.repository.core'),
project(':apps:org.eclipse.virgo.apps.repository.web'),
]
aspectjProjects = [
// these projects contain aspects
project(':util:org.eclipse.virgo.util.jmx'),
project(':nano:org.eclipse.virgo.nano.core'),
project(':test:org.eclipse.virgo.test.stubs'),
project(':medic:org.eclipse.virgo.medic'),
// these projects are woven
project(':nano:org.eclipse.virgo.nano.deployer.api'),
project(':nano:org.eclipse.virgo.nano.deployer.hot'),
project(':repository:org.eclipse.virgo.repository'), // seems currently no pointcut matches :(
project(':kernel:org.eclipse.virgo.kernel.dmfragment'),
project(':kernel:org.eclipse.virgo.kernel.deployer'),
project(':kernel:org.eclipse.virgo.kernel.deployer.dm'),
project(':kernel:org.eclipse.virgo.kernel.osgi'),
project(':kernel:org.eclipse.virgo.kernel.model'),
project(':kernel:org.eclipse.virgo.kernel.services'),
project(':kernel:org.eclipse.virgo.shell.command'),
project(':apps:org.eclipse.virgo.apps.repository.core'),
project(':web:org.eclipse.virgo.web.core'),
project(':web:org.eclipse.virgo.web.dm'),
project(':web:org.eclipse.virgo.web.tomcat.support'),
]
}
defaultTasks 'clean', 'jar', 'build', 'distZip'
def Properties versions = new Properties()
versions.load(new FileInputStream(project.rootProject.file('gradle.properties')))
project.ext.props = versions
ext.packagingProjects = [
project(':packaging:nano'),
project(':packaging:kernel'),
project(':packaging:tomcat-server'),
]
ext {
// used when copying features and products
tokenMap = [
'VIRGO.VERSION' : version,
// used in plan files
'VIRGO.VERSION.LOWER_BOUND' : "3.8",
'VIRGO.VERSION.UPPER_BOUND' : "4",
'OSGI.SERVICES.VERSION' : osgiServicesVersion, // used in oev.kernel.userregion.properties
'OSGI.ENTERPRISE.VERSION' : osgiEnterpriseVersion,
'EQUINOX.HTTP.JETTY.VERSION' : equinoxHttpJettyVersion,
'EQUINOX.APP.VERSION' : equinoxAppVersion,
'EQUINOX.COMMON.VERSION' : equinoxCommonVersion,
'EQUINOX.CONFIGADMIN.VERSION' : equinoxCmVersion,
'EQUINOX.DS.VERSION' : equinoxDsVersion,
'EQUINOX.SC.VERSION' : equinoxSimpleConfiguratorVersion,
'EQUINOX.SC.M.VERSION' : equinoxSimpleConfiguratorManipulatorVersion,
'EQUINOX.CONSOLE.VERSION' : equinoxConsoleVersion,
'EQUINOX.CONSOLE.SSH.VERSION' : equinoxConsoleSshVersion,
'EQUINOX.EVENT' : equinoxEventVersion,
'EQUINOX.FRKA.E.VERSION' : equinoxFrameworkadminEquinoxVersion,
'EQUINOX.FRKA.VERSION' : equinoxFrameworkadminVersion,
'EQUINOX.PFRCS.VERSION' : equinoxPreferencesVersion,
'REGION.VERSION' : equinoxRegionVersion,
'EQUINOX.REGISTRY.VERSION' : equinoxRegistryVersion,
'EQUINOX.SECURITY.VERSION' : equinoxSecurityVersion,
'CONTENTTYPE.VERSION' : eclipseCoreContenttypeVersion,
'JOBS.VERSION' : eclipseCoreJobsVersion,
'CORE.NET.VERSION' : eclipseCoreNetVersion,
'CORE.VERSION' : eclipseCoreRuntimeVersion,
'ECF.FT.VERSION' : eclipseEcfFiletransferVersion,
'ECF.I.VERSION' : eclipseEcfIdentityVersion,
'ECF.P.FT.VERSION' : eclipseEcfProviderFiletransferVersion,
'ECF.SSL.VERSION' : eclipseEcfSslVersion,
'ECF.VERSION' : eclipseEcfVersion,
'MINA.CORE.VERSION' : minaCoreVersion,
'SSHD.CORE.VERSION' : apacheSshdCoreVersion,
'FELIX.GOGO.COMMAND.VERSION' : gogoCommandVersion,
'FELIX.GOGO.RUNTIME.VERSION' : gogoRuntimeVersion,
'FELIX.GOGO.SHELL.VERSION' : gogoShellVersion,
'JOLOKIA.VERSION' : jolokiaVersion,
'SPRING.VERSION' : springframeworkVersion,
'GEMINI.MANAGEMENT.VERSION' : geminiManagementVersion,
// TODO rename to 'GENIMI.BLUEPRINT.VERSION'
'SPRING.DM.VERSION' : geminiBlueprintVersion,
'GEMINI.WEB.VERSION' : geminiWebVersion,
'CATALINA.VERSION' : apacheCatalinaVersion,
'ASPECTJ' : aspectjVersion,
'LOGBACK.CLASSIC.VERSION' : logbackVersion,
'LOGBACK.CORE.VERSION' : logbackVersion,
'SLF4J.API' : slf4jVersion,
'SLF4J.JCL' : slf4jVersion,
'SLF4J.LOG4J' : slf4jVersion,
'C.FILEUPLOAD.VERSION' : commonsFileuploadVersion,
'C.IO.VERSION' : commonsIoVersion,
'SCANNOTATION' : scannotationVersion,
'JAVASSIST' : javassistVersion,
'JOTM' : jotmVersion,
'OBJECTWEB.ASM' : objectwebAsmVersion,
'JAVAX.ACTIVATION' : javaxActivationVersion,
'JAVAX.ANNOTATION' : javaxAnnotationVersion,
'JAVAX.EJB' : javaxEjbVersion,
'JAVAX.EL' : javaxElVersion,
'JAVAX.INJECT' : javaxInjectVersion,
'JAVAX.JMS' : javaxJmsVersion,
'JAVAX.MAIL' : javaxMailVersion,
'JAVAX.PERSISTENCE' : javaxPersistenceVersion,
'JAVAX.RESOURCE' : javaxResourceVersion,
'JAVAX.SECURITY.AUTH' : javaxSecurityAuthMessageVersion,
'JAVAX.SECURITY.JACC' : javaxSecurityJaccVersion,
// TODO remove duplication 'JAVAX.SERVLET.VERSION' and 'JAVAX.SERVLET'
'JAVAX.SERVLET.VERSION' : javaxServletVersion,
'JAVAX.SERVLET' : javaxServletVersion,
'JAVAX.SERVLET.JSP' : javaxServletJspVersion,
'JSTL.API' : javaxServletJspJstlApiVersion,
'JSTL.IMPL' : javaxServletJspJstlImplOsgiVersion,
'JAVAX.TRANSACTION' : javaxTransactionVersion,
'JAVAX.VALIDATION' : javaxValidationVersion,
'JAVAX.WEBSOCKET' : javaxWebsocketVersion,
'JAVAX.WSDL' : javaxWsdlVersion,
'JAVAX.WS.RS' : javaxWsRsVersion,
'JAVAX.XML.RPC' : javaxXmlRpcVersion,
'JETTY.VERSION' : jettyVersion,
'P2.A.R.VERSION' : p2ArtifactRepositoryVersion,
'P2.CONSOLE.VERSION' : p2ConsoleVersion,
'P2.CORE.VERSION' : p2CoreVersion,
'P2.DIRECTOR.VERSION' : p2DirectorVersion,
'P2.ENGINE.VERSION' : p2EngineVersion,
'P2.GC.VERSION' : p2GarbageCollectorVersion,
'P2.JP.VERSION' : p2JarProcessorVersion,
'P2.METADATA.VERSION' : p2MetadataVersion,
'P2.M.R.VERSION' : p2MetadataRepositoryVersion,
'P2.PUBLISHER.VERSION' : p2PublisherVersion,
'P2.P.E.VERSION' : p2PublisherEclipseVersion,
'P2.REPOSITORY.VERSION' : p2RepositoryVersion,
'P2.T.E.VERSION' : p2TouchpointEclipseVersion,
'P2.T.N.VERSION' : p2TouchpointNativesVersion,
'P2.T.ECF.VERSION' : p2TransportEcfVersion,
'QUARTZ' : quartzVersion,
'WB.COMMON' : apacheOpenwebbeansVersion,
'WB.EE' : apacheOpenwebbeansEEVersion,
'WB.EJB' : apacheOpenwebbeansEEVersion,
'WB.IMPL' : apacheOpenwebbeansVersion,
'WB.SPI' : apacheOpenwebbeansVersion,
'WB.WEB' : apacheOpenwebbeansVersion,
'WB.JSF' : apacheOpenwebbeansVersion,
'WB.TOMCAT7' : apacheOpenwebbeansTomcat7Version,
'COMMOMS.BEANUTILS' : commonsBeanutilsVersion,
'COMMONS.CLI' : commonsCliVersion,
'COMMONS.COLLECTIONS' : commonsCollectionsVersion,
'COMMONS.DBCP' : commonsDbcpVersion,
'COMMONS.LANG' : commonsLangVersion,
'COMMONS.POOL' : commonsPoolVersion,
'BVAL' : apacheBvalVersion,
'G.CONNECTOR' : geronimoComponentsConnectorVersion,
'G.TRANSACTIONS' : geronimoComponentsTransactionVersion,
'G.MANAGEMENT' : geronimoSpecsJ2eeManagementVersion,
'G.OSGI.LOCATOR' : geronimoSpecsOsgiLocatorVersion,
'G.OSGI.REGISTRY' : geronimoSpecsOsgiRegistryVersion,
'CDI.API' : cdiApiVersion,
'OE.API' : apacheOpenejbVersion,
'OE.CORE' : apacheOpenejbCoreVersion,
'OE.JAVAAGENT' : apacheOpenejbVersion,
'OE.JEE' : apacheOpenejbVersion,
'OE.LOADER' : apacheOpenejbVersion,
'OE.JPA.INTEGRATION' : apacheOpenejbVersion,
'XB.ASM' : apacheXBeanAsmVersion,
'XB.BUNDLEUTILS' : apacheXBeanBundleutilsVersion,
'XB.FINDER' : apacheXBeanFinderVersion,
'XB.NAMING' : apacheXBeanNamingVersion,
'XB.REFLECT' : apacheXBeanReflectVersion,
'EL.ANTLR' : eclipsePersistenceAntlrVersion,
'EL.ASM' : eclipsePersistenceAsmVersion,
'EL.CORE' : eclipsePersistenceCoreVersion,
'EL.JPA' : eclipsePersistenceJpaVersion,
'EL.JPQL' : eclipsePersistenceJpaJpqlVersion,
'FACES.API' : glassfishJavaxFacesVersion,
'FACES.IMPL' : glassfishComSunFacesVersion,
'DERBY' : apacheDerbyVersion,
// used in documentation
'project.name' : 'Virgo',
'runtime.category' : 'EclipseRT',
'umbrella.product.name' : 'Virgo Runtime Environment',
'umbrella.product.name.short' : 'Virgo Runtime',
'tomcat.product.name' : 'Virgo Server for Apache Tomcat',
'tomcat.product.name.short' : 'VTS',
'jetty.product.name' : 'Virgo Jetty Server',
'jetty.product.name.short' : 'VJS',
'kernel.product.name' : 'Virgo Kernel',
'kernel.product.name.short' : 'VK',
'nano.product.name' : 'Virgo Nano',
'nano.product.name.short' : 'VN',
'nanoweb.product.name' : 'Virgo Nano Web',
'snaps.product.name' : 'Virgo Snaps',
'snaps.product.name.short' : 'VS',
'ebr' : 'SpringSource Enterprise Bundle Repository',
'p2repo' : "http://download.eclipse.org/virgo/updatesite/${version}".toString(),
'bundle.version' : "${version}".toString(),
]
}
configure(javaProjects + osgiProjects) {
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
compileJava {
options.encoding = 'utf-8'
options.fork = true
doFirst {
options.forkOptions.with {
executable = 'java'
jvmArgs = [
'-cp',
configurations.ecj.asPath,
'org.eclipse.jdt.internal.compiler.batch.Main',
'-warn:-unused'
]
}
}
}
compileTestJava {
options.encoding = 'utf-8'
options.fork = true
doFirst {
options.forkOptions.with {
executable = 'java'
jvmArgs = [
'-cp',
configurations.ecj.asPath,
'org.eclipse.jdt.internal.compiler.batch.Main',
'-warn:-unused'
]
}
}
}
test {
if (System.properties['ci.build'] == 'true') {
ignoreFailures = true
}
}
configurations { ecj {} }
dependencies {
ecj group: "org.eclipse.jdt.core.compiler", name: "ecj", version: ecjVersion
testCompile group: 'junit', name: 'junit', version: junitVersion, configuration: "compile", ext: "jar"
testRuntime group: 'org.eclipse.virgo.mirrored', name: "org.apache.commons.logging", version: commonsLoggingVersion, ext: "jar"
}
eclipse {
jdt {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
}
configure(aspectjProjects) {
configurations {
ajtools {
transitive = false
description = "AspectJ tools runtime"
}
}
apply plugin: AspectJPlugin
dependencies {
implementation "org.aspectj:aspectjrt:${aspectjVersion}"
ajtools "org.aspectj:aspectjtools:${aspectjVersion}"
}
}
configure(javaProjects + osgiProjects) {
assemble.doLast {
println '|--> Assembled Jar File: ' + jar.archivePath
if (System.properties['ci.build.signjars'] == 'true') {
println '|--> Normalize Jar File: ' + jar.archivePath
project.javaexec {
main = 'org.eclipse.equinox.internal.p2.jarprocessor.Main'
classpath Config.on(project).jarProcessorJar
args = [
'-repack',
jar.archivePath
]
}
println '|--> Signing Jar File: ' + jar.archivePath
exec {
workingDir jar.destinationDir
commandLine 'curl',
'-o',
jar.archivePath,
'-F',
"file=@${jar.archivePath}",
'--show-error',
'http://build.eclipse.org:31338/sign'
}
println '|--> Compress Jar File: ' + jar.archivePath
project.javaexec {
main = 'org.eclipse.equinox.internal.p2.jarprocessor.Main'
classpath Config.on(project).jarProcessorJar
args = [
'-pack',
jar.archivePath
]
}
} else {
println '|--> Skipping normalize/signing/compression of Jar File: ' + jar.archivePath
}
}
}
// FIXME Equinox migration - Investigate how to create Java + OSGi source bundles
println "FIXME Equinox migration - how to create Java + OSGi source bundles"
//configure(javaProjects + osgiProjects) {
// task sourcesJar(type: Jar, dependsOn: classes) {
// classifier = 'sources'
// from sourceSets.main.allSource
// }
//
// artifacts {
// archives sourcesJar
// }
//}
// FIXME Equinox migration - Investigate how to publish Java + OSGi bundles
println "FIXME Equinox migration - how to publish Java + OSGi bundles"
//configure(javaProjects + osgiProjects) {
// apply plugin: 'maven-publish'
// publishing {
// repositories {
// maven {
// name = "BuildEclipseOrg"
// url "/opt/public/rt/virgo/gradle/bundles"
// }
// }
// publications {
// virgo(MavenPublication) {
// groupId 'org.eclipse.virgo'
// from components.java
// artifact sourcesJar {
// classifier "sources"
// }
// }
// }
// }
//}
configure(javaProjects + osgiProjects + packagingProjects + project(":org.eclipse.virgo.site")) {
repositories {
mavenCentral()
ivy {
url "http://build.eclipse.org/rt/virgo/ivy/bundles/release/"
layout "pattern", { artifact "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" }
}
ivy {
url "http://build.eclipse.org/rt/virgo/ivy/bundles/milestone/"
layout "pattern", { artifact "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" }
}
}
}
configure(project("3rd-party")) {
apply plugin: "io.spring.dependency-management"
repositories {
mavenCentral()
// Gemini Web and Tomcat dependencies aren't at Maven Central
ivy {
url "https://build.eclipse.org/rt/virgo/ivy/bundles/release/"
layout "pattern", { artifact "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" }
}
}
dependencyManagement {
dependencies {
// 3rd party dependencies
dependency "org.apache.httpcomponents:httpcore:${httpcomponentsCoreVersion}"
dependency "org.apache.httpcomponents:httpclient:${httpcomponentsClientVersion}"
// testing
dependency 'junit:junit:4.12' // CQ4129 (PB CQ3480) 4.7
}
}
}
configure(javaProjects + osgiProjects) {
if (System.properties['ci.build'] == 'true' || System.properties['include.spotbugs'] == 'true') {
apply plugin: "com.github.spotbugs"
spotbugs {
toolVersion = '3.1.12'
ignoreFailures = true
effort = 'max'
showProgress = true
reportLevel = "high"
excludeFilter = file("$rootProject.projectDir/config/findbugs/excludeFilter.xml")
}
// only run 'spotbugsMain'
tasks['spotbugsTest'].enabled = false
}
}
configure(javaProjects + osgiProjects) {
if (System.properties['ci.build'] == 'true' || System.properties['include.jacoco'] == 'true') {
apply plugin: "jacoco"
jacoco { toolVersion = "0.8.1" }
}
}
configure(packagingProjects) {
configurations {
aspects { // visibility="private"
description = "Aspects to be woven"
}
nanoLib {
description = "Dependencies to be packaged in lib"
transitive = true
exclude module: "org.eclipse.osgi"
}
nanoLibEndorsed { description = "Dependencies to be packaged in endorsed" }
nanoLibPersistence {
transitive = false
description = "Dependencies to be packaged in lib/persistence"
}
nanoPickup {
transitive = false
description = "Dependencies to be packaged in pickup"
}
kernelPluginsExtras {
transitive = false
description = "Dependencies to be published without p2 into Kernel plugin directory"
}
repositoryExt {
transitive = false
description = "Dependencies to be packaged in repository/ext"
}
}
}
configure(osgiProjects) {
apply plugin: 'biz.aQute.bnd.builder'
jar.bndfile = "bundle.bnd"
jar.manifest.attributes(
'-classpath': sourceSets.main.output.classesDirs.asPath,
'Bundle-Vendor': 'Eclipse Virgo',
'Bundle-SymbolicName': project.name,
'-removeheaders': 'Bnd-LastModified,Created-By',
)
}
configure(aspectjProjects) {
configurations.compile.dependencies.each { dep ->
if (dep.hasProperty("dependencyProject")) {
println "dependent project: ${dep}"
iajcClasspath += ":" + dep.dependencyProject.buildDir + "/bundles/release/classes.jar"
} else {
println "other dependency: ${dep}"
}
}
configurations {
ajtools {
transitive = false
description = "AspectJ tools runtime"
}
aspectpath {
transitive = false
description = "Aspects are applied to types present in the project"
}
testAspectpath {
transitive = false
description = "Aspects are applied to tests present in the project"
}
}
dependencies {
compile "org.aspectj:aspectjrt:${project.aspectjVersion}"
ajtools "org.aspectj:aspectjtools:${project.aspectjVersion}"
}
apply plugin: AspectJPlugin
// Add nature and buildCommand
eclipse.project {
natures 'org.eclipse.ajdt.ui.ajnature'
buildCommand 'org.eclipse.ajdt.core.ajbuilder'
}
eclipse {
classpath {
file {
withXml { xmlProvider ->
def classpath = xmlProvider.asNode()
def xmlparser = new XmlParser()
configurations.aspectpath.dependencies.each { dep ->
if (dep.hasProperty("dependencyProject")) {
println "Name of project containing aspects to weave: " + dep.dependencyProject.name
classpath.children().findAll { it['@path'] == '/' + dep.dependencyProject.name }.each {
println "Adding ${it['@path']} to Aspect Path"
def attrs = xmlparser.createNode(it, 'attributes', [:])
xmlparser.createNode(attrs, 'attribute', [name: 'org.eclipse.ajdt.aspectpath', value: 'org.eclipse.ajdt.aspectpath']);
}
}
}
}
}
}
}
}
configure([
project(':util:org.eclipse.virgo.util.integrationtest'),
// project(':medic:org.eclipse.virgo.medic.integrationtest'),
]) {
dependencies {
// OSGi runtime
testRuntime group: "org.eclipse.virgo.mirrored", name: "org.eclipse.osgi", version: equinoxVersion, configuration: "compile", ext: "jar"
testCompile group: "org.eclipse.virgo.mirrored", name: "javax.inject", version: javaxInjectVersion, configuration: "compile", ext: "jar"
// PaxExam
testRuntime group: "org.slf4j", name: "slf4j-api", version: slf4jVersion
testCompile group: "org.ops4j.pax.exam", name: "pax-exam-junit4", version: paxExamJunit4Version
testRuntime group: "org.ops4j.pax.exam", name: "pax-exam-container-native", version: paxExamContainerNativeVersion
testRuntime group: "org.ops4j.pax.exam", name: "pax-exam-link-mvn", version: paxExamLinkMvnVersion
testRuntime group: "org.ops4j.pax.url", name: "pax-url-aether", version: paxUrlAetherVersion
testRuntime group: "org.ops4j.pax.url", name: "pax-url-aether", version: paxUrlAetherVersion
testRuntime group: "org.ops4j.pax.url", name: "pax-url-wrap", version: paxUrlWrapVersion
}
}