-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·154 lines (133 loc) · 5.11 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import java.nio.file.Paths
//import org.gradle.internal.os.OperatingSystem
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.1.0'
}
javafx {
version = "17.0.11"
modules = [ 'javafx.fxml','javafx.controls', 'javafx.media', 'javafx.web', 'javafx.swing' ]
}
repositories {
mavenCentral()
}
test {
useJUnitPlatform()
}
def jacksonCore = "2.17.1"
def mockito = "5.12.0"
def jUnit5 = "5.10.2"
def assertJ = "3.25.3"
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.32'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
implementation 'ch.qos.logback:logback-classic:1.5.6'
implementation "com.fasterxml.jackson.core:jackson-core:$jacksonCore"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonCore"
implementation "com.fasterxml.jackson.core:jackson-annotations:$jacksonCore"
implementation 'pl.project13.maven:git-commit-id-plugin:4.9.10'
implementation "org.openjfx:javafx-base:$javafx.version"
implementation "org.openjfx:javafx-controls:$javafx.version"
implementation "org.openjfx:javafx-graphics:$javafx.version"
implementation "org.openjfx:javafx-controls:$javafx.version"
implementation "org.openjfx:javafx-fxml:$javafx.version"
implementation 'com.google.guava:guava:33.2.0-jre'
testImplementation "org.junit.jupiter:junit-jupiter-api:$jUnit5"
testImplementation "org.junit.jupiter:junit-jupiter-engine:$jUnit5"
testImplementation "org.mockito:mockito-core:$mockito"
testImplementation "org.mockito:mockito-junit-jupiter:$mockito"
testImplementation "org.mockito:mockito-inline:5.2.0"
testImplementation "org.assertj:assertj-core:$assertJ"
}
group 'download-station-helper'
def appVersion = "3.0.3"
def fxMainClassName = 'pg.Java11Main'
def jarName = "DSHelper-11+"
def buildDirPath = layout.buildDirectory.get().getAsFile().getAbsolutePath()
mainClassName = fxMainClassName
def copyApplicationProperties = copySpec {
from 'src/main/resources/distro'
include '*.properties','credentials'
}
tasks.register('copyToLib', Copy) {
into Paths.get(buildDirPath, 'libs', 'lib').toString()
from configurations
}
tasks.register('versionTxt') {
doLast {
new File(Paths.get(buildDirPath, 'resources', 'main', 'version.txt').toString()).text = "$appVersion"
}
}
tasks.register('copyAppPropertiesTask', Copy) {
into Paths.get(buildDirPath, 'libs', 'settings').toString()
with copyApplicationProperties
}
jar {
dependsOn copyToLib, copyAppPropertiesTask, versionTxt
manifest {
attributes 'Implementation-Title': 'DownloadStationHelper',
'Implementation-Version': appVersion,
'Main-Class': mainClassName,
'Class-path': configurations.runtimeClasspath.collect { 'lib/' + it.getName() }.join(' ')
}
archiveBaseName.set(jarName)
}
/*//create a single Jar with all dependencies
task oneJar(type: Jar) {
dependsOn copyAppPropertiesTask
manifest {
attributes 'Implementation-Title': 'DownloadStationHelper',
'Implementation-Version': appVersion,
'Main-Class': mainClassName
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}*/
/*
def jarNameFx = "DSHelper-FX11+"
def addScriptToRunFXFile = {
String osName = OperatingSystem.current().getName();
String osVersion = OperatingSystem.current().getVersion();
println "*** $osName $osVersion was detected."
String runFile = "runFX-$javafx.version"
if (OperatingSystem.current().isLinux()) {
runFile += '.sh';
} else if (OperatingSystem.current().isUnix()) {
// Consider UNIX.
} else if (OperatingSystem.current().isWindows()) {
runFile += '.bat';
} else if (OperatingSystem.current().isMacOsX()) {
// Consider OS X.
} else {
// Unknown OS.
}
def runImdbFile = Paths.get(buildDir.getAbsolutePath(), 'libs', runFile).toFile()
//runImdbFile.append('echo \'Start program\'')
//runImdbFile.append('\necho \'.............\'')
runImdbFile.append('\n\n%J11%\\bin\\java ')
runImdbFile.append('--module-path %JFX11% ')
runImdbFile.append('--add-modules=javafx.fxml,javafx.controls,javafx.media,javafx.web,javafx.swing ')
runImdbFile.append('--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED ')
runImdbFile.append('--add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED ')
runImdbFile.append('-jar ')
runImdbFile.append(jarNameFx)
runImdbFile.append('.jar')
//runImdbFile.append('\n\necho \'.............\'')
//runImdbFile.append('\necho \'Program ended\'')
println("addScriptToRunFXFile $jarNameFx")
}*/
/*//create a FX Jar
task fxJar(type: Jar) {
dependsOn copyToLib, copyAppPropertiesTask, versionTxt
manifest {
attributes 'Implementation-Title': 'DownloadStationHelper',
'Implementation-Version': appVersion,
'Main-Class': fxMainClassName,
'Class-path': configurations.compile.collect { 'lib/' + it.getName() }.join(' ')
}
doLast {
addScriptToRunFXFile()
}
archiveBaseName = jarNameFx
with jar
}*/