From 627dd20e9e5dba5fc63b820071fbee12c0e3016b Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Thu, 21 Apr 2011 15:17:26 +0300 Subject: [PATCH] + another gradle update + fixed the dist/maven problem --- build.gradle | 35 ++++++++++++++++++++++++++---- docs/build.gradle | 15 +++++++------ gradle.properties | 7 +++--- dist.gradle => maven.gradle | 43 ++++++------------------------------- 4 files changed, 48 insertions(+), 52 deletions(-) rename dist.gradle => maven.gradle (70%) diff --git a/build.gradle b/build.gradle index 025d7859c..3e04679b0 100644 --- a/build.gradle +++ b/build.gradle @@ -51,8 +51,8 @@ allprojects { } } -javaprojects = subprojects.findAll { project -> - project.path.startsWith(':spring-data-') +javaprojects = subprojects.findAll { + project -> project.path.startsWith(':spring-data-') } configure(javaprojects) { @@ -88,9 +88,9 @@ configure(javaprojects) { testCompile "org.mockito:mockito-all:$mockitoVersion" } - sourceSets.main.classesDir = new File(buildDir, "classes/" + project.name.substring("spring-data".length() + 1)) + apply from: "$rootDir/maven.gradle" + //sourceSets.main.classesDir = new File(buildDir, "classes/" + project.name.substring("spring-data".length() + 1)) - apply from: "$rootDir/dist.gradle" } ideaProject { @@ -101,4 +101,31 @@ ideaProject { task wrapper(type: Wrapper) { gradleVersion = '0.9.2' +} + +// Distribution tasks +task dist(type: Zip) { + dependsOn subprojects*.tasks*.matching { task -> task.name == 'assemble' } + + evaluationDependsOn(':docs') + + def zipRootDir = "${project.name}-$version" + into(zipRootDir) { + from('$rootDir/docs/src/info') { + include '*.txt' + } + into('dist') { + from javaprojects.collect {project -> project.libsDir } + } + } + doLast { + ant.checksum(file: archivePath, algorithm: 'SHA1', fileext: '.sha1') + } +} + +task uploadDist(type: org.springframework.gradle.tasks.S3DistroUpload) { + description = "Upload Zip Distribution" + archiveFile = dist.archivePath + projectKey = 'DATAKV' + projectName = 'Spring Data Key Value' } \ No newline at end of file diff --git a/docs/build.gradle b/docs/build.gradle index db5ad0209..bc893550a 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -12,12 +12,12 @@ docbookHtmlSingle.stylesheet = new File(projectDir, 'docs/src/reference/resource [docbookHtml, docbookFoPdf, docbookHtmlSingle]*.sourceFileName = 'index.xml' [docbookHtml, docbookFoPdf, docbookHtmlSingle]*.sourceDirectory = new File(projectDir, 'docs/src/reference/docbook') -docbookHtml.stylesheet = new File(projectDir, 'docs/src/reference/resources/xsl/html-custom.xsl') -docbookHtmlSingle.stylesheet = new File(projectDir, 'docs/src/reference/resources/xsl/html-single-custom.xsl') -docbookFoPdf.stylesheet = new File(projectDir, 'docs/src/reference/resources/xsl/pdf-custom.xsl') -def imagesDir = new File(projectDir, 'docs/src/reference/resources/images'); -// docbookFoPdf.admonGraphicsPath = "${imagesDir}/" -docbookFoPdf.imgSrcPath = "${projectDir}/docs/reference/resources/" +docbookHtml.stylesheet = new File(projectDir, 'src/reference/resources/xsl/html-custom.xsl') +docbookHtmlSingle.stylesheet = new File(projectDir, 'src/reference/resources/xsl/html-single-custom.xsl') +docbookFoPdf.stylesheet = new File(projectDir, 'src/reference/resources/xsl/pdf-custom.xsl') +def imagesDir = new File(projectDir, 'src/reference/resources/images'); +docbookFoPdf.admonGraphicsPath = "${imagesDir}/" +docbookFoPdf.imgSrcPath = "${imagesDir}" spec = copySpec { into ('reference') { @@ -96,8 +96,9 @@ task docSiteLogin(type: org.springframework.gradle.tasks.Login) { } // upload task -task uploadApidocs(type: org.springframework.gradle.tasks.ScpUpload) { +task uploadApi(type: org.springframework.gradle.tasks.ScpUpload) { dependsOn api + description = "Upload API Distribution" baseName = "${rootProject.name}" appendix = 'apidocs' remoteDir = '.' diff --git a/gradle.properties b/gradle.properties index 5a35877ca..56a447c92 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,8 +13,7 @@ junitVersion = 4.8.1 mockitoVersion = 1.8.5 -# ------------------------------------------------------------------------------ -# version to be applied to all projects in this multi-project build. this is -# the one and only location version changes need to be made. -# ------------------------------------------------------------------------------ +# -------------------- +# Project wide version +# -------------------- springDataKeyValueVersion=1.0.0.BUILD-SNAPSHOT \ No newline at end of file diff --git a/dist.gradle b/maven.gradle similarity index 70% rename from dist.gradle rename to maven.gradle index 1c7c1e27f..20b78ce25 100644 --- a/dist.gradle +++ b/maven.gradle @@ -1,17 +1,5 @@ apply plugin: 'maven' -// Distro zip -// SpringSource s3 maven deployer -configurations { - antaws -} - -dependencies { - antaws "org.springframework.build:org.springframework.build.aws.ant:3.0.3.RELEASE", - "net.java.dev.jets3t:jets3t:0.6.1" -} - - // Create a source jar for uploading task sourceJar(type: Jar) { classifier = 'sources' @@ -22,32 +10,14 @@ artifacts { archives sourceJar } -task dist(type: Zip) { - dependsOn subprojects*.tasks*.matching { task -> task.name == 'assemble' } - - evaluationDependsOn(':docs') - - def zipRootDir = "${project.name}-$version" - into(zipRootDir) { - from(rootDir/docs/src/info) { - include '*.txt' - } - into('dist') { - from javaProjects.collect {project -> project.libsDir } - } - } - doLast { - ant.checksum(file: archivePath, algorithm: 'SHA1', fileext: '.sha1') - } +// Configuration for SpringSource s3 maven deployer +configurations { + deployerJars } - -task uploadDist(type: org.springframework.gradle.tasks.S3DistroUpload) { - archiveFile = dist.archivePath - projectKey = 'DATAKV' - projectName = 'Spring Data Key Value' +dependencies { + deployerJars "org.springframework.build.aws:org.springframework.build.aws.maven:3.0.0.RELEASE" } - // Remove the archive configuration from the runtime configuration, so that anything added to archives // (such as the source jar) is no longer included in the runtime classpath configurations.default.extendsFrom = [configurations.runtime] as Set @@ -59,7 +29,6 @@ gradle.taskGraph.whenReady {graph -> // check properties defined and fail early s3AccessKey s3SecretAccessKey - mavenSyncRepoDir } } @@ -94,7 +63,7 @@ uploadArchives { } } - pom.project { + deployer.pom.project { licenses { license { name "The Apache Software License, Version 2.0"