/
build.gradle
76 lines (64 loc) · 1.78 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
apply plugin: 'java' // for zip
apply plugin: 'scala'
project.group = 'pl.project13'
archivesBasename = 'protoc-gen-scala'
project.version = "1.0.0"
repositories {
mavenCentral()
mavenRepo urls: 'http://scala-tools.org/repo-releases/'
mavenRepo urls: ['http://repository.jboss.org/maven2/']
}
manifest.mainAttributes("Main-Class": "pl.project13.protoscala.MainRunner",
"Class-Path": 'lib/'
+ 'lib/guava-r08.jar'
+ 'lib/protobuf-java-2.4.0a.jar'
)
dependencies {
// Libraries needed to run the scala tools
scalaTools 'org.scala-lang:scala-compiler:2.8.0'
scalaTools 'org.scala-lang:scala-library:2.8.0'
// yes, really declare it a second time (or you'll get 'object scala not found')
compile 'org.scala-lang:scala-compiler:2.8.0'
compile 'org.scala-lang:scala-library:2.8.0'
// Libraries needed for scala api
compile files(
'lib/guava-r08.jar',
'lib/protobuf-java-2.4.0a.jar',
'lib/scalatest-1.3.jar',
'lib/scalatest-1.3-tests.jar'
)
// for tests
testCompile 'org.easytesting:fest-assert:1.4'
testCompile 'junit:junit:4.8.2'
}
clean << {
ant {
['out', 'dist'].each {
println "rm $it"
delete(it)
}
}
}
jar {
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
task dist(dependsOn: [jar]) << {
copy /* main app */ {
from 'build/libs'
into 'dist'
include '**/*.jar'
}
copy /* dependencies */ {
from 'lib'
into 'dist/lib'
include '**/*.jar'
}
copy /* launcher */ {
from 'src/main/resources'
into 'dist'
include '**/*'
}
}
//task run(dependsOn: [dist]) << {
// ['bash', './dist/'].execute()
//}