This repository has been archived by the owner on Jan 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
133 lines (112 loc) · 2.69 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.github.ngbinh.scalastyle:gradle-scalastyle-plugin_2.11:1.0.1'
}
}
plugins {
id 'java'
id 'maven'
id 'scala'
id 'com.github.maiflai.scalatest' version '0.22'
id 'com.github.johnrengelman.shadow' version '2.0.4'
}
ext {
scalaMajorVersion = '2.12'
scalaMinorVersion = '6'
scalaVersion = "${scalaMajorVersion}.${scalaMinorVersion}"
catsVersion = '1.1.0'
jLineVersion = '3.8.0'
}
group = 'space.maizy'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
task wrapper(type: Wrapper) {
gradleVersion = '4.7'
distributionType = 'all'
}
allprojects {
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'scalaStyle'
apply plugin: 'com.github.maiflai.scalatest'
repositories {
mavenCentral()
}
dependencies {
compile "org.scala-lang:scala-library:${scalaVersion}"
compile "org.scala-lang:scala-reflect:${scalaVersion}"
testCompile "org.scalatest:scalatest_${scalaMajorVersion}:3.0.4"
testRuntime 'org.pegdown:pegdown:1.4.2'
}
scalaStyle {
configLocation = "$rootProject.projectDir/scalastyle-config.xml"
includeTestSourceDirectory = true
source = 'src/main/scala'
testSource = 'src/test/scala'
}
test {
dependsOn scalaStyle
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = [
'-Xlint:_',
'-feature',
'-Xfatal-warnings',
'-Ypartial-unification',
'-Ywarn-dead-code',
'-Ywarn-inaccessible',
'-Ywarn-infer-any',
'-Ywarn-nullary-override',
'-Ywarn-nullary-unit',
'-Ywarn-numeric-widen'
]
}
}
project('slime') {
dependencies {
compile "org.typelevel:cats-core_${scalaMajorVersion}:${catsVersion}"
}
}
project('slime-jline3') {
dependencies {
compile project(':slime')
compile "org.jline:jline-terminal:${jLineVersion}"
compile "org.jline:jline-reader:${jLineVersion}"
}
}
project('slime-test-spec') {
dependencies {
compile project(':slime')
}
}
def applyAppOptions = { Project p, String mainClass ->
p.with {
apply plugin: 'application'
mainClassName = mainClass
apply plugin: 'com.github.johnrengelman.shadow'
jar {
manifest {
attributes 'Main-Class': mainClass
}
}
shadowJar {
classifier ''
}
}
}
project('slime-test-app') {
applyAppOptions(it, 'space.maizy.slime.test.app.SlimeTestApp')
dependencies {
compile project(':slime-test-spec')
}
}
project('slime-jline3-test-app') {
applyAppOptions(it, 'space.maizy.slime.test.jline.SlimeJline3TestApp')
dependencies {
compile project(':slime-test-spec')
compile project(':slime-jline3')
}
}