Skip to content

Commit

Permalink
Merged pull request #12 from trashhalo/master.
Browse files Browse the repository at this point in the history
Build distribution task
  • Loading branch information
justinvoss committed Apr 29, 2011
2 parents 8fb30e3 + 766f33a commit 575b94b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
21 changes: 21 additions & 0 deletions build.gradle
Expand Up @@ -28,3 +28,24 @@ task deployRatpack(dependsOn: [build,copyToLib], type: Copy) {
from "$buildDir/libs"
include "*.jar"
}

task buildDistro(dependsOn: assemble) << {
ant{
mkdir(dir:"$buildDir/ratpack/lib")
mkdir(dir:"$buildDir/ratpack/bin")
}
copy{
from("$projectDir/src/main/binaries")
into "$buildDir/ratpack/bin"
}
ant.chmod(file: "$buildDir/ratpack/bin/ratpack", perm: 'ugo+x')
copy{
from configurations.runtime
into "$buildDir/ratpack/lib"
}
copy{
from "$buildDir/libs"
into "$buildDir/ratpack/lib"
include "Ratpack-*.jar"
}
}
9 changes: 9 additions & 0 deletions src/main/binaries/ratpack
@@ -0,0 +1,9 @@
#!/usr/bin/env groovy
def loader = this.class.classLoader.rootLoader
def jardir = new File(new File(getClass().protectionDomain.codeSource.location.path).parentFile.parentFile,'lib')
def jars = jardir.listFiles().findAll { it.name.endsWith('.jar') }
jars.each { loader.addURL(it.toURI().toURL()) }

def scriptFile = new File(args[0])

Class.forName('com.bleedingwolf.ratpack.RatpackRunner').newInstance().run(scriptFile)

0 comments on commit 575b94b

Please sign in to comment.