Added bundlor and maven support to gradle build

This commit is contained in:
Luke Taylor 2010-01-12 00:35:20 +00:00
parent fa42d9d5ec
commit d900829921
1 changed files with 24 additions and 2 deletions

View File

@ -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()))
}
}
}