Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 31b9814893
Fetching contributors…

Cannot retrieve contributors at this time

267 lines (223 sloc) 8.77 kB
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
maven { url "http://repo.grails.org/grails/core" }
//mavenRepo(urls: 'http://evgeny-goldin.org/artifactory/repo/')
}
dependencies {
classpath "commons-io:commons-io:2.1"
//classpath "com.goldin.plugins:gradle:0.1-RC3" // http://evgeny-goldin.com/wiki/Gradle-duplicates-plugin
}
}
apply plugin: 'idea'
grailsVersion = '2.1.0.BUILD-SNAPSHOT'
antTraxVersion = "1.7.1"
antVersion = "1.8.2"
aspectjVersion = "1.6.10"
commonsBeanUtilsVersion = "1.8.3"
commonsCliVersion = "1.2"
commonsCollectionsVersion = "3.2.1"
commonsIOVersion = "2.1"
commonsLangVersion = "2.6"
datastoreVersion = "1.0.0.RC3"
gantVersion = "1.9.6"
gdocEngineVersion = "1.0.1"
groovyVersion = "1.8.4"
gradleGroovyVersion = groovyVersion
gradleGroovyVersion = "1.8.2"
ivyVersion = "2.2.0"
jansiVersion = "1.2.1"
jlineVersion = "1.0"
jnaVersion = "3.2.3"
slf4jVersion = "1.6.2"
springLoadedVersion = "1.0.2"
springVersion = "3.1.0.RC2"
springWebflowVersion= "2.0.8.RELEASE"
hibernateVersion = "3.6.8.Final"
ehcacheVersion = "2.4.6"
junitVersion = "4.10"
concurrentlinkedhashmapVersion = "1.2_jdk5"
archivesBaseName = 'grails'
version = grailsVersion
// directories created during the build which are related
// to turning the workspace root into a GRAILS_HOME
homeDistDir = file("dist")
homeBinDir = file("bin")
homeConfDir = file("conf")
homeDslSupportDir = file("dsl-support")
homeLibDir = file("lib")
homeSrcDir = file("src")
// Groovy is added as a dependency to both the 'groovy' and 'compile'
// configurations, so place the dependency in a shared variable. The
// 'compile' is required so that Groovy appears as a dependency in the
// artifacts' POMs.
if(System.getProperty('groovy.jar')) {
groovyDependency = files(System.getProperty('groovy.jar'))
gradleGroovyDependency = "org.codehaus.groovy:groovy-all:${gradleGroovyVersion}"
} else {
groovyDependency = "org.codehaus.groovy:groovy-all:${groovyVersion}"
gradleGroovyDependency = "org.codehaus.groovy:groovy-all:${gradleGroovyVersion}"
}
// Prevent multiple repositories being used, commented out as currently doesn't work.
/*gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(populateDependencies)) {
def projectsWithMultipleRepos = allprojects.findAll { repositories.size() > 1 }
println "projectsWithMultipleRepos: $projectsWithMultipleRepos"
if (projectsWithMultipleRepos) {
throw new GradleException(
"There are projects with more than one repository defined. \n" +
"This isn't allowed as it breaks the populateDependencies task. You can only use the grails central repo. \n" +
"This is a temporary workaround for the Gradle issue: http://issues.gradle.org/browse/GRADLE-1989"
)
}
}
}
*/
allprojects {
repositories {
maven { url "http://repo.grails.org/grails/core" }
}
configurations {
all {
resolutionStrategy {
def cacheHours = isCiBuild ? 1 : 24
cacheDynamicVersionsFor cacheHours, 'hours'
cacheChangingModulesFor cacheHours, 'hours'
}
}
}
}
subprojects { project ->
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'project-report'
//apply plugin: 'duplicates'
sourceCompatibility = "1.5"
targetCompatibility = "1.5"
archivesBaseName = 'grails'
version = grailsVersion
group = "org.grails"
isCiBuild = project.hasProperty("isCiBuild")
manifest.mainAttributes(
"Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
"Implementation-Title": "Grails",
"Implementation-Version": grailsVersion,
"Implementation-Vendor": 'grails.org')
configure([compileGroovy, compileTestGroovy]) {
groovyOptions.fork(memoryInitialSize: '128M', memoryMaximumSize: '1G')
groovyOptions.encoding = "UTF-8"
}
configure([compileJava, compileTestJava]) {
options.deprecation = true
options.debug = true
}
idea.module.iml.whenMerged { module ->
// adding slf4j-simple with scope TEST to .iml
module.dependencies << new org.gradle.plugins.ide.idea.model.ModuleLibrary(
[new org.gradle.plugins.ide.idea.model.Path("jar://\$GRADLE_USER_HOME/cache/org.slf4j/slf4j-simple/jars/slf4j-simple-${slf4jVersion}.jar!/")], [], [], [], "TEST"
)
}
dependencies {
// Groovy
if(System.getProperty('groovy.jar')) {
// use the jar specified in the system property (the joint build specifies its own groovy jar)...
groovy gradleGroovyDependency
} else {
// resolve the dependency from a repo...
groovy( gradleGroovyDependency ) {
exclude module:"commons-cli"
exclude module:"ant"
}
}
compile groovyDependency
if (project.name != "grails-docs") {
// Logging
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
// Specs
compile 'javax.servlet:servlet-api:2.5'
compile 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final'
// Testing
testCompile "junit:junit:${junitVersion}"
testCompile('org.spockframework:spock-core:0.6-groovy-1.8-SNAPSHOT') {
transitive = false
}
}
}
test {
excludes = ["**/*TestCase.class", "**/*\$*.class"]
}
task sourcesJar(type: Jar) {
classifier = 'sources'
appendix = project.name[7..-1]
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
appendix = project.name[7..-1]
from javadoc.destinationDir
}
groovydoc.doLast {
delete("${buildDir}/tmp")
}
configurations {
meta
published.extendsFrom archives, meta
all*.exclude group:'commons-logging', module: 'commons-logging'
}
artifacts {
meta sourcesJar
meta javadocJar
}
uploadPublished {
repositories {
final url = project.version.endsWith("SNAPSHOT") ? "http://repo.grails.org/grails/libs-snapshots-local" :
"http://repo.grails.org/grails/libs-releases-local"
project.deployer = repositories.mavenDeployer {
repository(url: url) {
final username = project.hasProperty("artifactoryPublishUsername") ? project.artifactoryPublishUsername : null
final password = project.hasProperty("artifactoryPublishPassword") ? project.artifactoryPublishPassword : null
if(username && password) {
org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials("Artifactory Realm", "repo.grails.org", username, password);
}
authentication(userName: username, password: password)
}
}
}
}
/*
Install a method that can be used to fine tune the poms, e.g…
modifyPom { pom ->
pom.dependencies.removeAll(pom.dependencies.findAll { it.scope == "test" })
}
Mods are run in order they are encountered in the build script.
The pom argument is of the following type:
http://maven.apache.org/ref/2.2.1/maven-model/apidocs/org/apache/maven/model/Model.html
*/
project.poms = [project.install.repositories.mavenInstaller.pom, project.deployer.pom]
project.pomModifications = []
project.modifyPom = { Closure modification -> project.pomModifications << modification }
project.poms*.whenConfigured {
project.pomModifications*.call(it)
}
}
task clean(type: Delete) {
delete buildDir,
homeBinDir,
homeConfDir,
homeDistDir,
homeDslSupportDir,
homeLibDir,
homeSrcDir
}
task allDependencies(dependsOn: { subprojects*.implicitTasks*.dependencies })
// From this point on we need the subprojects to be fully configured, so force their full evaluation
subprojects.each { evaluationDependsOn it.path }
apply {
from 'gradle/docs.gradle' // tasks for building the documentation (e.g. user guide, javadocs)
from 'gradle/assemble.gradle' // tasks for creating an installation or distribution
from 'gradle/findbugs.gradle'
}
Jump to Line
Something went wrong with that request. Please try again.