Skip to content

Commit

Permalink
gradle build improvements
Browse files Browse the repository at this point in the history
updated vcs information in maven POM
  • Loading branch information
pniederw committed Jan 6, 2011
1 parent 73dcdea commit 4b68101
Show file tree
Hide file tree
Showing 9 changed files with 165 additions and 103 deletions.
98 changes: 79 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
antDep = "org.apache.ant:ant:1.8.1" // use same version as Groovy 1.8
asm = "asm:asm:3.2" // use same version as Groovy 1.8
cglib = "cglib:cglib-nodep:2.2"
easymock = "org.easymock:easymock:3.0"
groovy = "org.codehaus.groovy:groovy-all:1.7.6"
h2database = "com.h2database:h2:1.2.147"
hamcrest_core = "org.hamcrest:hamcrest-core:1.2"
jmock = "org.jmock:jmock:2.5.1"
jmock_junit4 = "org.jmock:jmock-junit4:2.5.1"
junit = "junit:junit-dep:4.8.2"
log4j = "log4j:log4j:1.2.16"
mockito = "org.mockito:mockito-all:1.8.5"
objenesis = "org.objenesis:objenesis:1.2"

allprojects {
group = "org.spockframework"
version = "0.6-groovy-1.7-SNAPSHOT"

apply plugin: "idea"
apply plugin: "eclipse"

antDep = "org.apache.ant:ant:1.8.1" // use same version as Groovy 1.7
asm = "asm:asm:3.2" // use same version as Groovy 1.7
cglib = "cglib:cglib-nodep:2.2"
easymock = "org.easymock:easymock:3.0"
groovy = "org.codehaus.groovy:groovy-all:1.7.6"
h2database = "com.h2database:h2:1.2.147"
hamcrest_core = "org.hamcrest:hamcrest-core:1.2"
jmock = "org.jmock:jmock:2.5.1"
jmock_junit4 = "org.jmock:jmock-junit4:2.5.1"
junit = "junit:junit-dep:4.8.2"
log4j = "log4j:log4j:1.2.16"
mockito = "org.mockito:mockito-all:1.8.5"
objenesis = "org.objenesis:objenesis:1.2"
}

subprojects {
apply plugin: "groovy"

sourceCompatibility = 1.5
targetCompatibility = 1.5

Expand All @@ -35,10 +32,73 @@ subprojects {

repositories {
mavenCentral()
if (isSnapshotVersion(project)) {
mavenRepo(urls: "http://snapshots.repository.codehaus.org")
}
}
}

applyReleaseProfile(project)

install {
repositories.mavenInstaller {
pom {
name = "Spock Framework - Umbrella Project"
url = "http://spockframework.org"
packaging = "pom" // TODO: has no effect, need to find a workaround

project {
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"
}

developer {
id "ldaley"
name "Luke Daley"
email "ld@ldaley.com"
}
}
}
}
}
}

task wrapper(type: Wrapper) {
gradleVersion = "0.9"
gradleVersion = "0.9.1"
}

void applyReleaseProfile(project) {
configure(project) {
apply plugin: "maven"

uploadArchives {
repositories.mavenDeployer {
repository(url: isSnapshotVersion(project) ? "file:///var/www/m2repo/snapshots" : "file:///var/www/m2repo/release")
}
}
}
}

boolean isSnapshotVersion(project) {
project.version.endsWith("-SNAPSHOT")
}

6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
</licenses>

<scm>
<connection>scm:svn:http://spock.googlecode.com/svn</connection>
<developerConnection>scm:svn:https://spock.googlecode.com/svn</developerConnection>
<url>http://code.google.com/p/spock/source/browse</url>
<connection>scm:git:git://github.com/spockframework/spock.git</connection>
<developerConnection>scm:git:ssh://git@github.com/spockframework/spock.git</developerConnection>
<url>https://github.com/spockframework/spock</url>
</scm>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "spock-groovy-1.7"
rootProject.name = "spock-parent"

include 'spock-core'
include 'spock-guice'
Expand Down
21 changes: 11 additions & 10 deletions spock-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
project(":spock-core") {
dependencies {
compile asm
compile junit
compile hamcrest_core // until https://github.com/KentBeck/junit/issues/issue/165 gets fixed
compile cglib
compile objenesis
compile antDep
compile hamcrest_core
}
applyReleaseProfile(project)

dependencies {
compile asm
compile junit
compile hamcrest_core // until https://github.com/KentBeck/junit/issues/issue/165 gets fixed
compile cglib
compile objenesis
compile antDep
compile hamcrest_core
}


14 changes: 7 additions & 7 deletions spock-guice/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
project(":spock-guice") {
dependencies {
compile project(":spock-core")
compile "com.google.inject:guice:2.0"
// surfaces in the Guice API; groovyc complains if we don't add it
compile "aopalliance:aopalliance:1.0"
}
applyReleaseProfile(project)

dependencies {
compile project(":spock-core")
compile "com.google.inject:guice:2.0"
// surfaces in the Guice API; groovyc complains if we don't add it
compile "aopalliance:aopalliance:1.0"
}
25 changes: 12 additions & 13 deletions spock-specs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
project(":spock-specs") {
dependencies {
testCompile project(":spock-core")
testCompile junit
testCompile easymock
testCompile jmock_junit4
testCompile jmock
testCompile mockito
testRuntime asm
testRuntime cglib
testRuntime objenesis
testRuntime h2database
}
dependencies {
testCompile project(":spock-core")
testCompile junit
testCompile easymock
testCompile jmock_junit4
testCompile jmock
testCompile mockito
testRuntime asm
testRuntime cglib
testRuntime objenesis
testRuntime h2database
}

28 changes: 14 additions & 14 deletions spock-spring/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
project(":spock-spring") {
def springVersion = "3.0.5.RELEASE"
applyReleaseProfile(project)

dependencies {
compile project(":spock-core")
compile "org.springframework:spring-test:$springVersion"
compile "org.springframework:spring-beans:$springVersion"
testCompile "org.springframework:spring-context:$springVersion"
// not used directly at compile-time, but needed by groovyc
testCompile "org.springframework:spring-core:$springVersion"
testCompile "org.springframework:spring-jdbc:$springVersion"
testCompile "org.springframework:spring-tx:$springVersion"
testRuntime h2database
testRuntime log4j
}
def springVersion = "3.0.5.RELEASE"

dependencies {
compile project(":spock-core")
compile "org.springframework:spring-test:$springVersion"
compile "org.springframework:spring-beans:$springVersion"
testCompile "org.springframework:spring-context:$springVersion"
// not used directly at compile-time, but needed by groovyc
testCompile "org.springframework:spring-core:$springVersion"
testCompile "org.springframework:spring-jdbc:$springVersion"
testCompile "org.springframework:spring-tx:$springVersion"
testRuntime h2database
testRuntime log4j
}
29 changes: 15 additions & 14 deletions spock-tapestry/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
project(":spock-tapestry") {
repositories {
// need to explicitely add repository defined in tapestry-ioc POM
// (workaround for http://jira.codehaus.org/browse/GRADLE-611)
mavenRepo(urls: "http://repository.jboss.com/maven2")
}

dependencies {
compile project(":spock-core")
compile "org.apache.tapestry:tapestry-ioc:5.2.4"
compile "org.apache.tapestry:tapestry5-annotations:5.2.4"
compile "org.slf4j:slf4j-api:1.6.1"
compile junit
}
applyReleaseProfile(project)

repositories {
// need to explicitely add repository defined in tapestry-ioc POM
// (workaround for http://jira.codehaus.org/browse/GRADLE-611)
mavenRepo(urls: "http://repository.jboss.com/maven2")
}

dependencies {
compile project(":spock-core")
compile "org.apache.tapestry:tapestry-ioc:5.2.4"
compile "org.apache.tapestry:tapestry5-annotations:5.2.4"
compile "org.slf4j:slf4j-api:1.6.1"
compile junit
}

45 changes: 23 additions & 22 deletions spock-unitils/build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
project(":spock-unitils") {
dependencies {
compile project(":spock-core")
compile "org.unitils:unitils-core:3.1"
applyReleaseProfile(project)

// the following are transitive deps of unitils-core with scope compile
// nevertheless, if we don't specify them explicitely, groovyc crashes with
// NoClassDefFoundError at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:285)
compile "commons-collections:commons-collections:3.2"
compile "ognl:ognl:2.6.9"
dependencies {
compile project(":spock-core")
compile "org.unitils:unitils-core:3.1"

testCompile("org.unitils:unitils-dbunit:3.1") {
exclude module: "jta"
}
testCompile("org.unitils:unitils-database:3.1") {
exclude module: "jta"
}
// the following are transitive deps of unitils-core with scope compile
// nevertheless, if we don't specify them explicitely, groovyc crashes with
// NoClassDefFoundError at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:285)
compile "commons-collections:commons-collections:3.2"
compile "ognl:ognl:2.6.9"

// for some reason, groovyc needs junit dependency for compiling tests
// otherwise we'll get:
// java.lang.NoClassDefFoundError: junit/framework/AssertionFailedError
testCompile junit

testRuntime h2database
testRuntime log4j
testCompile("org.unitils:unitils-dbunit:3.1") {
exclude module: "jta"
}
testCompile("org.unitils:unitils-database:3.1") {
exclude module: "jta"
}

// for some reason, groovyc needs junit dependency for compiling tests
// otherwise we'll get:
// java.lang.NoClassDefFoundError: junit/framework/AssertionFailedError
testCompile junit

testRuntime h2database
testRuntime log4j
}

0 comments on commit 4b68101

Please sign in to comment.