Skip to content

Commit

Permalink
synch Travis build changes from master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
lhotari committed Mar 25, 2015
1 parent 1d39be4 commit 6b4be03
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 11 deletions.
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
script: ./travis-build.sh
sudo: false
jdk:
- openjdk7
env:
global:
- GRADLE_OPTS="-server -Xmx1024M -Xms768M -XX:PermSize=256m -XX:MaxPermSize=512m"
- GIT_NAME="Graeme Rocher"
- GIT_EMAIL="[email protected]"
- secure: SdGzn2ItEkM0UGzByv/0yXLO7g9iJYmrSIgQ3a1yZXvOerQOLuOwwTZIJ4LUBJpJcQRhiAff1HidN/6fAGAd4mwgoQcX1kKdrRHIl0oG7V7DC9YRytPko/gasQ6aPoR3GBBpLqx8hIjGYbVKIrPWgMSRRA7DSvbzI5XlOgAX1Dg=
- secure: R9aL92lh09LniCTbiZuuikiWHXL4ik/DDAKe7NLanqpI126vs5Y9zd56JifgN8Mp7sEbwlaM4RzFXpgkdl57FZqdDzC04ljeqy9Z4CmGthUCF2o2exV98HFWxrL6J18OH5zVSBtZJN0ANcgdJ3/+vMuk2wyS61qhl36uiUM66tM=
cache:
directories:
- $HOME/.gradle/wrapper
- $HOME/.gradle/caches
deploy:
provider: releases
api_key:
secure: OXqyhH6/rK9rmiApnm+8smg/+rjdM3T28/4ZUzbdibYZNSagVAMniDgndZIwt198jDvAPxf9jadN1G3OD5BLkW0wUWvAfYAtxAwOe6dzgcsMavdTxoBJnjXBc4XqFXSDhWTO4cd4vQ5Wx6cyvbUY5xgyREpvEP7oRUgQ0RJo9q8=
file: build/distributions/grails-docs-${TRAVIS_TAG:1}.zip
skip_cleanup: true
on:
repo: grails/grails-doc
tags: true
all_branches: true
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Building the Guide
To build the documentation, simply type:

./gradlew docs

This will take some time as it generates groovydoc for the Grails sources. If you want to just generate the user guide to preview your change you can do:

./gradlew -Ddisable.groovydocs=true docs

Be warned: this command can take a while to complete and you should probably increase your Gradle memory settings by giving the `GRADLE_OPTS` environment variable a value like

Expand Down
22 changes: 14 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: "base"

version = System.getProperty("grails.version") ?: "2.4.4.BUILD-SNAPSHOT"
version = project.getProperty("grails.version")

archivesBaseName = "grails-docs"

Expand All @@ -22,11 +22,15 @@ buildscript {
}

dependencies {
classpath "org.grails:grails-docs:2.4.4.BUILD-SNAPSHOT"
classpath 'org.codehaus.groovy:groovy-all:2.3.0'
classpath "org.grails:grails-docs:3.0.0.RC2"
classpath 'org.codehaus.groovy:groovy-all:2.4.3'
}
}

task buildscriptDependencies(type: DependencyReportTask) {
configurations = [buildscript.configurations.classpath]
}

// use jsoup in PdfBuilder for cleaning input html
System.setProperty('grails.docs.clean.html','true')
// creates single.html.before.xml and single.html.after.xml files for debugging pdf input when enabled
Expand All @@ -47,15 +51,17 @@ task fetchGrailsSource << {
mapper type: "regexp", from: "(grails-grails-core-\\S*?/)(.*)", to: "grails-src/\\2"
}

ant.chmod(file:"${checkOutDir}/grails-src/gradlew", perm:700)

println "Grails source code has been downloaded to ${relativePath(grailsHome)}"
}

fetchGrailsSource.onlyIf { !explicitGrailsHome }

task apiDocs(type: GradleBuild, dependsOn: 'fetchGrailsSource') {
tasks = ["groovydoc"]
buildFile = "${project.grailsHome}/build.gradle"
startParameter.excludedTaskNames = ['compileGroovy', 'compileUaaGroovy', 'compileJsp21Groovy', 'compileAstGroovy', 'jar']
task apiDocs(type: Exec, dependsOn: 'fetchGrailsSource') {
commandLine = ["./gradlew", "groovydoc", '--info', '--stacktrace']
workingDir = "${checkOutDir}/grails-src"
environment "GRADLE_OPTS", "-Xmx2048m -Xms256m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError"
}

apiDocs.onlyIf { !System.getProperty("disable.groovydocs") }
Expand All @@ -78,7 +84,7 @@ task publishGuide(type: grails.doc.gradle.PublishGuide, dependsOn: ['apiDocs', '
// generated with a 'en' in the path, but the source is in 'en'
// so that it's easy to track with git.
sourceDir = new File(projectDir, "src/en")
propertiesFiles = [ new File(project.grailsHome, "build.properties") ]
propertiesFiles = [ new File(projectDir, "gradle.properties") ]
macros = [ new grails.doc.macros.GspTagSourceMacro(searchDirs) ]
}

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grails.version=2.4.5
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed May 07 15:07:35 EEST 2014
#Thu Feb 19 15:21:28 CST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip
2 changes: 1 addition & 1 deletion quick-publish.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
./gradlew -Ddisable.groovydocs=true -Dgrails.home=../grails-master docs
./gradlew -Ddisable.groovydocs=true -Dgrails.home=../dev docs
50 changes: 50 additions & 0 deletions travis-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
set -e

git config --global user.name "$GIT_NAME"
git config --global user.email "$GIT_EMAIL"
git config --global credential.helper "store --file=~/.git-credentials"
echo "https://$GH_TOKEN:@github.com" > ~/.git-credentials

export GRADLE_OPTS="-Xmx2048m -Xms256m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError"

./gradlew assemble --info --stacktrace

if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then

# If there is a tag present then this becomes the latest
if [[ -n $TRAVIS_TAG ]]; then
git clone https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git -b gh-pages gh-pages --single-branch > /dev/null
cd gh-pages

version="$TRAVIS_TAG"
version=${version:1}
zipName="grails-docs-$version"
export RELEASE_FILE="${zipName}.zip"

milestone=${version:5}
if [[ -n $milestone ]]; then
git rm -rf latest/
mkdir -p latest
cp -r ../build/docs/. ./latest/
git add latest/*
fi

majorVersion=${version:0:4}
majorVersion="${majorVersion}x"

mkdir -p "$version"
cp -r ../build/docs/. "./$version/"
git add "$version/*"

mkdir -p "$majorVersion"
cp -r ../build/docs/. "./$majorVersion/"
git add "$majorVersion/*"
git commit -a -m "Updating docs for Travis build: https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID"
git push origin HEAD
cd ..
rm -rf gh-pages

fi

fi

0 comments on commit 6b4be03

Please sign in to comment.