Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ef7d40c05e
Fetching contributors…

Cannot retrieve contributors at this time

137 lines (120 sloc) 4.432 kb
import org.apache.tools.ant.filters.ReplaceTokens
dependencyCache = {
def cacheLocation = new File(gradle.gradleUserHomeDir, "cache")
copy {
from( cacheLocation ) {
def dependencyIncludes = [] as Set
def includeClosure = { artifact ->
def dependency = artifact.getResolvedDependency()
def file = artifact.file
dependencyIncludes << "${dependency.moduleGroup}/${dependency.moduleName}/*-${dependency.moduleVersion}.*"
dependencyIncludes << "${dependency.moduleGroup}/${dependency.moduleName}/jars/${dependency.moduleName}-${dependency.moduleVersion}.jar"
dependencyIncludes << "${dependency.moduleGroup}/${dependency.moduleName}/bundles/${dependency.moduleName}-${dependency.moduleVersion}.jar"
}
for(project in subprojects) {
project.configurations.compile.resolvedConfiguration.resolvedArtifacts.each(includeClosure)
project.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each(includeClosure)
project.configurations.findByName("jsp21")?.resolvedConfiguration?.resolvedArtifacts?.each(includeClosure)
}
includes = dependencyIncludes as List
}
into "$projectDir/lib"
}
}
task populateDependencies {
doFirst dependencyCache
}
task libs(dependsOn: getTasksByName("jar", true)) {
doFirst dependencyCache
destinationDir = 'dist'
doLast {
copy {
for(project in subprojects) {
from( project.libsDir ) {
include "*-${grailsVersion}.jar"
}
}
into 'dist'
}
copy {
from("$projectDir/grails-resources") {
include 'src/grails', 'src/war'
}
into projectDir
}
}
}
task pluginsFromSvn {
dir = "$buildDir/pluginsFromSvn"
grailsHibernateDest = "$dir/grails-hibernate-${grailsVersion}.zip"
grailsTomcatDest = "$dir/grails-tomcat-${grailsVersion}.zip"
outputs.files grailsHibernateDest, grailsTomcatDest
doFirst {
ant {
mkdir(dir: dir)
def versionTag = grailsVersion.replaceAll(/\./, '_').toUpperCase()
get(src: "http://svn.codehaus.org/grails/trunk/grails-plugins/grails-hibernate/tags/RELEASE_${versionTag}/grails-hibernate-${grailsVersion}.zip",
dest: grailsHibernateDest, verbose: true, usetimestamp: true)
get(src: "http://svn.codehaus.org/grails/trunk/grails-plugins/grails-tomcat/tags/RELEASE_${versionTag}/grails-tomcat-${grailsVersion}.zip",
dest: grailsTomcatDest, verbose: true, usetimestamp: true)
}
}
}
binExecutables = ["cygrails", "grails", "grails-debug", "grails-debug.bat", "grails.bat"]
distSpec = copySpec {
from(projectDir) {
into "grails-$grailsVersion"
include 'lib/', 'gradle/', 'media/', 'samples/', 'scripts/', 'conf/', 'build.gradle', 'build.properties',
'LICENSE', 'INSTALL', "src/", "gradlew.bat","gradle.properties"
exclude 'ant/bin'
// this file is accounted for later with special handling to do some token replacement
exclude 'src/grails/grails-macros.xml'
}
from("$projectDir/grails-resources") {
into "grails-$grailsVersion"
include 'src/grails', 'src/war'
}
from(projectDir) {
into "grails-$grailsVersion"
include "gradlew"
fileMode = 0755
}
from(docs.destinationDir) {
into "grails-$grailsVersion/doc"
}
exclude "**/CVS/**"
from(project.files(pluginsFromSvn.dir) { builtBy 'pluginsFromSvn' }) {
into "grails-$grailsVersion/plugins"
}
from('bin') {
into "grails-$grailsVersion/bin"
include binExecutables
fileMode = 0755
}
from('src/resources/docs/README') {
into "grails-$grailsVersion"
filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
}
from("src/resources/bash") {
include "startGrails.bat", "startGrails"
into "grails-$version/bin"
filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
fileMode = 0755
}
from(libs.destinationDir) {
into "grails-$grailsVersion/dist"
exclude "*.zip"
}
from("src/grails/grails-macros.xml") {
into "grails-$grailsVersion/src/grails"
filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
}
}
task zipDist(type: Zip,dependsOn:libs) {
from distSpec
doFirst dependencyCache
}
task zipDoc(type: Zip) {
appendix = 'docs'
from docs.destinationDir
}
Jump to Line
Something went wrong with that request. Please try again.