-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
46 lines (31 loc) · 943 Bytes
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
apply plugin: 'java'
def gemJarName ="sassJar"
repositories {
mavenCentral()
}
dependencies {
runtime group: 'org.jruby', name: 'jruby-complete', version: '1.7.8'
}
task getRuby(type: Copy) {
into "dist"
from configurations.runtime
}
task buildJarDir(dependsOn: getRuby) << {
new File("dist/"+gemJarName).mkdir()
}
task installGems(dependsOn: buildJarDir) << {
def gems = new File('gems.properties')
gems.eachLine {
println "Searching for " + it
def sout = new StringBuffer(), serr = new StringBuffer()
def proc = ['java', '-jar', 'jruby-complete-1.7.8.jar', '-S', 'gem', 'install','-i', './' +gemJarName, it, '--no-rdoc', '--no-ri'].execute(null, new File("dist"))
proc.consumeProcessOutput(sout, serr)
proc.waitFor()
println "out> $sout err> $serr"
}
}
task gemJar(dependsOn: installGems, type:Jar) {
archiveName gemJarName + ".jar"
destinationDir new File("dist")
from ("dist/" + gemJarName)
}