11ext {
2- githubBranch = " 7.1 .x"
2+ githubBranch = " 8.0 .x"
33 checkOutDir = " build/checkout"
4+ explicitGormSrc = System . getProperty(" gorm.src" ) ?: (project. hasProperty(' gorm.src' ) ? project. getProperty(" gorm.src" ) : null )
5+ gormSrc = explicitGormSrc ? file(explicitGormSrc). absolutePath : " $checkOutDir /gorm-src"
46 zipFile = " build/source.zip"
57
68 coreProjects = [
@@ -69,12 +71,17 @@ asciidoctorj {
6971}
7072
7173task fetchSource {
72- doLast {
73- ant. mkdir dir : project. buildDir
74- ant. mkdir dir : checkOutDir
74+ outputs. dir layout. buildDirectory. dir(' checkout' )
75+ inputs. properties(branch : githubBranch)
76+
77+ onlyIf {
78+ println " GORM SRC=$explicitGormSrc "
79+ return ! explicitGormSrc
80+ }
7581
82+ doLast {
7683 println " Downloading GORM source code."
77- def tag = System . getenv(' TRAVIS_TAG ' )
84+ def tag = System . getenv(' TAGGED_VERSION ' )
7885 if (tag) {
7986 ant. get src : " https://github.com/grails/grails-data-mapping/archive/${ tag} .zip" , dest : zipFile, verbose : true
8087 } else {
@@ -86,10 +93,8 @@ task fetchSource {
8693 }
8794 println " GORM source code downloaded."
8895 }
89- }
9096
91- fetchSource. inputs. properties(branch :githubBranch)
92- fetchSource. outputs. dir checkOutDir
97+ }
9398
9499
95100task copyDocs (type :Copy , dependsOn :asciidoctor) {
@@ -131,8 +136,13 @@ task docs(dependsOn:[asciidoctor, groovydoc, copyDocs, copyResources] +
131136 .collect { project -> project. tasks. groovydoc }
132137)
133138
134- // task assemble(type: Zip, dependsOn:docs) {
135- // from "${project.buildDir}/docs"
136- // baseName = "${project.name}-${project.version}"
137- // destinationDir = project.file("${project.buildDir}/distributions")
138- // }
139+ task assembleDocsDist (type : Zip ) {
140+ dependsOn docs
141+ from " ${ project.buildDir} /docs"
142+ include ' *'
143+ include ' */**'
144+ archiveFileName = " ${ project.name} -${ project.version} .zip"
145+ destinationDirectory = project. layout. buildDirectory. dir(' distributions' )
146+ }
147+
148+ docs. finalizedBy assembleDocsDist
0 commit comments