-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
163 lines (141 loc) · 5.19 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
155
156
157
158
159
160
161
162
163
import java.text.SimpleDateFormat
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.google.gradle:osdetector-gradle-plugin:1.7.3'
classpath 'org.javamodularity:moduleplugin:1.8.12'
}
}
plugins {
id 'java'
id 'application'
id 'signing'
id 'com.google.osdetector' version '1.7.3'
id 'org.javamodularity.moduleplugin' version '1.8.15'
id 'net.nemerosa.versioning' version '3.1.0'
}
apply plugin: 'signing'
normalization {
runtimeClasspath {
ignore('/META-INF/MANIFEST.MF')
}
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
Date buildTimeAndDate = new Date()
ext {
buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
platform = osdetector.os == 'osx' ? osdetector.arch == 'aarch_64' ? 'mac-aarch64' : 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os == 'linux' ? osdetector.arch == 'aarch_64' ? 'linux-aarch64' : 'linux' : osdetector.os
ciOssrhUsername = System.getenv('OSSRH_USERNAME')
ciOssrhPassword = System.getenv('OSSRH_PASSWORD')
ciGHUser = System.getenv('GH_USER')
ciGHToken = System.getenv('GH_TOKEN')
gpgkey = System.getenv("GPG_PRIVATE_KEY")
gpgpassphrase = System.getenv("PASSPHRASE")
}
dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')
implementation "org.openjfx:javafx-base:${javafxVersion}:${platform}"
implementation "org.openjfx:javafx-graphics:${javafxVersion}:${platform}"
implementation "org.openjfx:javafx-controls:${javafxVersion}:${platform}"
implementation "org.openjfx:javafx-media:${javafxVersion}:${platform}"
implementation "org.openjfx:javafx-swing:${javafxVersion}:${platform}"
implementation 'eu.hansolo:jdktools:21.0.11'
implementation 'eu.hansolo:toolbox:21.0.15'
implementation 'eu.hansolo:toolboxfx:21.0.7'
implementation 'eu.hansolo:applefx:21.0.3'
implementation 'com.google.code.gson:gson:2.10.1'
//implementation 'com.dustinredmond.fxtrayicon:FXTrayIcon:4.0.1'
implementation 'com.dustinredmond.fxtrayicon:FXTrayIcon:3.1.2'
}
application {
mainModule = 'eu.hansolo.fx.glucostatus'
}
mainClassName = 'eu.hansolo.fx.glucostatus.Launcher'
description = 'GlucostatusFX is a tool to visualize data coming from a nightscout server'
jar {
from {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
manifest {
attributes(
'Built-By' : System.properties['user.name'],
'Created-By' : System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.properties['java.vm.version'] + ")",
'Build-Date' : project.buildDate,
'Build-Time' : project.buildTime,
'Build-Revision' : versioning.info.commit,
'Specification-Title' : project.name,
'Specification-Version' : project.version,
'Implementation-Title' : project.name,
'Implementation-Version': project.version,
'Bundle-Name' : project.name,
'Bundle-License' : 'https://www.apache.org/licenses/LICENSE-2.0;description=Apache License Version 2.0;link=https://spdx.org/licenses/Apache-2.0.html',
'Bundle-Description' : description,
'Bundle-SymbolicName' : 'eu.hansolo.fx.glucostatus',
'Class-Path' : '${project.name}-${project.version}.jar',
'Main-Class' : 'eu.hansolo.fx.glucostatus.Launcher'
)
}
}
// start app from gradle
task Main(type: JavaExec) {
mainClass = "eu.hansolo.fx.glucostatus.Launcher"
classpath = sourceSets.main.runtimeClasspath
}
// create properties file including the version
task createProperties(dependsOn: processResources) {
doLast {
new File("$buildDir//classes/java/main/eu/hansolo/fx/glucostatus/version.properties").withWriter { w ->
Properties p = new Properties()
p['version'] = project.version.toString()
p.store w, null
}
}
}
classes {
dependsOn createProperties
}
// Fix problems with loading resources
sourceSets {
main {
//output.setResourcesDir(java.outputDir)
output.resourcesDir = file('build/classes/java/main')
//java.destinationDirectory.set(file('build/classes/java/main'))
}
}
//processResources {
// from(sourceSets.main.java.srcDirs) {
// include '**/*.properties'
// }
//}
run {
inputs.property("moduleName", moduleName)
doFirst {
jvmArgs = [
'--module-path', classpath.asPath,
'--module', mainClassName
]
classpath = files()
}
}
/*
signing {
useGpgCmd()
sign configurations.archives
}
*/