-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
86 lines (73 loc) · 2.42 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
77
78
79
80
81
82
83
84
85
86
// Adding ScalaStyle support
buildscript {
repositories {
jcenter()
}
dependencies {
classpath(
[group: "org.github.ngbinh.scalastyle", name: "gradle-scalastyle-plugin_2.11", version: "0.7.2"]
)
}
}
apply plugin: 'scala'
apply plugin: 'scalaStyle'
apply plugin: 'project-report'
apply plugin: 'application'
// Scala and Akka versions
def scalaMajor = "2.11"
def scalaMinor = "8"
def akkaVersion = "2.4.11"
group 'scalaquil'
mainClassName = "scalaquil.Main"
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile 'org.qchackers.jquil:api:1.0.0'
compile(
[group: 'org.scala-lang', name: 'scala-compiler', version: "$scalaMajor.$scalaMinor"],
[group: 'org.scala-lang', name: 'scala-library', version: "$scalaMajor.$scalaMinor"],
[group: 'com.typesafe.akka', name: "akka-actor_$scalaMajor", version: akkaVersion],
)
testCompile(
[group: 'junit', name: 'junit', version: '4.12'],
[group: 'org.specs2', name: "specs2-core_$scalaMajor", version: '3.8.5.1'],
[group: 'org.specs2', name: "specs2-junit_$scalaMajor", version: '3.8.5.1'],
)
}
// Specifying the main class for the 'application' plugin
jar {
baseName = project.name
manifest {
attributes("Main-Class": mainClassName)
}
}
// Workaround for Gradle 3.+ and IDEA (https://discuss.gradle.org/t/idea-integration-with-scala-plugin-broken-since-gradle-3-0-no-such-property-daemonserver/19159/2)
ScalaCompileOptions.metaClass.daemonServer = true
ScalaCompileOptions.metaClass.fork = true
ScalaCompileOptions.metaClass.useAnt = false
ScalaCompileOptions.metaClass.useCompileDaemon = false
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = ["-unchecked", "-deprecation", "-feature", "-Xfatal-warnings", "-encoding", "utf8"]
}
// ScalaStyle config, by putting it to the project subdirectory, IDEA will automatically use it
scalaStyle {
configLocation = "$rootDir/project/scalastyle_config.xml"
includeTestSourceDirectory = true
source = "src/main/scala"
testSource = "src/test/scala"
}
// Run ScalaStyle with the tests
check {
dependsOn "scalaStyle"
}
// specs2 console logging
test {
testLogging.showStandardStreams = true
systemProperty "specs2.commandline", "console"
}
// Generating gradle wrapper so people don't have to have the Gradle version preinstalled
task wrapper(type: Wrapper) {
gradleVersion = "4.8"
}