-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
113 lines (95 loc) · 3.24 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
plugins {
id 'org.jetbrains.kotlin.jvm' version "1.4.21"
id 'org.openjfx.javafxplugin' version "0.0.8"
}
def KOTLIN_VERSION = "1.4.21"
group 'org.epistatic'
// make sure local.properties exist and load them
def localProperties = new Properties()
if (!file(localConfig).exists()) {
throw new GradleException("Local configuration file $localConfig not found. Please create this file " +
"and add these properties (detailed in README.md) -\n" +
"JFX_VERSION, JFX_PATH, JDK")
}
file(localConfig).withInputStream { localProperties.load(it) }
repositories {
mavenCentral()
jcenter()
flatDir {
dirs "${localProperties.JFX_PATH}/lib"
}
maven {
url "https://repository.mulesoft.org/nexus/content/repositories/public/"
}
}
apply plugin: 'application'
mainClassName = 'org.installmation.InstallmationApplication'
javafx {
version = localProperties.JFX_VERSION
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.swing' ]
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
compile "com.google.guava:guava:28.1-jre"
compile "com.google.code.gson:gson:2.8.6"
compile "org.apache.logging.log4j:log4j-api:2.12.1"
compile "org.apache.logging.log4j:log4j-core:2.12.1"
compile "com.github.imcdonagh:image4j:0.7.2"
testCompile "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION"
testCompile "junit:junit:4.12" // testfx does not support Junit 5
testCompile "org.assertj:assertj-core:3.13.2"
testCompile "io.mockk:mockk:1.9.3"
testCompile "org.testfx:testfx-core:4.0.16-alpha"
testCompile "org.testfx:testfx-junit:4.0.16-alpha"
testCompile "org.testfx:openjfx-monocle:jdk-12.0.1+2"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
// tests run in headless mode by default, to watch tests pass in -DshowTests=true on command line
test {
if (System.getProperty('showTests') != null)
systemProperty 'headless', false
else
systemProperty 'headless', true
}
jar {
manifest.attributes('Multi-Release': 'false')
// load build number as plain old props file
def props = new Properties()
def propFile = file('build.number')
props.load(new FileInputStream(propFile))
def build = props["build.number"]
doFirst {
version = "$majorVersion.$minorVersion.$build"
}
}
task libs(type: Sync) {
from configurations.runtime
into "$buildDir/deplibs"
}
task runApp(type: JavaExec) {
group = "Application"
description = "Runs Installmation Application"
classpath sourceSets.main.runtimeClasspath
main = mainClassName
doFirst {
jvmArgs = [
'--module-path', "${localProperties.JFX_PATH}/lib",
'--add-modules', 'javafx.fxml,javafx.controls'
]
}
}
// Before release update version and build
task syncBuildNumber() {
def props = new Properties()
file("build.number").withInputStream { props.load(it) }
def buildNumber = props["build.number"]
new File("src/main/resources/version.properties").text = "# automatically generated\n" +
"majorVersion=$majorVersion\n" +
"minorVersion=$minorVersion\n" +
"buildNumber=$buildNumber\n"
}