updated build script
This commit is contained in:
66
build.gradle
66
build.gradle
@@ -10,7 +10,6 @@ buildscript {
|
||||
|
||||
description = 'Spring Data GemFire'
|
||||
group = 'org.springframework.data'
|
||||
version = "$springGemfireVersion"
|
||||
|
||||
repositories {
|
||||
maven { url "http://repo.springsource.org/libs-snapshot" }
|
||||
@@ -229,6 +228,71 @@ task wrapper(type: Wrapper) {
|
||||
gradleVersion = '1.0'
|
||||
}
|
||||
|
||||
def customizePom(def pom, def gradleProject) {
|
||||
pom.whenConfigured { generatedPom ->
|
||||
// respect 'optional' and 'provided' dependencies
|
||||
def deps = gradleProject.configurations.runtime.allDependencies
|
||||
def optionalDeps = deps.findAll { dep ->
|
||||
dep.asDynamicObject.hasProperty('optional') && dep.optional
|
||||
}
|
||||
def providedDeps = deps.findAll { dep ->
|
||||
dep.asDynamicObject.hasProperty('provided') && dep.provided
|
||||
}
|
||||
generatedPom.dependencies.each { mavenDep ->
|
||||
mavenDep.optional = optionalDeps.any { optionalDep ->
|
||||
optionalDep.group == mavenDep.groupId &&
|
||||
optionalDep.name == mavenDep.artifactId &&
|
||||
optionalDep.version == mavenDep.version
|
||||
}
|
||||
boolean isProvided = providedDeps.any { providedDep ->
|
||||
providedDep.group == mavenDep.groupId &&
|
||||
providedDep.name == mavenDep.artifactId &&
|
||||
providedDep.version == mavenDep.version
|
||||
}
|
||||
if (isProvided) {
|
||||
mavenDep.scope = 'provided'
|
||||
}
|
||||
}
|
||||
|
||||
// eliminate test-scoped dependencies (no need in maven central poms)
|
||||
generatedPom.dependencies.removeAll { dep ->
|
||||
dep.scope == 'test'
|
||||
}
|
||||
|
||||
// add all items necessary for maven central publication
|
||||
generatedPom.project {
|
||||
name = gradleProject.description
|
||||
description = gradleProject.description
|
||||
url = 'https://github.com/SpringSource/spring-gemfire'
|
||||
organization {
|
||||
name = 'SpringSource'
|
||||
url = 'http://springsource.org'
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name 'The Apache Software License, Version 2.0'
|
||||
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
||||
distribution 'repo'
|
||||
}
|
||||
}
|
||||
scm {
|
||||
url = 'https://github.com/SpringSource/spring-gemfire'
|
||||
connection = 'scm:git:git://github.com/SpringSource/spring-gemfire'
|
||||
developerConnection = 'scm:git:git://github.com/SpringSource/spring-gemfire'
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id = 'dturanski'
|
||||
name = 'David Turanski'
|
||||
email = 'dturanski@vmware.com'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
assemble.dependsOn = ['jar', 'sourcesJar']
|
||||
defaultTasks 'build'
|
||||
|
||||
|
||||
@@ -25,4 +25,4 @@ gemfire.range = "[6.5, 7.0)"
|
||||
# --------------------
|
||||
# Project wide version
|
||||
# --------------------
|
||||
springGemfireVersion=1.2.0.BUILD-SNAPSHOT
|
||||
version=1.2.0.BUILD-SNAPSHOT
|
||||
|
||||
Reference in New Issue
Block a user