Skip to content

Commit

Permalink
Updated Gradle build
Browse files Browse the repository at this point in the history
- eliminated spock-parent POM in favor of duplicating information in every POM (Gradle currently has problems with publishing POM-only projects)
- added tasks for generation of sources and javadoc Jar
- renamed root project from spock-parent to spock
  • Loading branch information
pniederw committed Mar 1, 2011
1 parent a51e602 commit c3f5452
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 57 deletions.
36 changes: 27 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description = "Spock Framework - Umbrella Project"
description = "Spock Framework"

libs = [
ant: "org.apache.ant:ant:1.8.1", // use same version as Groovy 1.7
Expand Down Expand Up @@ -28,8 +28,13 @@ allprojects {
sourceCompatibility = 1.5
targetCompatibility = 1.5

compileGroovy.options.fork = false
compileTestGroovy.options.fork = false
configurations {
all*.exclude module: "junit" // we use junit-dep instead
}

dependencies {
groovy libs.groovy
}

repositories {
mavenCentral()
Expand All @@ -38,16 +43,29 @@ allprojects {
}
}

configurations {
all*.exclude module: "junit" // we use junit-dep instead
compileGroovy.options.fork = false
compileTestGroovy.options.fork = false

javadoc {
include "spock/**"
configure(options) {
links "http://java.sun.com/j2se/1.5.0/docs/api"
links "http://groovy.codehaus.org/gapi"
links "http://kentbeck.github.com/junit/javadoc/4.8"
links "http://www.jarvana.com/jarvana/inspect/org/hamcrest/hamcrest-core/1.2/hamcrest-core-1.2-javadoc.jar"
}
}

dependencies {
groovy libs.groovy
task sourcesJar(type: Jar) {
classifier = "sources"
from sourceSets.main.allSource
}
}

apply from: profile("publishMaven")
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from javadoc.destinationDir
}
}

File profile(String name) {
project.file("gradle/${name}.gradle")
Expand Down
71 changes: 25 additions & 46 deletions gradle/publishMaven.gradle
Original file line number Diff line number Diff line change
@@ -1,57 +1,36 @@
apply plugin: "maven"

if (isRootProject) {
basePom = {
withXml { // workaround for http://jira.codehaus.org/browse/GRADLE-1200
def project = it.asNode()
project.version[0] + {
packaging "pom"
basePom = {
project {
name project.description
url "http://spockframework.org"
description "Spock is a testing and specification framework for Java and Groovy applications."

licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}

project {
name project.description
url "http://spockframework.org"
description "Spock is a testing and specification framework for Java and Groovy applications."

licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}

scm {
connection "scm:git:git://github.com/spockframework/spock.git"
developerConnection "scm:git:ssh://git@github.com/spockframework/spock.git"
url "http://code.google.com/p/spock/source/browse"
}

developers {
developer {
id "pniederw"
name "Peter Niederwieser"
email "pniederw@gmail.com"
}
scm {
connection "scm:git:git://github.com/spockframework/spock.git"
developerConnection "scm:git:ssh://git@github.com/spockframework/spock.git"
url "http://code.google.com/p/spock/source/browse"
}

developer {
id "ldaley"
name "Luke Daley"
email "ld@ldaley.com"
}
developers {
developer {
id "pniederw"
name "Peter Niederwieser"
email "pniederw@gmail.com"
}
}
}
} else {
basePom = {
project {
name project.description

parent {
groupId project.rootProject.group
artifactId project.rootProject.name
version project.rootProject.version
developer {
id "ldaley"
name "Luke Daley"
email "ld@ldaley.com"
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
rootProject.name = "spock-parent"

include 'spock-core'
include 'spock-guice'
include 'spock-specs'
Expand Down

0 comments on commit c3f5452

Please sign in to comment.