Skip to content

Commit

Permalink
Optimize Distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
isHarryh committed Dec 24, 2023
1 parent dde8a92 commit 7db99c3
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 21 deletions.
1 change: 0 additions & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ allprojects {
apply plugin: "java-library"
apply plugin: "org.openjfx.javafxplugin"

version = "2.3.1"
version = "2.4.0"
ext {
// App Metadata
appName = "ArkPets"
Expand Down
2 changes: 1 addition & 1 deletion core/src/cn/harryh/arkpets/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
public final class Const {
// App version
public static final Version appVersion = new Version(2, 3, 1);
public static final Version appVersion = new Version(2, 4, 0);

// App name
public static final String appName = "ArkPets";
Expand Down
18 changes: 11 additions & 7 deletions desktop/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ project.ext.mainClassName = "cn.harryh.arkpets.DesktopLauncher"
project.ext.assetsDir = new File("../assets")
eclipse.project.name = appName + "-desktop"

import java.lang.Exception
import org.gradle.internal.os.OperatingSystem

// Runs the app without debug.
Expand Down Expand Up @@ -90,13 +89,18 @@ task jlink(dependsOn: distJar, type: Exec, group: 'dist') {
'--vm=server',
'--compress=1',
'--include-locales', jlinkLocalesList
]
] as List<String>
outputs.dir(jlinkRuntimeDir)
}

// Packs the app into an EXE.
task jpackage(dependsOn: jlink, type: Exec, group: 'dist') {
doFirst() { delete jpackageDir }
doFirst() {
fileTree(jarLibDir).size()
if (fileTree(jarLibDir).size() > 1)
throw new RuntimeException("There may be legacy jars in the libs dir, please run 'clean' first.")
delete jpackageDir
}
doLast() {
copy {
from "${project.rootDir}/LICENSE"
Expand All @@ -107,7 +111,7 @@ task jpackage(dependsOn: jlink, type: Exec, group: 'dist') {
workingDir project.projectDir
def commands = [
"${javaHome}/bin/jpackage",
'--input', "${buildDir}/libs",
'--input', jarLibDir,
'--dest', jpackageDir,
'--type', 'app-image',
'--name', project.appName,
Expand Down Expand Up @@ -153,13 +157,13 @@ task distExe(dependsOn: jpackage, type: Exec, group: 'dist') {
// Generates ALL kinds of distributing files.
task distAll(dependsOn: [distJar, distZip, distExe], group: 'dist') {
doLast() {
print("\tAll files were successfully generated.")
println("All files were successfully generated, see: ${new File(distDir as String).absolutePath}")
try {
delete "${buildDir}/tmp"
delete jpackageDir
delete jarLibDir
} catch (Exception e) {
print("\tUnable to delete temp files.")
} catch (Exception ignored) {
println("Unable to delete temp files.")
}
}
}
6 changes: 3 additions & 3 deletions docs/scripts/ChineseSimplified.isl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ ErrorTooManyFilesInDir=

; *** Setup common messages
ExitSetupTitle=退出安装
ExitSetupMessage=安装引导尚未完成。如果您现在退出,安装将会被取消%n%n您可以稍后运行安装包以重新安装%n%n确认退出安装?
ExitSetupMessage=如果您退出安装,安装将会被取消。%n%n确认退出安装?
AboutSetupMenuItem=关于安装程序(&A)...
AboutSetupTitle=关于安装程序
AboutSetupMessage=%1 版本 %2%n%3%n%n%1 主页:%n%4
Expand Down Expand Up @@ -351,8 +351,8 @@ ConfirmUninstall=
UninstallOnlyOnWin64=该程序只能在 64位 Windows 中进行卸载。
OnlyAdminCanUninstall=该程序需要用户以 管理员身份 进行卸载。
UninstallStatusLabel=正在从您的计算机中卸载 %1,请稍作等待...
UninstalledAll=%1 已顺利地从您的计算机中卸载。期待与您的再次相见
UninstalledMost=%1 卸载完成%n%n有一些内容无法被删除,您可以手动删除它们。
UninstalledAll=%1 已顺利地完成了卸载。%n%n期待与您的再次相见
UninstalledMost=%1 的卸载已完成%n%n有一些内容无法被删除,您可以手动删除它们。
UninstalledAndNeedsRestart=要完成 [name] 的安装,我们必须重新启动您的计算机。%n%n是否立即重新启动?
UninstallDataCorrupted=文件 "%1" 已损坏,无法继续进行卸载

Expand Down
6 changes: 3 additions & 3 deletions docs/scripts/ChineseTraditional.isl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ ErrorTooManyFilesInDir=

; *** Setup common messages
ExitSetupTitle=退出安裝
ExitSetupMessage=安裝引導尚未完成。如果您現在退出,安裝將會被取消%n%n您可以稍後運行安裝包以重新安裝%n%n確認退出安裝?
ExitSetupMessage=如果您退出安裝,安裝將會被取消。%n%n確認退出安裝?
AboutSetupMenuItem=關於安裝程式(&A)...
AboutSetupTitle=關於安裝程式
AboutSetupMessage=%1 版本 %2%n%3%n%n%1 主頁:%n%4
Expand Down Expand Up @@ -351,8 +351,8 @@ ConfirmUninstall=
UninstallOnlyOnWin64=該程式只能在 64位 Windows 中進行卸載。
OnlyAdminCanUninstall=該程式需要用戶以 管理員身份 進行卸載。
UninstallStatusLabel=正在從您的計算機中卸載 %1,請稍作等待...
UninstalledAll=%1 已順利地從您的計算機中卸載。期待與您的再次相見
UninstalledMost=%1 卸載完成%n%n有一些內容無法被刪除,您可以手動刪除它們。
UninstalledAll=%1 已順利地完成了卸載。%n%n期待與您的再次相見
UninstalledMost=%1 的卸載已完成%n%n有一些內容無法被刪除,您可以手動刪除它們。
UninstalledAndNeedsRestart=要完成 [name] 的安裝,我們必須重新啟動您的計算機。%n%n是否立即重新啟動?
UninstallDataCorrupted=文件 "%1" 已損壞,無法繼續進行卸載

Expand Down
11 changes: 6 additions & 5 deletions docs/scripts/ExePacking.iss
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
; *** Inno Setup Script for ArkPets ***
; This script is based on Inno Setup 6, a free installer for Windows programs.
; Documentation: https://jrsoftware.org/ishelp.php
; Download Inno Setup: https://jrsoftware.org/isdl.php

#define MyAppName "ArkPets"
#define MyAppVersion "2.3.1"
#define MyAppVersion "2.4.0"
#define MyAppPublisher "Harry Huang"
#define MyAppURL "https://arkpets.harryh.cn/"

Expand All @@ -18,17 +19,17 @@ AppVerName ="{#MyAppName} {#MyAppVersion}"
AppPublisher ={#MyAppPublisher}
AppPublisherURL ={#MyAppURL}
AppSupportURL ={#MyAppURL}
AppUpdatesURL ={#MyAppURL}

AllowNoIcons =yes
Compression =lzma2/max
DefaultDirName =/{#MyAppName}
DefaultDirName ="{userpf}\{#MyAppName}"
DefaultGroupName ={#MyAppName}
AllowNoIcons =yes
; Remove the following line to run in administrative install mode (install for all users.)
PrivilegesRequired =lowest
OutputBaseFilename ={#MyAppName}-v{#MyAppVersion}-Setup
OutputDir =..\..\desktop\build\dist
SetupIconFile =..\..\assets\icons\icon.ico
SolidCompression =yes
UninstallDisplayIcon={app}\{#MyAppName}.ico
WizardStyle =modern

[Languages]
Expand Down

0 comments on commit 7db99c3

Please sign in to comment.