Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 4ed630afb4
Fetching contributors…

Cannot retrieve contributors at this time

246 lines (194 sloc) 7.099 kb
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
mavenRepo(urls: "http://repo.grails.org/grails/core")
}
dependencies {
classpath "commons-io:commons-io:1.4"
}
}
apply plugin: 'idea'
grailsVersion = '1.4.0.BUILD-SNAPSHOT'
antVersion = "1.8.2"
antTraxVersion = "1.7.1"
aspectjVersion = "1.6.10"
springVersion = "3.1.0.M1"
springDatastoreVersion = "1.0.0.M6"
springLoadedVersion = "0.8.0.RELEASE"
springWebflowVersion= "2.0.8.RELEASE"
ivyVersion = "2.2.0"
gantVersion = "1.9.5"
groovyVersion = "1.8.0"
commonsCollectionsVersion = "3.2.1"
commonsBeanUtilsVersion = "1.8.0"
commonsIOVersion = "1.4"
commonsLangVersion = "2.4"
slf4jVersion = "1.6.1"
archivesBaseName = 'grails'
version = grailsVersion
// 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'))
} else {
groovyDependency = "org.codehaus.groovy:groovy-all:${groovyVersion}"
}
subprojects { project ->
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'project-report'
sourceCompatibility = "1.5"
targetCompatibility = "1.5"
archivesBaseName = 'grails'
version = grailsVersion
group = "org.grails"
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
}
repositories {
mavenRepo(urls: "http://repo.grails.org/grails/core") {
if (project.hasProperty('snapshotTimeout')) {
setSnapshotTimeout(Long.parseLong(project.snapshotTimeout))
}
}
}
dependencies {
// Groovy
groovy groovyDependency
compile groovyDependency
// 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.java-persistence:jpa-api:2.0-cr-1'
// Testing
testCompile 'junit:junit:4.8.1'
testCompile('org.spockframework:spock-core:0.5-groovy-1.8') {
transitive = false
}
}
install.doLast {
copy {
from(project.libsDir) {
include "*-${grailsVersion}.jar"
}
into "${rootProject.projectDir}/dist"
}
}
test {
excludes = ["**/*TestCase.class", "**/*\$*.class"]
}
task sourcesJar(type: Jar, dependsOn:classes) {
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
}
artifacts {
meta sourcesJar
meta javadocJar
}
uploadArchives {
repositories {
final url = project.version.endsWith("SNAPSHOT") ? "http://repo.grails.org/grails/libs-snapshots-local" :
"http://repo.grails.org/grails/libs-releases-local"
mavenRepo urls: url
project.deployer = repositories.mavenDeployer {
repository(url: url) {
beforeDeployment { deployment ->
["sources", "javadoc"].each { type ->
deployment.addArtifact configurations.meta.artifacts.find { it.classifier == type }
}
}
final username = project.properties["artifactoryPublishUsername"]
final password = project.properties["artifactoryPublishPassword"]
if(username && password) {
org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials("Artifactory Realm", "repo.grails.org", username, password);
}
authentication(userName: username, password: password)
}
}
}
}
uploadArchives.dependsOn sourcesJar, javadocJar
/*
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)
}
}
apply {
from 'gradle/docs.gradle'
from 'gradle/assemble.gradle'
}
task clean << {
// add additional dirs
// delete(docs.destinationDir, libs.destinationDir)
delete(libs.destinationDir)
delete(buildDir)
}
task installResources << {
copy {
from('grails-resources/src/grails/home/tests')
into('lib')
filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
}
copy {
from("grails-resources/src/grails/home/bash")
filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
filter(ReplaceTokens, tokens: ['groovy.version': groovyVersion])
filter(ReplaceTokens, tokens: ['spring.loaded.version': springLoadedVersion])
fileMode = 0755
into "bin"
}
// the fileMode property above should take care of the chmod work, but
// it doesn't per http://jira.codehaus.org/browse/GRADLE-971
ant.chmod(dir: 'bin', perm: '755', includes: '*')
copy {
from("grails-resources/src/grails/home/conf")
into "conf"
filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
filter(ReplaceTokens, tokens: ['groovy.version': groovyVersion])
filter(ReplaceTokens, tokens: ['ant.version': antVersion])
filter(ReplaceTokens, tokens: ['gant.version': gantVersion])
filter(ReplaceTokens, tokens: ['ivy.version': ivyVersion])
}
}
task install(dependsOn:[populateDependencies, installResources])
task assemble(dependsOn:zipDist)
Jump to Line
Something went wrong with that request. Please try again.