| import org.apache.tools.ant.filters.ReplaceTokens |
| import virgobuild.Config |
| |
| apply plugin: virgobuild.VirgoToolsPlugin |
| |
| buildscript { |
| repositories { |
| mavenLocal() |
| maven { |
| url "https://plugins.gradle.org/m2/" |
| } |
| maven { |
| url "http://build.eclipse.org/rt/virgo/gradle/bundles" |
| } |
| if (System.properties['local.build'] == 'true') { |
| jcenter() |
| maven { url 'https://repo.spring.io/libs-release' } |
| } |
| } |
| dependencies { |
| classpath "org.eclipse.virgo.bundlor:org.eclipse.virgo.bundlor.gradle.plugin:1.1.3.M01" |
| if (System.properties['include.docs'] == 'true') { |
| // docbook processing |
| classpath 'net.sf.docbook:docbook-xsl:1.78.1:resources@zip' |
| // TODO use docbook 4.5 to reduce buildtime? 4.5 DTDs are not available locally? |
| // TODO alternatively switch to docbook 5.0? |
| classpath 'net.sf.docbook:docbook-xml:5.0:xsd-resources@zip' |
| classpath 'net.sf.docbook:docbook-xsl-saxon:1.0.0' |
| classpath 'org.apache.xerces:resolver:2.9.1' |
| classpath 'org.apache.xerces:xercesImpl:2.9.1' |
| classpath 'saxon:saxon:6.5.3' |
| classpath 'net.sf.xslthl:xslthl:2.0.1' |
| classpath 'org.apache.xmlgraphics:fop:0.95-1@jar' |
| classpath 'org.apache.xmlgraphics:xmlgraphics-commons:1.3' |
| classpath 'org.apache.xmlgraphics:batik-bridge:1.7@jar' |
| classpath 'org.apache.xmlgraphics:batik-util:1.7@jar' |
| classpath 'org.apache.xmlgraphics:batik-css:1.7@jar' |
| classpath 'org.apache.xmlgraphics:batik-dom:1.7' |
| classpath 'org.apache.xmlgraphics:batik-svg-dom:1.7@jar' |
| classpath 'org.apache.avalon.framework:avalon-framework-api:4.3.1' |
| } |
| } |
| } |
| |
| def timestamp = new Date().format('yyyyMMddHHmmss', TimeZone.getTimeZone('GMT')) |
| |
| defaultTasks 'clean', 'jar', 'build', 'distZip' |
| |
| def Properties versions = new Properties() |
| versions.load(new FileInputStream(project.rootProject.file('gradle.properties'))) |
| project.ext.props = versions |
| |
| allprojects() { |
| if (System.properties['ci.build'] == 'true') { |
| version = '3.8.0.D-' + timestamp |
| } else { |
| version = '3.8.0.BUILD-SNAPSHOT' |
| } |
| } |
| |
| ext.appsProjects = [ |
| project(':apps:org.eclipse.virgo.apps.repository.core'), |
| project(':apps:org.eclipse.virgo.apps.repository.web'), |
| project(':apps:org.eclipse.virgo.apps.splash'), |
| ] |
| |
| ext.kernelProjects = [ |
| project(':kernel:org.eclipse.virgo.kernel.agent.dm'), |
| project(':kernel:org.eclipse.virgo.kernel.artifact'), |
| project(':kernel:org.eclipse.virgo.kernel.deployer'), |
| project(':kernel:org.eclipse.virgo.kernel.deployer.dm'), |
| project(':kernel:org.eclipse.virgo.kernel.dmfragment'), |
| project(':kernel:org.eclipse.virgo.kernel.equinox.extensions'), |
| project(':kernel:org.eclipse.virgo.kernel.kerneldmfragment'), |
| project(':kernel:org.eclipse.virgo.kernel.model'), |
| project(':kernel:org.eclipse.virgo.kernel.osgi'), |
| project(':kernel:org.eclipse.virgo.kernel.services'), |
| project(':kernel:org.eclipse.virgo.kernel.userregion'), |
| project(':kernel:org.eclipse.virgo.kernel.userregionfactory'), |
| project(':kernel:org.eclipse.virgo.management.console'), |
| project(':kernel:org.eclipse.virgo.management.fragment'), |
| project(':kernel:org.eclipse.virgo.shell.command'), |
| ] |
| |
| ext.medicProjects = [ |
| 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'), |
| ] |
| |
| ext.nanoProjects = [ |
| 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'), |
| ] |
| |
| ext.repositoryProjects = [ |
| project(':repository:org.eclipse.virgo.repository'), |
| ] |
| |
| ext.testUtils = [ |
| project(':test:org.eclipse.virgo.test.stubs'), |
| project(':medic:org.eclipse.virgo.medic.test'), |
| project(':kernel:org.eclipse.virgo.kernel.stubs'), |
| project(':test:org.eclipse.virgo.test.tools'), |
| ] |
| |
| ext.utilProjects = [ |
| 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'), |
| ] |
| |
| ext.webProjects = [ |
| project(':web:org.eclipse.virgo.web.core'), |
| project(':web:org.eclipse.virgo.web.dm'), |
| project(':web:org.eclipse.virgo.web.tomcat.support'), |
| 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'), |
| ] |
| |
| ext.integrationTestProjects = [ |
| project(':test:org.eclipse.virgo.test.launcher'), |
| project(':test:org.eclipse.virgo.test.framework'), |
| |
| project(':util:org.eclipse.virgo.util.integrationtest'), |
| // project(':medic:org.eclipse.virgo.medic.integrationtest'), |
| ] |
| |
| ext.smokeTestProjects = [ |
| project(':packaging:nano:org.eclipse.virgo.nano.smoketest'), |
| project(':packaging:kernel:org.eclipse.virgo.kernel.smoketest'), |
| project(':packaging:jetty-server:org.eclipse.virgo.jetty.smoketest'), |
| project(':packaging:tomcat-server:org.eclipse.virgo.tomcat.smoketest'), |
| ] |
| |
| ext.javaProjects = ext.utilProjects + ext.medicProjects + ext.repositoryProjects + ext.nanoProjects + ext.kernelProjects + ext.webProjects + ext.appsProjects + ext.testUtils + ext.integrationTestProjects + smokeTestProjects + |
| [ |
| project(':nano:org.eclipse.virgo.nano.authentication'), |
| project(':nano:org.eclipse.virgo.nano.shutdown'), |
| ] |
| |
| if (System.properties['local.build'] == 'true') { |
| ext.javaProjects += [ |
| // project(':system-tests:org.eclipse.virgo.server.svt'), |
| // project(':performance-tests:org.eclipse.virgo.qa.performance'), |
| ] |
| } |
| |
| ext.aspectjProjects = [ |
| // these projects contain aspects |
| project(':util:org.eclipse.virgo.util.jmx'), |
| project(':test:org.eclipse.virgo.test.stubs'), |
| project(':medic:org.eclipse.virgo.medic'), |
| project(':nano:org.eclipse.virgo.nano.core'), |
| // these projects are woven |
| project(':kernel:org.eclipse.virgo.kernel.model'), |
| project(':kernel:org.eclipse.virgo.kernel.osgi'), |
| ] |
| |
| if (System.properties['local.build'] == 'true') { |
| if (System.properties['weaving.enabled'] == 'true') { |
| ext.aspectjProjects + [ |
| project(':apps:org.eclipse.virgo.apps.repository.core'), |
| project(':kernel:org.eclipse.virgo.kernel.deployer'), |
| project(':kernel:org.eclipse.virgo.kernel.deployer.dm'), |
| project(':kernel:org.eclipse.virgo.kernel.dmfragment'), |
| project(':kernel:org.eclipse.virgo.shell.command'), |
| project(':repository:org.eclipse.virgo.repository'), |
| project(':web:org.eclipse.virgo.web.core'), |
| project(':web:org.eclipse.virgo.web.dm'), |
| project(':web:org.eclipse.virgo.web.tomcat.support'), |
| ] |
| } |
| } |
| |
| /* |
| TODO - What about these modules? Do they have AspectJ nature in Eclipse? |
| aspectpath project(':nano:org.eclipse.virgo.nano.deployer.api') |
| aspectpath project(':nano:org.eclipse.virgo.nano.deployer.hot') |
| aspectpath project(':kernel:org.eclipse.virgo.kernel.services') |
| */ |
| |
| ext.packagingProjects = [ |
| project(':packaging:nano'), |
| project(':packaging:kernel'), |
| project(':packaging:jetty-server'), |
| 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, |
| 'RAP.RWT.VERSION' : rapRwtVersion, |
| 'RAP.RWT.OSGI.VERSION' : rapRwtOsgiVersion, |
| 'RAP.JFACE.VERSION' : rapJfaceVersion, |
| 'RAP.JFACE.DATABINDING.VERSION': rapJfaceDatabindingVersion, |
| |
| '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 + aspectjProjects) { |
| |
| 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(ext.utilProjects + ext.medicProjects + ext.repositoryProjects + ext.nanoProjects + ext.kernelProjects + ext.webProjects + ext.appsProjects) { |
| 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 |
| } |
| } |
| } |
| |
| configure(javaProjects) { |
| task sourcesJar(type: Jar, dependsOn: classes) { |
| classifier = 'sources' |
| from sourceSets.main.allSource |
| } |
| |
| artifacts { |
| archives sourcesJar |
| } |
| } |
| |
| configure(javaProjects) { |
| 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 + aspectjProjects + 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(javaProjects) { |
| if (System.properties['ci.build'] == 'true' || System.properties['include.findbugs'] == 'true') { |
| apply plugin: 'findbugs' |
| |
| findbugs { |
| toolVersion = "3.0.1" |
| sourceSets = [sourceSets.main] |
| ignoreFailures = true |
| effort = "max" |
| reportLevel = "high" |
| excludeFilter = file("$rootProject.projectDir/config/findbugs/excludeFilter.xml") |
| } |
| } |
| } |
| |
| configure(javaProjects) { |
| 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" |
| } |
| } |
| } |
| |
| ext.wabProjects = [ |
| project(':apps:org.eclipse.virgo.apps.splash'), |
| project(':kernel:org.eclipse.virgo.management.console'), |
| ] |
| |
| configure(utilProjects + medicProjects + repositoryProjects + nanoProjects + kernelProjects + webProjects + appsProjects) { |
| |
| apply plugin: 'org.eclipse.virgo.bundlor' |
| |
| task('addProjectVersionToGradlePropertiesTask', type: Copy) { |
| ext.outputDir = new File(buildDir, 'bundlor-properties') |
| inputs.file project.rootProject.file('gradle.properties') |
| outputs.dir ext.outputDir |
| from project.rootProject.file('gradle.properties') |
| into ext.outputDir |
| filter(ReplaceTokens, tokens: [ |
| 'VIRGO.VERSION': version, |
| ]) |
| } |
| |
| task('mergeClassesAndResources', type: Copy, dependsOn: 'compileJava') { |
| ext.bundlorInputPath = new File(buildDir, 'bundlor-inputPath') |
| inputs.file sourceSets.main.output.classesDir |
| inputs.file sourceSets.main.resources |
| outputs.dir ext.bundlorInputPath |
| from sourceSets.main.output.classesDir |
| from sourceSets.main.resources |
| into ext.bundlorInputPath |
| } |
| |
| project.tasks.'bundlor'.dependsOn('addProjectVersionToGradlePropertiesTask', 'mergeClassesAndResources') |
| |
| bundlor { |
| ext.bundlorInputPath = new File(buildDir, 'bundlor-inputPath') |
| project.tasks['bundlor'].inputs.file ext.bundlorInputPath |
| manifestTemplatePath = "template.mf" |
| propertiesPath = new File("${project.buildDir}/bundlor-properties/gradle.properties") |
| inputPath = ext.bundlorInputPath |
| failOnWarnings = false |
| } |
| } |
| |
| configure(wabProjects) { |
| apply plugin: 'war' |
| |
| war.dependsOn('bundlor') |
| |
| war { |
| extension = 'jar' |
| rootSpec.exclude("**/*.jar") |
| manifest = project.manifest { from 'build/bundlor/META-INF/MANIFEST.MF' } |
| } |
| } |
| |
| 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: aspectj.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(testUtils) { |
| dependencies { |
| // changing junit dependency to configuration compile - this is a test util project based on JUnit :) |
| compile group: 'junit', name: 'junit', version: junitVersion |
| } |
| } |
| |
| configure(integrationTestProjects) { |
| 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 |
| } |
| } |
| |
| configure(smokeTestProjects) { |
| sourceSets { |
| smokeTest { |
| java.srcDir file('src/smokeTest/java') |
| resources.srcDir file('src/smokeTest/resources') |
| } |
| } |
| |
| task smokeTest(type: Test) { |
| testClassesDir = sourceSets.smokeTest.output.classesDir |
| classpath = sourceSets.smokeTest.runtimeClasspath |
| } |
| |
| dependencies { |
| testCompile project(':test:org.eclipse.virgo.test.tools') |
| testCompile project(':util:org.eclipse.virgo.util.io') |
| |
| testRuntime group: "org.apache.httpcomponents", name: "httpcore", version: httpcomponentsCoreVersion |
| testRuntime group: "org.apache.httpcomponents", name: "httpclient", version: httpcomponentsClientVersion |
| |
| smokeTestCompile sourceSets.main.output |
| smokeTestCompile configurations.testCompile |
| smokeTestCompile sourceSets.test.output |
| smokeTestRuntime configurations.testRuntime |
| } |
| } |
| |
| task wrapper(type: Wrapper) { |
| description 'Creates a local Gradle Wrapper' |
| group = 'Build Setup' |
| gradleVersion = '3.5' // CQ 13634 |
| } |