forked from HanSolo/jarkanoid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
120 lines (104 loc) · 4.03 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
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-library'
id 'application'
id 'com.google.osdetector' version '1.7.1'
id 'org.javamodularity.moduleplugin' version '1.8.12'
id 'net.nemerosa.versioning' version '3.0.0'
}
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.gradle:osdetector-gradle-plugin:1.7.1'
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}"
}
application.mainModule = 'eu.hansolo.fx.jarkanoid'
mainClassName = 'eu.hansolo.fx.jarkanoid.Launcher'
description = 'Arkanoid clone written in JavaFX'
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.jarkanoid',
'Class-Path' : '${project.name}-${project.version}.jar',
'Main-Class' : 'eu.hansolo.fx.jarkanoid.Launcher'
)
}
}
// start the from gradle
task Main(type: JavaExec) {
mainClass = "eu.hansolo.fx.jarkanoid.Launcher"
classpath = sourceSets.main.runtimeClasspath
}
// 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()
}
}