DATAKV-75
+ several improvements to the Gradle build
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -28,6 +28,10 @@ refSpec = copySpec {
|
||||
into ('reference/images') {
|
||||
from (imagesDir)
|
||||
}
|
||||
//expand(project.properties)
|
||||
filter { String line ->
|
||||
"[$line]"
|
||||
}
|
||||
}
|
||||
|
||||
task reference (type: Copy) {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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'
|
||||
62
maven.gradle
62
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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user