| import static org.gradle.api.tasks.wrapper.Wrapper.DistributionType |
| |
| buildscript { |
| repositories { |
| mavenCentral() |
| maven { |
| url "https://plugins.gradle.org/m2/" |
| } |
| maven { |
| url "http://build.eclipse.org/rt/virgo/gradle/bundles" |
| } |
| } |
| dependencies { |
| classpath "org.eclipse.virgo.bundlor:org.eclipse.virgo.bundlor.gradle.plugin:1.1.3.M01" |
| classpath "gradle.plugin.com.eclipsesource.dockerizor:dockerizor:0.9.1" |
| classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3' |
| } |
| } |
| |
| ext { |
| // Eclipse Mars.1 bundle from Maven Central provided by Tycho |
| equinoxVersion = "3.10.101.v20150820-1432" |
| // Eclipse Mars.1 bundle from Maven Central provided by Birt |
| osgiServicesVersion = "3.5.0.v20150519-2006" |
| |
| junitVersion = "4.12" |
| |
| virgoProjects = [ |
| project(':org.eclipse.virgo.samples.recipe.data.mongodb'), |
| ] |
| dockerProjects = subprojects.findAll { it.name.contains('-runtime') || it.name.contains('-app') } |
| } |
| |
| configure(virgoProjects + dockerProjects) { |
| repositories { |
| mavenCentral() |
| ivy { |
| url "http://build.eclipse.org/rt/virgo/ivy/bundles/release/" |
| layout "pattern", { artifact "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" } |
| } |
| } |
| } |
| |
| configure(virgoProjects) { |
| apply plugin: 'java' |
| apply plugin: 'idea' |
| apply plugin: 'eclipse' |
| apply plugin: 'eclipse-wtp' |
| |
| compileJava { |
| sourceCompatibility = 1.8 |
| targetCompatibility = 1.8 |
| options.encoding = 'UTF-8' |
| } |
| |
| compileTestJava { |
| sourceCompatibility = 1.8 |
| targetCompatibility = 1.8 |
| options.encoding = 'UTF-8' |
| } |
| |
| eclipse { |
| jdt { |
| sourceCompatibility = 1.8 |
| targetCompatibility = 1.8 |
| } |
| |
| project { |
| natures 'org.eclipse.virgo.ide.facet.core.bundlenature', 'org.eclipse.wst.common.project.facet.core.nature' |
| } |
| |
| wtp { |
| facet { |
| facets = [] |
| facet name: 'jst.java', version: '1.8' |
| facet name: 'org.eclipse.virgo.server.bundle', version: '1.0' |
| } |
| } |
| } |
| } |
| |
| configure(virgoProjects) { |
| 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 |
| } |
| |
| 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 = true |
| } |
| } |
| |
| configure(dockerProjects) { |
| // add the build task 'clean' |
| apply plugin: 'base' |
| |
| // add the build task 'dockerize' |
| apply plugin: 'com.eclipsesource.dockerizor' |
| |
| dockerizor { |
| maintainer = 'Florian Waibel <fwaibel@eclipsesource.com>' |
| |
| javaImage = 'openjdk:8u171-jre-alpine3.7' |
| |
| removeSplash = false |
| removeAdminConsole = false |
| } |
| |
| dockerize.dependsOn configurations.repositoryExt |
| dockerize.dependsOn configurations.repositoryUsr |
| } |
| |
| configure(rootProject) { |
| apply plugin: 'org.asciidoctor.gradle.asciidoctor' |
| |
| wrapper { |
| gradleVersion = '4.6' // CQ 16848 |
| distributionType = DistributionType.BIN |
| } |
| } |