From d9008299215720c3771c6891e893b829c8866f92 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Tue, 12 Jan 2010 00:35:20 +0000 Subject: [PATCH] Added bundlor and maven support to gradle build --- build.gradle | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 5353503a97..85fd2a1bf9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,17 +1,22 @@ +import java.util.jar.Manifest +import org.gradle.api.tasks.bundling.GradleManifest -version = '3.0.0.CI-SNAPSHOT' +VERSION = '3.0.1.CI-SNAPSHOT' allprojects { repositories { - mavenRepo name:'localRepo', urls:'file:///Users/luke/.m2/repository' + mavenRepo name:'Local', urls:'file:///Users/luke/.m2/repository' mavenCentral() + mavenRepo name:'SpringSource Milestone Repo', urls:'http://repository.springsource.com/maven/bundles/milestone' } } subprojects { apply id: 'java' + apply id: 'maven' group = 'org.springframework.security' + version = VERSION springVersion = '3.0.0.RELEASE' springLdapVersion = '1.3.0.RELEASE' @@ -25,6 +30,7 @@ subprojects { }*/ configurations { + bundlor provided } @@ -38,6 +44,9 @@ subprojects { 'org.hamcrest:hamcrest-core:1.1', 'org.hamcrest:hamcrest-library:1.1', "org.springframework:spring-test:$springVersion" + bundlor 'com.springsource.bundlor:com.springsource.bundlor.ant:1.0.0.RC1', + 'com.springsource.bundlor:com.springsource.bundlor:1.0.0.RC1', + 'com.springsource.bundlor:com.springsource.bundlor.blint:1.0.0.RC1' } sourceSets { @@ -52,5 +61,18 @@ subprojects { test { options.fork(forkMode: ForkMode.ONCE, jvmArgs: ["-ea", '-Xms128m', '-Xmx1g', '-XX:MaxPermSize=128m', '-XX:+HeapDumpOnOutOfMemoryError']) } + + compileJava.doLast { + ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath) + File template = new File(projectDir, 'template.mf') + if (template.exists()) { + ant.bundlor(inputPath: "${buildDir}/classes", outputPath: "${buildDir}/classes", manifestTemplatePath: "${projectDir}/template.mf") { + property(name: 'version', value: "${version}") + property(name: 'spring.version', value: "${springVersion}") + } + // See GRADLE-395 for support for using an existing manifest + jar.manifest = new GradleManifest(new Manifest(new File("${buildDir}/classes/META-INF/MANIFEST.MF").newInputStream())) + } + } }