improved build script structure and explanations
improved IDE configuration
This commit is contained in:
+9
-6
@@ -1,20 +1,23 @@
|
|||||||
|
# All directories should end in / (information used by ide.gradle)
|
||||||
|
|
||||||
# Ant
|
# Ant
|
||||||
ant
|
ant/
|
||||||
|
|
||||||
# Gradle
|
# Gradle
|
||||||
build
|
.gradle/
|
||||||
|
build/
|
||||||
|
|
||||||
# Maven
|
# Maven
|
||||||
target
|
target/
|
||||||
|
|
||||||
# Eclipse
|
# Eclipse
|
||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
.settings
|
.settings/
|
||||||
bin
|
bin/
|
||||||
|
|
||||||
# IDEA
|
# IDEA
|
||||||
*.iws
|
*.iws
|
||||||
*.ipr
|
*.ipr
|
||||||
*.iml
|
*.iml
|
||||||
out
|
out/
|
||||||
+11
-16
@@ -1,44 +1,39 @@
|
|||||||
apply plugin: "groovy"
|
apply plugin: "groovy"
|
||||||
apply plugin: "idea"
|
|
||||||
apply plugin: "eclipse"
|
|
||||||
|
|
||||||
version = "0.6-SNAPSHOT"
|
version = "0.6-SNAPSHOT"
|
||||||
description = "Spock Framework - Example Project"
|
description = "Spock Framework - Example Project"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
// Spock release versions are available from Maven Central
|
// Spock releases are available from Maven Central
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
// only required if a snapshot version of Spock is used
|
// Spock development snapshots are available from Spock's Maven repo
|
||||||
maven {
|
maven { url "http://m2repo.spockframework.org/snapshots" }
|
||||||
url "http://m2repo.spockframework.org/snapshots"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// mandatory dependencies for using Spock
|
// mandatory dependencies for using Spock
|
||||||
groovy("org.codehaus.groovy:groovy-all:1.8.6")
|
groovy "org.codehaus.groovy:groovy-all:1.8.6"
|
||||||
testCompile "org.spockframework:spock-core:0.6-groovy-1.8-rc-1"
|
testCompile "org.spockframework:spock-core:0.6-groovy-1.8-rc-1"
|
||||||
|
|
||||||
// optional dependencies for using Spock
|
// optional dependencies for using Spock
|
||||||
testCompile "org.hamcrest:hamcrest-core:1.2" // only necessary if Hamcrest matchers are used
|
testCompile "org.hamcrest:hamcrest-core:1.2" // only necessary if Hamcrest matchers are used
|
||||||
testRuntime "cglib:cglib-nodep:2.2" // enables mocking of classes (in addition to interfaces)
|
testRuntime "cglib:cglib-nodep:2.2" // allows mocking of classes (in addition to interfaces)
|
||||||
testRuntime "org.objenesis:objenesis:1.2" // enables mocking of classes without default constructor (together with CGLIB)
|
testRuntime "org.objenesis:objenesis:1.2" // allows mocking of classes without default constructor (together with CGLIB)
|
||||||
|
|
||||||
// dependencies used by examples in this project (not required for using Spock)
|
// dependencies used by examples in this project
|
||||||
testRuntime "com.h2database:h2:1.3.164"
|
testRuntime "com.h2database:h2:1.3.164"
|
||||||
}
|
}
|
||||||
|
|
||||||
// copies all Jars used in this project into build/output/lib (not required for using Spock)
|
// the remaining configuration is specific to this project, and is not required for using Spock
|
||||||
|
|
||||||
|
apply from: "gradle/ide.gradle"
|
||||||
|
|
||||||
task collectJars(type: Copy) {
|
task collectJars(type: Copy) {
|
||||||
into "$buildDir/output/lib"
|
into "$buildDir/output/lib"
|
||||||
from configurations.testRuntime
|
from configurations.testRuntime
|
||||||
}
|
}
|
||||||
|
|
||||||
// creates bootstrap files (gradlew etc.) for Gradle build (not required for using Spock)
|
|
||||||
task wrapper(type: Wrapper) {
|
task wrapper(type: Wrapper) {
|
||||||
gradleVersion = "1.0-milestone-8a"
|
gradleVersion = "1.0-milestone-8a"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
apply plugin: "idea"
|
||||||
|
apply plugin: "eclipse"
|
||||||
|
|
||||||
|
def gitIgnoreDirs = files(file(".gitignore").readLines().findAll { !it.trim().startsWith("#") && it.trim().endsWith("/") })
|
||||||
|
|
||||||
|
idea {
|
||||||
|
project {
|
||||||
|
jdkName "1.6"
|
||||||
|
configure(modules) {
|
||||||
|
excludeDirs = gitIgnoreDirs as Set
|
||||||
|
}
|
||||||
|
ipr {
|
||||||
|
withXml { provider ->
|
||||||
|
def node = provider.asNode()
|
||||||
|
node.component.find { it.'@name' == 'VcsDirectoryMappings' }?.mapping[0].'@vcs' = 'Git'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user