mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-01 10:59:16 +00:00
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.
This commit is contained in:
parent
a5dde8b28f
commit
8137a8bcd0
46
build.gradle
46
build.gradle
@ -3,6 +3,7 @@ import org.gradle.api.tasks.bundling.GradleManifest
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
version = '3.0.2.CI-SNAPSHOT'
|
version = '3.0.2.CI-SNAPSHOT'
|
||||||
|
releaseBuild = version.endsWith('RELEASE')
|
||||||
group = 'org.springframework.security'
|
group = 'org.springframework.security'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@ -48,25 +49,35 @@ subprojects {
|
|||||||
}
|
}
|
||||||
test {
|
test {
|
||||||
compileClasspath = compileClasspath + configurations.provided
|
compileClasspath = compileClasspath + configurations.provided
|
||||||
|
runtimeClasspath = runtimeClasspath + configurations.provided
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
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)
|
ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath)
|
||||||
File template = new File(projectDir, 'template.mf')
|
File template = new File(projectDir, 'template.mf')
|
||||||
|
mkdir(buildDir, 'bundlor')
|
||||||
if (template.exists()) {
|
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: 'version', value: "$version")
|
||||||
property(name: 'spring.version', value: "$springVersion")
|
property(name: 'spring.version', value: "$springVersion")
|
||||||
}
|
}
|
||||||
// See GRADLE-395 for support for using an existing manifest
|
// 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 {
|
subprojects {
|
||||||
@ -78,20 +89,35 @@ subprojects {
|
|||||||
from sourceSets.main.java
|
from sourceSets.main.java
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
deployerJars
|
||||||
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives sourceJar
|
archives sourceJar
|
||||||
}
|
}
|
||||||
|
|
||||||
def deployer = null
|
dependencies {
|
||||||
|
deployerJars "org.springframework.build.aws:org.springframework.build.aws.maven:2.0.1.BUILD-SNAPSHOT"
|
||||||
|
}
|
||||||
|
|
||||||
uploadArchives {
|
uploadArchives {
|
||||||
repositories {
|
repositories.mavenDeployer {
|
||||||
deployer = mavenDeployer {
|
configuration = configurations.deployerJars
|
||||||
repository(url: "file://localhost/${rootProject.projectDir}/pomRepo/")
|
if (releaseBuild) {
|
||||||
snapshotRepository(url: "file://localhost/${rootProject.projectDir}/snapshotRepo/")
|
// "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")
|
conf2ScopeMappings.addMapping(1, configurations.provided, "provided")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user