forked from manuelperuzzi/Collabora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
81 lines (66 loc) · 2.75 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
group "${group}"
version "${version}"
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'com.github.johnrengelman.shadow'
sourceCompatibility = "${jdkVersion}"
def scalaVersion = "${scalaMajorVersion}.${scalaMinorVersion}"
repositories {
mavenCentral()
}
dependencies {
compile "org.scala-lang:scala-library:${scalaVersion}"
compile group: 'com.typesafe.akka', name: 'akka-actor_2.12', version: "${akkaVersion}"
compile "com.typesafe.akka:akka-stream_2.12:${akkaVersion}"
compile "com.typesafe.akka:akka-http_2.12:${akkaHttpVersion}"
compile "com.typesafe.akka:akka-http-testkit_2.12:${akkaHttpVersion}"
compile "org.reactivemongo:reactivemongo_2.12:${reactiveMongoVersion}"
compile "org.reactivemongo:reactivemongo-play-json_2.12:${reactiveMongoPlayJSONVersion}"
compile "org.reactivemongo:play2-reactivemongo_2.12:${reactiveMongoPlayVersion}"
compile "com.typesafe.play:play-json_2.12:${playFrameworkVersion}"
compile group: 'com.newmotion', name: 'akka-rabbitmq_2.12', version: "${akkaRabbitMQVersion}"
compile "ch.qos.logback:logback-classic:${logbackClassicVersion}"
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: "${httpClientVersion}"
testCompile group: 'junit', name: 'junit', version: "${jUnitVersion}"
testCompile group: 'org.scalatest' , name: 'scalatest_2.12' , version: "${scalaTestVersion}"
testCompile group: 'com.typesafe.akka' , name: 'akka-testkit_2.12' , version: "${akkaTestKitVersion}"
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
}
}
compileScala {
scalaCompileOptions.additionalParameters = ["-feature"]
}
task restoreDBTask(type: Exec) {
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'cmd', '/c', 'mongorestore --drop -d collabora ./MongoDBBackup/collabora/'
} else {
commandLine 'sh', '-c', 'mongorestore --drop -d collabora ./MongoDBBackup/collabora/'
}
}
task spec(dependsOn: ['testClasses'], type: JavaExec) {
tasks.restoreDBTask.execute()
main = 'org.scalatest.tools.Runner'
args = ['-R', 'build/classes/test', '-o']
classpath = sourceSets.test.runtimeClasspath
}
testClasses.doLast {
tasks.spec.execute()
}
shadowJar {
baseName = "${artifactId}-redist"
manifest {
attributes 'Implementation-Title': 'Collabora',
'Implementation-Version': version,
'Main-Class': 'org.gammf.collabora.EntryPoint'
}
transform(com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer) {
resource = 'reference.conf'
}
}
defaultTasks 'clean', 'build', 'check', 'javadoc', 'scalaDoc', 'assemble', 'shadowJar'