forked from HanSolo/JDKMon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
151 lines (131 loc) · 4.95 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
import java.text.SimpleDateFormat
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.google.gradle:osdetector-gradle-plugin:1.7.1'
classpath 'org.javamodularity:moduleplugin:1.8.12'
}
}
plugins {
id 'java'
id 'application'
id 'signing'
id 'com.google.osdetector' version '1.7.1'
id 'org.javamodularity.moduleplugin' version '1.8.12'
id 'net.nemerosa.versioning' version '3.0.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 'com.google.code.gson:gson:2.10'
implementation 'io.foojay.api:discoclient:2.0.35'
implementation 'eu.hansolo:jdktools:17.0.27'
implementation 'com.google.gradle:osdetector-gradle-plugin:1.7.1'
//implementation 'com.dustinredmond.fxtrayicon:FXTrayIcon:4.0.1'
implementation 'com.dustinredmond.fxtrayicon:FXTrayIcon:3.1.2'
implementation 'io.github.1tchy.java9modular.org.apache.commons:commons-compress:1.21.0'
implementation 'org.tukaani:xz:1.9'
implementation "org.openjfx:javafx-base:${javafxVersion}:${platform}"
implementation "org.openjfx:javafx-graphics:${javafxVersion}:${platform}"
implementation "org.openjfx:javafx-controls:${javafxVersion}:${platform}"
}
application.mainModule = 'eu.hansolo.fx.jdkmon'
mainClassName = 'eu.hansolo.fx.jdkmon.Launcher'
description = 'JDKMon is a little tool written in JavaFX that will help you to keep track of updates for your installed distributions of OpenJDK'
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.jdkmon',
'Class-Path' : '${project.name}-${project.version}.jar',
'Main-Class' : 'eu.hansolo.fx.jdkmon.Launcher'
)
}
}
// start the from gradle
task Main(type: JavaExec) {
mainClass = "eu.hansolo.fx.jdkmon.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/jdkmon/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.classesDirectory)
}
}
run {
inputs.property("moduleName", moduleName)
doFirst {
jvmArgs = [
'--module-path', classpath.asPath,
'--module', mainClassName
]
classpath = files()
}
}
/*
signing {
useGpgCmd()
sign configurations.archives
}
*/