-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
98 lines (81 loc) · 2.98 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
plugins {
id "com.github.ben-manes.versions" version "0.12.0"
id "com.github.hierynomus.license" version "0.11.0"
}
apply plugin: 'application'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'groovy'
version = '1.6-SNAPSHOT'
def fileEncoding = 'UTF-8'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
}
def googleGuavaVersion = '19.0'
def rxJavaVersion = '1.1.1'
def rxSwingVersion = '0.25.0'
def jcipVersion = '1.0'
def jsr305Version = '3.0.1'
def commonsLang3Version = '3.4'
def groovyVersion = '2.4.6'
def spockVersion = '1.0-groovy-2.4'
def cglibVersion = '3.2.1'
def awaitilityVersion = '1.7.0'
def swingXVersion = '1.6.5-1'
dependencies {
compile "com.google.guava:guava:${googleGuavaVersion}"
compile "io.reactivex:rxjava:${rxJavaVersion}"
compile "io.reactivex:rxswing:${rxSwingVersion}"
compile "net.jcip:jcip-annotations:${jcipVersion}"
compile "com.google.code.findbugs:jsr305:${jsr305Version}"
compile "org.apache.commons:commons-lang3:${commonsLang3Version}"
compile "org.swinglabs.swingx:swingx-all:${swingXVersion}"
testCompile "org.codehaus.groovy:groovy-all:${groovyVersion}"
testCompile("org.spockframework:spock-core:${spockVersion}") {
exclude group: 'org.codehaus.groovy'
}
testCompile("cglib:cglib:${cglibVersion}") // spock mocks
testCompile "com.jayway.awaitility:awaitility:${awaitilityVersion}"
}
sourceSets.main.java.srcDirs = ['src/main/java']
sourceSets.test.java.srcDirs = []
sourceSets.main.groovy.srcDirs = []
sourceSets.test.groovy.srcDirs = ['src/test/groovy']
test {
systemProperty 'file.encoding', fileEncoding
}
tasks.withType(JavaCompile) {
options.encoding = fileEncoding
}
jar {
manifest {
attributes 'Implementation-Title': project.name,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion
}
}
// work around unnecessary timestamp in generated file which always causes dirty files in version control
// https://issues.gradle.org/browse/GRADLE-2293
task adjustEclipseSettingsFile << {
ant.replaceregexp(match: '^#.*', replace: '', flags: 'g', byline: true) {
fileset(dir: project.projectDir, includes: '.settings/org.eclipse.jdt.core.prefs')
}
}
eclipseJdt.finalizedBy adjustEclipseSettingsFile
// http://forums.gradle.org/gradle/topics/set_maxparallelforks_to_number_of_cores_on_the_current_machine
tasks.withType(Test) {
maxParallelForks = Runtime.getRuntime().availableProcessors()
}
license {
header = rootProject.file('config/HEADER_apache2.txt')
strictCheck = true
}
// Set the default example number to 1 unless the user overrides, e.g. ./gradlew run -Pexample=7a
ext.example = project.hasProperty("example") ? project.getProperty("example") : '1'
run {
mainClassName = "ch.petikoch.examples.mvvm_rxjava.example${example}.Example_${example}_Main"
}