-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
72 lines (59 loc) · 1.71 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
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
plugins {
id 'java'
id 'application'
// use for javafx support
id 'org.openjfx.javafxplugin' version '0.0.10'
}
sourceCompatibility = 11
targetCompatibility = 11
def mainClassName = "edv.memmel.example.Main"
application {
mainClass.set(mainClassName)
}
group 'edv.memmel'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
//implementation files('libs/some_local_library_jar_file.jar')
}
// Use for JavaFX project:
javafx {
version = '17'
modules = ['javafx.controls', 'javafx.fxml']
}
test {
useJUnitPlatform()
}
task javaFxJar(type: Jar) {
dependsOn compileJava
//destinationDirectory = file("${rootDir}/releases")
OperatingSystem operatingSystem = DefaultNativePlatform.currentOperatingSystem;
if (operatingSystem.isWindows()) {
archiveBaseName = "example-win"
} else if (operatingSystem.isMacOsX()) {
archiveBaseName = "example-osx"
} else if (operatingSystem.isLinux()) {
archiveBaseName = "example-linux"
} else {
archiveBaseName = "example"
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
from(sourceSets.main.output) {
include "**"
//exclude "**/TestServerClients.class"
//exclude "**/client/Client.class"
//exclude "**/view/*"
}
manifest {
// a non-javafx main class is needed for jars
attributes 'Main-Class': mainClassName
}
}