Skip to content
This repository was archived by the owner on Nov 26, 2019. It is now read-only.

Commit 5d3cf11

Browse files
committed
# Cleanup (See below)
* Remove installer (javafx-gradle-plugin) * Remove signed builds - ability * Exclude SQLite linux natives and win32 natives * Update readme * Fix initial launcher startup
1 parent 2f17604 commit 5d3cf11

File tree

11 files changed

+44
-223
lines changed

11 files changed

+44
-223
lines changed

README.md

Lines changed: 8 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ Overall, you have 3 options:
4949

5050
The latest `launcher.jar` is available under https://github.com/Bios-Marcel/ServerBrowser/releases/latest , but it will **require** you to have Java 8 or later installed, i strongly suggest installing **Java 9**, since future versions of this project will use **Java 9**.
5151

52-
#### Downloading the latest Installer
52+
#### Downloading the latest Installer (NOT SUPPORTED ANYMORE)
5353

54-
The latest installer is also available under https://github.com/Bios-Marcel/ServerBrowser/releases/latest
54+
The latest installer is also available under https://github.com/Bios-Marcel/ServerBrowser/releases/tag/8.5.7
5555
Unlike when using the `launcher.jar` file, the installer **won't require** you to download anything other than the installer itself.
56+
The installer isn't supported after version 8.5.7 anymore.
5657

5758
#### Build all the stuff yourself
5859

@@ -97,7 +98,7 @@ There is a light and a dark theme, here are screenshots including both themes:
9798

9899
![Settings Light](https://i.imgur.com/CVds2Od.png)
99100

100-
## Documentation
101+
## Documentation (Outdated)
101102

102103
Javadoc is available under: (https://bios-marcel.github.io/ServerBrowser-Doc/overview-summary.html)
103104

@@ -425,19 +426,6 @@ enterServerPasswordMessage=Enter the servers password (Leave empty if you think
425426

426427
This project is managed using [gradle](https://gradle.org).
427428

428-
### Structure
429-
430-
The project formerly consisted of 3 subprojects, those were `client`, `server` and `shared`, but since the backend has
431-
been removed, `shared` and `client` got merged into `client`.
432-
433-
```
434-
ServerBrowser The parent project
435-
|__ client The Windows GUI client with which humans interact
436-
```
437-
438-
At some point the project structure might get to see a refactoring, since the multi-project structure isn't necessary
439-
in this case.
440-
441429
### Building with Gradle
442430

443431
To see which tasks are available, run:
@@ -467,16 +455,15 @@ $ cd client
467455
$ ../gradlew run
468456
```
469457

470-
Or run it from the parent project by prefixing the task with the subprojects name and a ":" (colon).
458+
Assemble and test the build outputs. You will find the results in the __build__ folder of __client__.
471459

472460
``` shell
473-
$ ./gradlew client:run
461+
$ ./gradlew build
474462
```
475463

476-
Assemble and test the build outputs. You will find the results in the __build__ folder of __client__.
477-
464+
In order to build a runnable `.jar` file, run:
478465
``` shell
479-
$ ./gradlew build
466+
$ ./gradlew shadowJar
480467
```
481468

482469
### Syncing gradle with Eclipse
@@ -493,75 +480,5 @@ $ ./gradlew eclipseClean eclipse
493480

494481
Eclipse will instantly reload the fresh project settings files.
495482

496-
### Pipeline
497-
498-
__ServerBrowser__ utilizes advanced build techniques in order to assemble and optimize the output. The goal is to build the smallest possible 'self-contained' executable for Windows for the client.
499-
500-
__self-contained__ in this context means the JVM is bundled with the output.
501-
502-
In order to achieve this the following 2 step process is used:
503-
504-
1. Put all build outputs into a single JAR (fat JAR), including (transitive) dependencies.
505-
2. Bundle the optimized JAR with a JVM and build a native container around them (exe/deb).
506-
507-
These steps map to these tools:
508-
509-
1. [Gradle Shadow Plugin](http://imperceptiblethoughts.com/shadow/#introduction)
510-
2. [javapackager](https://github.com/FibreFoX/javafx-gradle-plugin) + [JavaFX-Gradle-Plugin](https://github.com/FibreFoX/javafx-gradle-plugin)
511-
512-
Our build scripts are largely glue around those tools.
513-
514-
### Building the native output
515-
516-
``` shell
517-
$ ./gradlew jfxNative
518-
```
519-
520-
This will generate an installable artifact in `client/build/jfx/native`. Depending on which platform you are building from, an EXE is generated on Windows, DEB/RPM on Linux and PKG/DMG on OSX.
521-
522-
We support Windows and Linux and in order to be able to generate an installer, some dependencies need to be installed.
523-
524-
#### Windows
525-
526-
- Inno Setup 5 or later
527-
528-
#### Linux (rpm)
529-
530-
- RPMBuild
531-
532-
#### Linux (deb)
533-
534-
- Debian packaging tools
535-
536-
### Javapackager
537-
538-
The underlying technology for building native installer bundles is `javapackager`.
539-
Learn more about it here:
540-
541-
- https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html
542-
- https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html
543-
- https://docs.oracle.com/javase/8/docs/technotes/tools/unix/javapackager.html
544-
545-
### Realising a signed build
546-
547-
Our builds are cryptographically signed. In order to build with signing enabled you need to setup 2 things.
548-
549-
* A `local.properties` file:
550-
551-
```
552-
localSecretKeystorePassword = "choose super secret pw"
553-
localSecretKeyPassword = "choose super secret pw yet again!"
554-
```
555-
556-
* A keystore and private key
557-
558-
Once you have your passwords setup, these can automatically generated for you with:
559-
560-
``` shell
561-
$ ./gradlew jfxGenerateKeyStore
562-
```
563-
564-
None of these files should __ever__ be committed to version control !
565-
566483
## You need help?
567484
[Send me an E-Mail](mailto:[email protected])

build.gradle

Lines changed: 16 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
/*
2-
* When using plugins in gradle, we need to tell it where it can download them:
3-
*/
41
buildscript {
52
repositories {
63
jcenter()
74
maven { url 'https://jitpack.io' }
85
}
9-
ext.kotlin_version = '1.2.31'
6+
7+
ext.kotlin_version = '1.2.41'
108
dependencies {
11-
classpath 'de.dynamicfiles.projects.gradle.plugins:javafx-gradle-plugin:8.8.+'
129
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.+'
1310
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1411
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M4'
@@ -26,16 +23,16 @@ apply plugin: 'org.junit.platform.gradle.plugin'
2623
apply plugin: 'eclipse'
2724
apply plugin: 'idea'
2825

29-
mainClassName = "com.msc.serverbrowser.Client"
26+
mainClassName = 'com.msc.serverbrowser.Client'
3027

3128
compileKotlin {
3229
kotlinOptions {
33-
jvmTarget = "1.8"
30+
jvmTarget = '1.8'
3431
}
3532
}
3633
compileTestKotlin {
3734
kotlinOptions {
38-
jvmTarget = "1.8"
35+
jvmTarget = '1.8'
3936
}
4037
}
4138

@@ -64,11 +61,8 @@ dependencies {
6461
compile 'com.github.albfernandez:juniversalchardet:2.0.+'
6562
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
6663

67-
//javapacker for native build. This will only be necessary if the userJvmOptions are used
68-
//compile files("${System.properties['java.home']}/../lib/packager.jar")
69-
70-
testCompile("org.junit.jupiter:junit-jupiter-api:5.0.0-M4")
71-
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.0.0-M4")
64+
testCompile 'org.junit.jupiter:junit-jupiter-api:5.0.0-M4'
65+
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.0.0-M4'
7266
}
7367

7468
/*
@@ -78,120 +72,34 @@ task wrapper(type: Wrapper) {
7872
gradleVersion = gradleWrapperVersion
7973
}
8074

81-
/*
82-
* Load private and secret properties!
83-
*/
84-
def localProps = project.rootProject.file('local.properties')
85-
if (localProps.exists()) {
86-
Properties properties = new Properties()
87-
properties.load(localProps.newDataInputStream())
88-
ext.localSecretKeystorePassword = properties.getProperty('localSecretKeystorePassword')
89-
ext.localSecretKeyPassword = properties.getProperty('localSecretKeyPassword')
90-
} else {
91-
//for the travis build we set the secrets via environment variables, because these can be encrypted with travis api
92-
ext.localSecretKeystorePassword = System.getenv("KEYSTORE_PW")
93-
ext.localSecretKeyPassword = System.getenv("KEY_PW")
94-
}
95-
96-
9775
apply plugin: 'com.github.johnrengelman.shadow'
9876
shadowJar {
77+
baseName = 'launcher'
78+
classifier = null
79+
version = null
80+
9981
/*
10082
* WARNING! Changes to excludes/includes only seem to take effect after a "clean" with gradle.
10183
* I am not sure where the bug lies, but this should not happen with gradle...
10284
*/
103-
//Excluding binary stuff for unsupported platforms
10485

86+
//Excluding binary stuff for unsupported platforms
10587
exclude 'org/sqlite/native/Linux/android-arm/**'
10688
exclude 'org/sqlite/native/Linux/arm/**'
10789
exclude 'org/sqlite/native/Linux/armv6/**'
10890
exclude 'org/sqlite/native/Linux/armv7/**'
10991
exclude 'org/sqlite/native/Linux/ppc64/**'
92+
exclude 'org/sqlite/native/Linux/x86/**'
93+
exclude 'org/sqlite/native/Linux/x86_64/**'
11094
exclude 'org/sqlite/native/FreeBSD/**'
11195
exclude 'org/sqlite/native/Mac/**'
112-
//Theoretically, in a distant future, one could kill windows 32bit support...
113-
//exclude 'org/sqlite/native/Windows/x86/**'
11496

115-
//Linux x86 bit support already killed
116-
exclude 'org/sqlite/native/Linux/x86/**'
97+
//If you are still using 32-bit ... fuck you ;)
98+
exclude 'org/sqlite/native/Windows/x86/**'
11799

118100
//Trash
119101
exclude 'META-INF/maven/**'
120102

121103
//Merges all service file under "META-INF/services" to one
122104
mergeServiceFiles()
123105
}
124-
125-
/*
126-
* The 'javafx-gradle-plugin' can generate executable JARs, exe, deb, RPM and DMG files.
127-
* Shadow generates a fat JAR.
128-
* Proguard is an optimizer.
129-
*/
130-
apply plugin: 'javafx-gradle-plugin'
131-
jfx {
132-
verbose = true
133-
134-
mainClass = mainClassName
135-
println("$mainClass")
136-
vendor = projectVendor
137-
138-
// String - setting this for windows-bundlers makes it possible to generate upgradeable installers (using same GUID)
139-
identifier = "$projectGroup" + "." + "$rootProject.name" + "." + "$projectVendor" + "." + "$projectVersion"
140-
141-
nativeReleaseVersion = "$projectVersion"
142-
143-
//bundler = "RPM"
144-
145-
//useful during debugging. but when all bundles are tried, some WILL ALWAYS fail, because EXE can only be built on windows, DEB/RPM on linux and PKG/DMG on OSX.
146-
//failOnError = true
147-
148-
//TODO
149-
//icon under linux does not work
150-
//remove libs from native bundle
151-
//jvmArgs = ['-Xmx=128m','-Xms=64m'] //this syntax is wrong
152-
//remove eclipse annotations
153-
//signing
154-
155-
needShortcut = true
156-
needMenu = true
157-
158-
bundleArguments = [
159-
copyright : "TODO",
160-
email : "TODO",
161-
category : "Game",
162-
"win.menuGroup": "Game",
163-
licenseType : 'MPLv2.0',
164-
//because windows is "special", it requires "special" file formats for the license...
165-
licenseFile : org.gradle.internal.os.OperatingSystem.current().isWindows() ? 'license.rtf' : 'LICENSE'
166-
]
167-
// per default the outcome of the gradle "jarTask" will be used, set this to specify otherwise (like proguard-output)
168-
alternativePathToJarFile = "$libsDir/$shadowJar.baseName-$shadowJar.version-$shadowJar.classifier" + ".jar"
169-
copyAdditionalAppResourcesToJar = true
170-
skipCopyingDependencies = true
171-
useLibFolderContentForManifestClasspath = true
172-
173-
// this is used for files below "src/main/deploy", e.g. "src/main/deploy/windows/$rootProject.name.ico"
174-
appName = "SA-MP-ServerBrowser"
175-
additionalAppResources = 'src/main/additionalFiles'
176-
jfxMainAppJarName = "$appName" + ".jar"
177-
178-
//precompiles the CSS to binary. Useful performance gain, if the CSS files are not modified during runtime
179-
css2bin = true
180-
181-
// gradle jfxGenerateKeyStore
182-
keyStore = "src/main/deploy/keystore.jks"
183-
keyStoreAlias = "$projectVendor" + "-" + "$rootProject.name"
184-
// assumes you have a file "local.properties" which does NOT get version controlled!
185-
keyStorePassword = "$localSecretKeystorePassword"
186-
keyPassword = "$localSecretKeyPassword"
187-
keyStoreType = "jks"
188-
overwriteKeyStore = false
189-
190-
certDomain = "$projectGroup" // required
191-
certOrgUnit = "$projectVendor" // defaults to "none"
192-
certOrg = "$projectVendor" // required
193-
certState = "Lower Saxony" // required
194-
certCountry = "Germany" // required
195-
}
196-
197-
jfxJar.dependsOn shadowJar

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
projectVersion = 8.5.7
1+
projectVersion = 8.5.8
22
projectGroup = me.marcelschr.samp
33
projectVendor = Bios-Marcel
44
gradleWrapperVersion = 4.6
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Mon Apr 30 15:51:17 CEST 2018
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

src/main/kotlin/com/msc/serverbrowser/Client.kt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class Client : Application() {
6767

6868
override fun start(primaryStage: Stage) {
6969
loadUI(primaryStage)
70+
primaryStage.titleProperty().bind(mainController.titleProperty)
7071

7172
// Only update if not in development mode
7273
if (!isDevelopmentModeActivated) {
@@ -190,15 +191,6 @@ class Client : Application() {
190191
}.start()
191192
}
192193

193-
/**
194-
* Adds nodes to the Clients bottom bar.
195-
*
196-
* @param nodes the node that will be added
197-
*/
198-
fun addItemsToBottomBar(vararg nodes: Node) {
199-
mainController.addItemsToBottomBar(*nodes)
200-
}
201-
202194
/**
203195
* Downloads the latest version and restarts the client.
204196
*/
@@ -358,6 +350,7 @@ class Client : Application() {
358350
var languageResourceBundle: ResourceBundle
359351

360352
init {
353+
createFolderStructure()
361354
val locale = Locale(ClientPropertiesController.getProperty(LanguageProperty))
362355
languageResourceBundle = ResourceBundle.getBundle("com.msc.serverbrowser.localization.Lang", locale)
363356
}
@@ -371,7 +364,6 @@ class Client : Application() {
371364
*/
372365
@JvmStatic
373366
fun main(args: Array<String>) {
374-
createFolderStructure()
375367
Thread.setDefaultUncaughtExceptionHandler { thread, exception ->
376368
Logging.error("Uncaught exception in thread: $thread", exception)
377369
Platform.runLater { UncaughtExceptionHandlerView(UncaughtExceptionHandlerController(), exception).show() }

src/main/kotlin/com/msc/serverbrowser/FXExtension.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ package com.msc.serverbrowser
33
import javafx.scene.layout.Region
44
import javafx.stage.Window
55

6-
fun Region.getWindow(): Window = this.scene.window
6+
fun Region.getWindow(): Window? = this.scene?.window

src/main/kotlin/com/msc/serverbrowser/constants/PathConstants.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ object PathConstants {
2424
private val CACHE = SAMPEX_PATH + File.separator + "cache"
2525
val CLIENT_CACHE = CACHE + File.separator + "clientversions"
2626
val SAMP_CMD = SAMPEX_PATH + File.separator + "sampcmd.exe"
27+
val TEMP_INSTALLER_ZIP = SAMPEX_PATH + File.separator + "tempInstaller.zip"
28+
val TEMP_INSTALLER_EXE = SAMPEX_PATH + File.separator + "tempInstaller.exe"
2729

2830
// GTA / SAMP specific Paths
2931
private val GTA_USER_FILES = (FileSystemView.getFileSystemView().defaultDirectory.path + File.separator
@@ -33,6 +35,4 @@ object PathConstants {
3335
val SAMP_CFG = SAMP_PATH + File.separator + "sa-mp.cfg"
3436
val SAMP_CHATLOG = "$SAMP_PATH\\chatlog.txt"
3537
val SAMP_USERDATA = "$SAMP_PATH\\USERDATA.DAT"
36-
val TEMP_INSTALLER_ZIP = SAMPEX_PATH + File.separator + "tempInstaller.zip"
37-
val TEMP_INSTALLER_EXE = SAMPEX_PATH + File.separator + "tempInstaller.exe"
3838
}

0 commit comments

Comments
 (0)