forked from xiaodongw/swagger-finatra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
71 lines (57 loc) · 1.54 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
if(project.hasProperty("scalaVersion")) {
ext.scalaVersionMain = scalaVersion.substring(0, scalaVersion.lastIndexOf("."))
} else {
ext.scalaVersionMain = "2.10"
ext.scalaVersion = "2.10.4"
}
if(!project.hasProperty("finatraVersion")) {
ext.finatraVersion = "1.6.0"
}
if(finatraVersion.startsWith("1")) {
ext.finatraVersionPublish = ""
} else {
ext.finatraVersionPublish = "2"
}
println("Scala Version: ${scalaVersion}")
println("Scala Version Main: ${scalaVersionMain}")
println("Finatra Version: ${finatraVersion}")
println("Finatra Version Publish: ${finatraVersionPublish}")
apply plugin: 'scala'
repositories {
mavenLocal()
mavenCentral()
maven { url "http://maven.twttr.com" }
}
dependencies {
compile "org.scala-lang:scala-library:${scalaVersion}",
'com.wordnik:swagger-core:1.5.3-M1'
testCompile "org.scalatest:scalatest_${scalaVersionMain}:2.2.4",
'joda-time:joda-time:2.7'
if(finatraVersion.startsWith("1")) {
compile "com.twitter:finatra_${scalaVersionMain}:${finatraVersion}"
} else {
compile "com.twitter.finatra:finatra-http_${scalaVersionMain}:${finatraVersion}"
}
}
sourceSets {
main {
scala {
srcDirs = ['src/main/scala', "src/main/finatra${finatraVersionPublish}"]
}
}
test {
scala {
srcDirs = ['src/test/scala', "src/test/finatra${finatraVersionPublish}"]
}
}
}
compileJava {
targetCompatibility = "1.7"
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.useAnt = false
}
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
apply from: 'publish.gradle'