From 3a8daa1bf4fc22c88028598de713b87558aa261e Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Wed, 13 Jan 2010 00:44:05 +0000 Subject: [PATCH] Gradle build improvements. Added generation of source archives and trial support for maven deployment and pom generation, with "provided" configuration mapped to "provided" scope. --- build.gradle | 47 +++++++++++++++++++++++++++++++++-------------- web/web.gradle | 9 +++++---- 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/build.gradle b/build.gradle index 85fd2a1bf9..8b80ef4136 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,10 @@ import java.util.jar.Manifest import org.gradle.api.tasks.bundling.GradleManifest -VERSION = '3.0.1.CI-SNAPSHOT' - allprojects { + version = '3.0.1.CI-SNAPSHOT' + group = 'org.springframework.security' + repositories { mavenRepo name:'Local', urls:'file:///Users/luke/.m2/repository' mavenCentral() @@ -13,10 +14,6 @@ allprojects { subprojects { apply id: 'java' - apply id: 'maven' - - group = 'org.springframework.security' - version = VERSION springVersion = '3.0.0.RELEASE' springLdapVersion = '1.3.0.RELEASE' @@ -25,10 +22,6 @@ subprojects { apacheDsVersion = '1.5.5' jstlVersion = '1.1.2' -/* dependencyReport { - renderer = new GraphvizReportRenderer() - }*/ - configurations { bundlor provided @@ -66,13 +59,39 @@ subprojects { 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}") + 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())) + jar.manifest = new GradleManifest(new Manifest(new File("$buildDir/classes/META-INF/MANIFEST.MF").newInputStream())) } } } +subprojects { + apply id: 'maven' + + // Create a source jar for uploading + task sourceJar(type: Jar) { + classifier = 'sources' + from sourceSets.main.java + } + + artifacts { + archives sourceJar + } + + def deployer = null + uploadArchives { + repositories { + deployer = mavenDeployer { + repository(url: "file://localhost/${rootProject.projectDir}/pomRepo/") + snapshotRepository(url: "file://localhost/${rootProject.projectDir}/snapshotRepo/") + } + } + } + + installer = install.repositories.mavenInstaller + conf2ScopeMappings.addMapping(1, configurations.provided, "provided") +} diff --git a/web/web.gradle b/web/web.gradle index 3fed485c78..ef8b061dfa 100644 --- a/web/web.gradle +++ b/web/web.gradle @@ -3,9 +3,8 @@ dependencies { compile project(':spring-security-core'), 'aopalliance:aopalliance:1.0', - 'javax.servlet:servlet-api:2.5', - 'org.aspectj:aspectjweaver:1.6.5', - "org.springframework:spring-aop:$springVersion", + "org.aspectj:aspectjweaver:$aspectjVersion", + "org.springframework:spring-aop:$springVersion", "org.springframework:spring-core:$springVersion", "org.springframework:spring-beans:$springVersion", "org.springframework:spring-context:$springVersion", @@ -14,6 +13,8 @@ dependencies { "org.springframework:spring-tx:$springVersion", "org.springframework:spring-web:$springVersion", "org.springframework:spring-test:$springVersion" - + + provided 'javax.servlet:servlet-api:2.5' + testCompile 'commons-codec:commons-codec:1.3' }