-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
109 lines (93 loc) · 3.68 KB
/
build.gradle
File metadata and controls
109 lines (93 loc) · 3.68 KB
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
/*
* Copyright 2026 The Terasology Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'destination-sol-common'
id 'destination-sol-jre'
id 'edu.sc.seis.launch4j' version '4.0.0'
}
project.ext.mainClassName = "org.destinationsol.desktop.SolSteamDesktop"
dependencies {
implementation project(":engine")
implementation project(':desktop')
implementation "com.code-disaster.steamworks4j:steamworks4j:1.10.0"
implementation "com.code-disaster.steamworks4j:steamworks4j-gdx:1.10.0"
annotationProcessor "org.terasology.gestalt:gestalt-inject-java:$gestaltVersion"
}
// Adds Resources as parameter for AnnotationProcessor (gather ResourceIndex,
// also add resource as input for compilejava, for re-gathering ResourceIndex, when resource was changed.
compileJava {
inputs.files sourceSets.main.resources.srcDirs
options.compilerArgs = ["-Aresource=${sourceSets.main.resources.srcDirs.join(File.pathSeparator)}"]
}
tasks.register('runSteam', JavaExec) {
dependsOn classes
//TODO: Remove extra args when the splash screen works on Macs again - see https://github.com/MovingBlocks/DestinationSol/issues/414
if (System.properties["os.name"].toLowerCase().contains("mac")) {
jvmArgs = ["-splash:../engine/src/main/resources/assets/textures/mainMenu/mainMenuLogo.png", "-XstartOnFirstThread", "-Dlog4j.configuration=log4j-debug.properties"]
String[] runArgs = ["-noSplash"]
args runArgs
} else {
jvmArgs = ["-splash:../engine/src/main/resources/assets/textures/mainMenu/mainMenuLogo.png", "-Dlog4j.configuration=log4j-debug.properties"]
}
mainClass = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
workingDir = rootProject.projectDir
ignoreExitValue true
}
jar {
archiveFileName = "solSteamDesktop.jar"
manifest {
def manifestClasspath = configurations.runtimeClasspath.collect { it.getName() }.join(" ")
attributes 'Main-Class': project.mainClassName
attributes("Class-Path": manifestClasspath)
attributes "SplashScreen-Image": "mainMenuLogo.png"
}
}
tasks.register('steamLibsDist', Copy) {
dependsOn jar
from jar
from configurations.runtimeClasspath
into("${distsDirectory.getAsFile().get()}/app/libs")
}
tasks.register('copySteamLaunchers', Copy) {
description = "Copy steam launchers into the distribution folder."
dependsOn createExe
from("$projectDir/launcher")
include('*.sh', '*.exe')
into("${distsDirectory.getAsFile().get()}/app")
}
tasks.register('distSteam') {
description = "Creates an application package suitable for deploying to steam."
group 'Distribution'
dependsOn ':desktop:libsDist'
dependsOn ':desktop:moduleDist'
dependsOn ':desktop:copyLaunchers'
dependsOn steamLibsDist
dependsOn copySteamLaunchers
copy {
from("${project(':desktop').distsDirectory.getAsFile().get()}/app")
into("${distsDirectory.getAsFile().get()}/app")
}
}
launch4j {
outfile = 'solSteam.exe'
libraryDir = 'libs'
icon = "${projectDir}/launcher/sol.ico"
dontWrapJar = true
bundledJrePath = 'lwjre'
copyConfigurable = []
}