forked from JFXtras/jfxtras-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
94 lines (77 loc) · 2.77 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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'eclipse'
apply plugin: 'idea'
buildscript {
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
dependencies {
classpath "eu.mihosoft.vrl.vlicense-header-util:VLicenseHeaderUtil:0.1-r2-SNAPSHOT"
classpath "eu.mihosoft.vrl.vlicense-header-util.gradle:vlicense-header-plugin:0.1-r2-SNAPSHOT"
}
}
final javaHome = System.env['JAVA_HOME']
if (javaHome) {
ext.javafxJar = "${javaHome}/jre/lib/jfxrt.jar"
}
try {
println "JavaFX runtime jar: ${ext.javafxJar}"
dependencies {
classpath files(ext.javafxJar)
// vrl license header plugin
classpath "eu.mihosoft.vrl.vlicense-header-util.gradle:vlicense-header-plugin:0.1-r2-SNAPSHOT"
}
} catch (MissingPropertyException mpe) {
println """
| Please set the environment variable JAVA_HOME
| to the directory that contains jre/lib/jfxrt.jar
| of JavaFX version ${jfxtras_requiredJavaFxVersion}.\n""".stripMargin()
System.exit 1
}
}
// apply vrl license header plugin
if (!project.plugins.findPlugin(eu.mihosoft.vrl.vlicenseheaderutil.gradle.VLicenseHeaderPlugin)) {
project.apply(plugin: eu.mihosoft.vrl.vlicenseheaderutil.gradle.VLicenseHeaderPlugin)
}
repositories {
mavenRepo urls: "https://oss.sonatype.org/content/repositories/snapshots/"
mavenCentral()
}
dependencies {
compile files(ext.javafxJar, "lib/jsr-310-ri-0.6.3.jar", "lib/jsr-310-TZDB-all-0.6.3.jar")
testCompile "junit:junit:${jfxtras_junitVersion}","org.mockito:mockito-all:1.9.5"
testCompile "net.java.jemmy:JemmyFX:0.9.3-SNAPSHOT"
}
apply {
from 'gradle/mavenCentralDeploy.gradle'
}
// license template (will be used as header in all Java source files)
repairHeaders.licenseHeaderText = new File(projectDir,"license-template.txt")
task buildTimestamped(type: Copy, dependsOn: 'build') {
from 'build/libs'
into 'build/libs/timestamped'
include '*.jar'
rename { String fileName ->
fileName.replace('SNAPSHOT', "SNAPSHOT-${new Date().format('HH-mm-dd-MM-yyyy')}")
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.7'
}
signArchives.onlyIf {
project.hasProperty('signing.keyId')
}
uploadArchives.onlyIf {
project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
}
task copyToLib(type: Copy) {
into "_lib"
from configurations.testCompile
}
test {
systemProperty 'tiles.source', "${project.buildDir}/resources/test/jfxtras/labs/map/tile"
}