| import org.apache.tools.ant.filters.ReplaceTokens |
| |
| import static virgobuild.VirgoToolsPlugin.DOWNLOAD_VIRGO_BUILD_TOOLS_TASK_NAME |
| import static virgobuild.VirgoToolsPlugin.installProduct |
| import static virgobuild.VirgoToolsPlugin.publishProduct |
| |
| import virgobuild.Config |
| |
| apply plugin: 'distribution' |
| |
| distributions { |
| main { |
| baseName = 'virgo-kernel' |
| contents { |
| from ( 'src/main/filtered' ) { |
| include ( '**/*.properties' ) |
| include ( '**/.version' ) |
| filter(ReplaceTokens, tokens: tokenMap) // tokens are used in e.g. oev.kernel.userregion.properties |
| } |
| from ( 'src/main/filtered' ) { |
| include ( 'bin/*.sh' ) |
| fileMode 0755 |
| } |
| from ( 'src/main/filtered' ) { |
| include ( '**/*.plan' ) |
| filter(ReplaceTokens, tokens: tokenMap) |
| } |
| from ( "${buildDir}/VK/kernel/" ) { exclude ( 'Eclipse.app' ) } |
| from ( "${buildDir}/common_resources/" ) |
| } |
| } |
| } |
| |
| task ('assembleKernel', dependsOn: [ |
| 'installProductKernel', |
| 'packageResourcesAndProducts' |
| ]) { |
| installDist.dependsOn(['assembleKernel']) |
| distZip.dependsOn(['assembleKernel']) |
| } |
| |
| task ('packageResourcesAndProducts', dependsOn: [ |
| ':kernel:org.eclipse.virgo.kernel.equinox.extensions:jar', |
| ':kernel:org.eclipse.virgo.management.console:war', |
| ':nano:org.eclipse.virgo.nano.authentication:jar', |
| ':nano:org.eclipse.virgo.nano.shutdown:jar', |
| ':util:org.eclipse.virgo.util.env:jar', |
| ]) { |
| doLast { |
| packageConfiguration('lib', configurations.nanoLib, file("${buildDir}/common_resources/lib/")) |
| packageConfiguration('libPersistence', configurations.nanoLibPersistence, file("${buildDir}/common_resources/lib/persistence/")) |
| packageConfiguration('libEndorsed', configurations.nanoLibEndorsed, file("${buildDir}/common_resources/lib/endorsed/")) |
| packageConfiguration('pluginsExtras', configurations.kernelPluginsExtras, file("${buildDir}/common_resources/plugins")) |
| packageConfiguration('repositoryExt', configurations.repositoryExt, file("${buildDir}/common_resources/repository/ext")) |
| packageConfiguration('pickup', configurations.nanoPickup, file("${buildDir}/common_resources/pickup/")) |
| } |
| } |
| |
| task ('publishKernel', dependsOn: [ |
| ':org.eclipse.virgo.site:publishBase', |
| ':org.eclipse.virgo.site:publishKernelBase', |
| ]) { |
| description = "Publishes a product to a p2 repository. The publishing uses ANY environment configurations." |
| |
| def product = 'kernel' |
| def productFileLocation = file("${projectDir}/publish_resources/products/${product}/${product}.product") |
| def javaProfileLocation = file("${projectDir}/src/main/dist/configuration/java-server.profile") |
| |
| doLast() { publishProduct(project, productFileLocation, javaProfileLocation) } |
| } |
| |
| task ('installProductKernel', dependsOn: ['publishKernel',]) { |
| |
| description = "Installs a Virgo product to a desired destination. Default profile(roaming) is VIRGOProfile, the environment cofigurations are ANY." |
| |
| def product = 'kernel' |
| def shortProduct = 'VK' |
| def destinationDir = file("${buildDir}/${shortProduct}/${product}") |
| def productIu = "${product}.product" |
| |
| doLast() { installProduct(project, productIu, destinationDir) } |
| } |