diff --git a/build.gradle b/build.gradle index b29381dbf..2546282d0 100644 --- a/build.gradle +++ b/build.gradle @@ -105,7 +105,9 @@ task wrapper(type: Wrapper) { } // Distribution tasks -task dist(type: Zip, group: "Distribute") { +task dist(type: Zip) { + description = "Generate the ZIP Distribution" + group = "Distribution" dependsOn subprojects*.tasks*.matching { task -> task.name == 'assemble' } evaluationDependsOn(':docs') @@ -129,8 +131,8 @@ task dist(type: Zip, group: "Distribute") { } } -task uploadDist(type: org.springframework.gradle.tasks.S3DistroUpload) { - description = "Upload Zip Distribution" +task uploadDist(type: org.springframework.gradle.tasks.S3DistroUpload, dependsOn: dist) { + description = "Upload the ZIP Distribution" group = "Distribution" archiveFile = dist.archivePath projectKey = 'DATAKV' diff --git a/docs/build.gradle b/docs/build.gradle index c032b3aa6..0c15eafc5 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -28,6 +28,10 @@ refSpec = copySpec { into ('reference/images') { from (imagesDir) } + //expand(project.properties) + filter { String line -> + "[$line]" + } } task reference (type: Copy) { diff --git a/docs/src/api/javadoc.options b/docs/src/api/javadoc.options index aa1eefc05..04964ca74 100644 --- a/docs/src/api/javadoc.options +++ b/docs/src/api/javadoc.options @@ -9,4 +9,5 @@ -group "Spring Data Riak Support" "org.springframework.data.keyvalue.riak*" -link http://static.springframework.org/spring/docs/3.0.x/javadoc-api -link http://download.oracle.com/javase/6/docs/api/ +-exclude org.springframework.data.keyvalue.redis.config diff --git a/gradle.properties b/gradle.properties index 56a447c92..f5a5999b1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,5 @@ mockitoVersion = 1.8.5 # -------------------- # Project wide version # -------------------- -springDataKeyValueVersion=1.0.0.BUILD-SNAPSHOT \ No newline at end of file +springDataKeyValueVersion=1.0.0.BUILD-SNAPSHOT +version = 'springDataKeyValueVersion' \ No newline at end of file diff --git a/maven.gradle b/maven.gradle index 8b3c2465b..996d1b693 100644 --- a/maven.gradle +++ b/maven.gradle @@ -1,14 +1,20 @@ apply plugin: 'maven' // Create a source jar for uploading -task sourceJar(type: Jar) { +task sourceJar(type: Jar, dependsOn: classes) { classifier = 'sources' - from sourceSets.main.java - from sourceSets.main.resources + from sourceSets.main.allSource +} + +// Create a javadoc jar for uploading +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir } artifacts { archives sourceJar + archives javadocJar } // Configuration for SpringSource s3 maven deployer @@ -67,13 +73,47 @@ uploadArchives { } } - deployer.pom.project { - licenses { - license { - name "The Apache Software License, Version 2.0" - url "http://www.apache.org/licenses/LICENSE-2.0.txt" - distribution "repo" + customizePom(deployer.pom) +} + +install { + customizePom(repositories.mavenInstaller.pom) +} + +def customizePom(pom) { + def optionalDeps = ['log4j','jsr250-api'] + + //pom.scopeMappings.addMapping(10, configurations.provided, 'provided') + pom.whenConfigured { p -> + // Remove test scope dependencies from published poms + p.dependencies = p.dependencies.findAll {it.scope != 'test'} + + // Flag optional deps + + p.dependencies.findAll { dep -> + optionalDeps.contains(dep.artifactId) || + dep.groupId.startsWith('org.slf4j') + }*.optional = true + + } + + pom.project { + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } } - } - } + + // similar to Spring's configuration + dependencies { + dependency { + artifactId = groupId = 'commons-logging' + scope = 'compile' + optional = 'true' + version = '1.1.1' + } + } + } } \ No newline at end of file