forked from cyrille-artho/modbat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
100 lines (82 loc) · 2.79 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
/** Build script for Modbat. */
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.palantir.gradle.gitversion:gradle-git-version:0.11.0"
classpath "gradle.plugin.com.github.maiflai:gradle-scalatest:0.23"
}
}
plugins {
id "com.github.maiflai.scalatest" version "0.23"
}
apply plugin: 'application'
mainClassName = 'modbat.mbt.Main'
apply plugin: "com.palantir.git-version"
version gitVersion()
def gitDetails = versionDetails()
allprojects {
apply plugin: 'scala'
dependencies {
compile 'org.scala-lang:scala-library:2.11.8'
}
repositories {
mavenCentral()
}
tasks.withType(Jar) {
destinationDir = file("$rootDir/build")
}
jar {
archiveName = "${jar.baseName}.${jar.extension}"
manifest {
attributes 'Specification-Vendor': 'KTH',
'Implementation-Vendor': 'KTH',
'Implementation-Version': gitDetails.gitHashFull
}
}
}
dependencies {
compile 'org.ow2.asm:asm:4.0'
compile project(':config')
compile project(':akka-mock-scheduler')
testCompile 'org.hamcrest:hamcrest-core:1.3'
testCompile 'junit:junit:4.11'
testCompile 'org.scalatest:scalatest_2.11:3.0.1'
testRuntime 'org.pegdown:pegdown:1.4.2'
}
jar {
manifest {
attributes 'Main-Class': mainClassName,
'Name': 'modbat/mbt/',
'Specification-Title': 'Modbat: A model-based tester',
'Specification-Version': gitDetails.lastTag,
'Implementation-Title': 'Modbat'
}
from "LICENSE", "README", "CHANGELOG", "asm-LICENSE"
from configurations.runtimeClasspath.
findAll { it.name.endsWith('jar') && (it.name.contains('asm') || it.name.contains('config') || it.name.contains('akka')) }.
collect { zipTree(it) }
}
apply plugin: "com.github.maiflai.scalatest"
task examplesJar(type: Jar) {
archiveName = "modbat-examples.jar"
destinationDir = file("$buildDir")
from "$buildDir/classes/scala/test" findAll { it.name.endsWith('class') && it.path.contains('examples') }.collect { zipTree(it) }
from "$buildDir/classes/java/test" findAll { it.name.endsWith('class') && it.path.contains('examples')}.collect { zipTree(it) }
}
task testsJar(type: Jar) {
archiveName = "modbat-test.jar"
destinationDir = file("$buildDir")
from "$buildDir/classes/scala/test" findAll { it.name.endsWith('class')}.collect { zipTree(it) }
from "$buildDir/classes/java/test" findAll { it.name.endsWith('class')}.collect { zipTree(it) }
}
tasks.withType(Test) {
maxParallelForks = 1
}
test {
dependsOn examplesJar
dependsOn testsJar
}