From 8137a8bcd05f8615525e2ff5f9adcfbb4e492c49 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Mon, 18 Jan 2010 02:02:28 +0000 Subject: [PATCH] Enabled detection of release builds and s3 maven deployment capability to gradle build. The s3 deployment requires an updated snapshot of the spring aws-maven dependency, as the old one was incompatible with changes in the latest version (1.0-beta6) of the Maven "wagon" api. --- build.gradle | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 28b6a99f0a..39b0056a66 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ import org.gradle.api.tasks.bundling.GradleManifest allprojects { version = '3.0.2.CI-SNAPSHOT' + releaseBuild = version.endsWith('RELEASE') group = 'org.springframework.security' repositories { @@ -48,25 +49,35 @@ subprojects { } test { compileClasspath = compileClasspath + configurations.provided + runtimeClasspath = runtimeClasspath + configurations.provided } } test { - options.fork(forkMode: ForkMode.ONCE, jvmArgs: ["-ea", '-Xms128m', '-Xmx1g', '-XX:MaxPermSize=128m', '-XX:+HeapDumpOnOutOfMemoryError']) + options.fork(forkMode: ForkMode.ONCE, jvmArgs: ["-ea", '-Xms128m', '-Xmx500m', '-XX:MaxPermSize=128m', '-XX:+HeapDumpOnOutOfMemoryError']) } - compileJava.doLast { + task bundlor (dependsOn: compileJava) << { + if (!dependsOnTaskDidWork()) { + return + } ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath) File template = new File(projectDir, 'template.mf') + mkdir(buildDir, 'bundlor') if (template.exists()) { - ant.bundlor(inputPath: "$buildDir/classes", outputPath: "$buildDir/classes", manifestTemplatePath: "$projectDir/template.mf") { + ant.bundlor(inputPath: "$buildDir/classes/main", outputPath: "$buildDir/bundlor", manifestTemplatePath: template) { 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())) + jar.manifest = new GradleManifest(new Manifest(new File("$buildDir/bundlor/META-INF/MANIFEST.MF").newInputStream())) } } + + jar.dependsOn bundlor + + compileJava.doLast { + } } subprojects { @@ -78,20 +89,35 @@ subprojects { from sourceSets.main.java } + configurations { + deployerJars + } + artifacts { archives sourceJar } - def deployer = null + dependencies { + deployerJars "org.springframework.build.aws:org.springframework.build.aws.maven:2.0.1.BUILD-SNAPSHOT" + } + uploadArchives { - repositories { - deployer = mavenDeployer { - repository(url: "file://localhost/${rootProject.projectDir}/pomRepo/") - snapshotRepository(url: "file://localhost/${rootProject.projectDir}/snapshotRepo/") + repositories.mavenDeployer { + configuration = configurations.deployerJars + if (releaseBuild) { + // "mavenSyncRepoDir" should be set in properties + repository(url: mavenSyncRepoDir) + } else { + s3credentials = [userName: s3AccessKey, passphrase: s3SecretAccessKey] + repository(url: "s3://maven.springframework.org/milestone") { + authentication(s3credentials) + } + snapshotRepository(url: "s3://maven.springframework.org/snapshot") { + authentication(s3credentials) + } } } } - installer = install.repositories.mavenInstaller conf2ScopeMappings.addMapping(1, configurations.provided, "provided") }