DATAKV-75

+ several improvements to the Gradle build
This commit is contained in:
Costin Leau
2011-07-04 18:14:32 +03:00
parent 6e023f5df0
commit 953faa11db
5 changed files with 63 additions and 15 deletions

View File

@@ -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'

View File

@@ -28,6 +28,10 @@ refSpec = copySpec {
into ('reference/images') {
from (imagesDir)
}
//expand(project.properties)
filter { String line ->
"[$line]"
}
}
task reference (type: Copy) {

View File

@@ -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

View File

@@ -16,4 +16,5 @@ mockitoVersion = 1.8.5
# --------------------
# Project wide version
# --------------------
springDataKeyValueVersion=1.0.0.BUILD-SNAPSHOT
springDataKeyValueVersion=1.0.0.BUILD-SNAPSHOT
version = 'springDataKeyValueVersion'

View File

@@ -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'
}
}
}
}