forked from iuginP/pps-17-cw-mp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
125 lines (98 loc) · 3.81 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
group = projectGroup
version = projectVersion
description = projectDescription
def jarDestinationFolder = "${rootDir.path}$productionJarFolder"
def scalaStyleResPath = "${rootDir.path}$scalaStyleResFile"
def scalaStyleOutputPath = "${buildDir.path}$scalaStyleOutput"
allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'com.dorongold.task-tree'
repositories {
// Repositories where to find libraries
jcenter()
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'org.scoverage'
apply plugin: 'com.github.maiflai.scalatest'
apply plugin: 'scalaStyle'
sourceCompatibility = "$jdkVersion"
javadoc.destinationDir = file("$docsFolderJava/${project.name}")
scaladoc.destinationDir = file("$docsFolderScala/${project.name}")
dependencies {
if (project.name != 'core')
implementation project(':core')
implementation 'org.scala-lang:scala-library:2.12.2'
implementation 'com.typesafe.scala-logging:scala-logging_2.12:3.9.0'
implementation 'io.vertx:vertx-lang-scala_2.12:3.5.2'
if (project.name == "core" || project.parent.name == "services") {
implementation 'io.vertx:vertx-web-scala_2.12:3.5.2'
implementation 'io.vertx:vertx-web-client-scala_2.12:3.5.2'
}
if (project.name != 'core-testing')
testImplementation project(':core-testing')
testImplementation 'org.scalatest:scalatest_2.12:3.0.1'
testRuntime 'org.pegdown:pegdown:1.6.0'
scoverage 'org.scoverage:scalac-scoverage-plugin_2.12:1.3.1'
scoverage 'org.scoverage:scalac-scoverage-runtime_2.12:1.3.1'
}
if (project.name == 'client' || project.name == 'discovery' || project.name == 'rooms' || project.name == 'authentication') {
apply plugin: 'com.github.johnrengelman.shadow'
shadowJar {
baseName = artifactId
version = projectVersion
classifier = project.name
destinationDir = file(jarDestinationFolder)
mergeServiceFiles('reference.conf') // solves problems with AKKA
}
}
if (project.name == 'core' || project.parent.name == 'services') {
// tests that use database, should run sequentially
tasks.withType(Test) {
maxParallelForks = 1
}
}
scalaStyle {
configLocation = scalaStyleResPath
includeTestSourceDirectory = true
source = "$scalaStyleSource"
testSource = "$scalaStyleTestSource"
outputFile = scalaStyleOutputPath
failOnWarning = false
}
clean {
// delete production folder
delete(file(jarDestinationFolder))
ant.delete dir: "latest-reports"
ant.delete dir: "latest-docs"
}
reportScoverage.doLast {
ant.move file: "${buildDir}/reports/scoverage",
todir: "latest-reports/${project.name}"
}
build.finalizedBy scalaStyle
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.org.scoverage:gradle-scoverage:2.3.0"
classpath "gradle.plugin.com.github.maiflai:gradle-scalatest:0.22"
// Plug-in to show scalaStyle warnings
// Usage: gradlew <project> scalaStyle
classpath "org.github.ngbinh.scalastyle:gradle-scalastyle-plugin_2.11:1.0.1"
// Plug-in to show task dependencies tree
// Usage: gradlew <task 1>...<task N> taskTree
classpath "gradle.plugin.com.dorongold.plugins:task-tree:1.3"
// Plug-in to create executable jars
// Usage: gradlew <project> shadowJar
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
}
}
defaultTasks 'clean', 'build', 'javadoc', 'scaladoc', 'reportScoverage'