mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-31 16:44:37 +01:00
Compare commits
9 Commits
performanc
...
v0.6.21-pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a71e8fe0a4 | ||
|
|
a76d425ab7 | ||
|
|
ea4fab6f09 | ||
|
|
26aec7cef4 | ||
|
|
0425a0f79e | ||
|
|
5ff45746d8 | ||
|
|
f14d21e322 | ||
|
|
c9cccf9eb2 | ||
|
|
5191f56a01 |
6
.gitattributes
vendored
Normal file
6
.gitattributes
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Set default behavior to automatically normalize line endings.
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
# Force bash scripts to always use LF line endings so that if a repo is accessed
|
||||||
|
# in Unix via a file share from Windows, the scripts will work.
|
||||||
|
*.sh text eol=lf
|
||||||
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
@@ -16,8 +16,9 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Reading version from file:"
|
echo "Reading version from file:"
|
||||||
cat packaging/ATCS_latest
|
cat res/ATCS_latest
|
||||||
VERSION=$(cat packaging/ATCS_latest)
|
echo ""
|
||||||
|
VERSION=$(tr -d '[:space:]' < "res/ATCS_latest")
|
||||||
echo "Processed version: $VERSION"
|
echo "Processed version: $VERSION"
|
||||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
echo "Environment variable set to: $VERSION"
|
echo "Environment variable set to: $VERSION"
|
||||||
@@ -26,7 +27,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
distribution: 'adopt'
|
distribution: 'temurin'
|
||||||
|
|
||||||
- name: Build JAR
|
- name: Build JAR
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -41,8 +42,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Install NSIS
|
- name: Install NSIS
|
||||||
uses: joncloud/makensis-action@v4
|
uses: joncloud/makensis-action@v4
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
with:
|
with:
|
||||||
script-file: packaging/Windows/ATCS_Installer.nsi
|
script-file: packaging/Windows/ATCS_Installer.nsi
|
||||||
arguments: /DVERSION="${{ env.VERSION }}"
|
arguments: /DVERSION="${{ env.VERSION }}"
|
||||||
|
|||||||
2
packaging/Linux/.gitignore
vendored
2
packaging/Linux/.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
/ATCS_v*.zip
|
|
||||||
/ATCS_v*.zip.rename
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
@echo off
|
|
||||||
|
|
||||||
set "ATCS_DIR=%~dp0"
|
|
||||||
set "MAX_MEM=512M"
|
|
||||||
set "CP=%ATCS_DIR%lib\*"
|
|
||||||
set "JAVA=javaw.exe"
|
|
||||||
set "JAVA_OPTS=-DFONT_SCALE=1.0 -Dswing.aatext=true"
|
|
||||||
set "ENV_FILE=%ATCS_DIR%ATCS.env.bat"
|
|
||||||
set "MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio"
|
|
||||||
|
|
||||||
if exist "%ENV_FILE%" (
|
|
||||||
call "%ENV_FILE%"
|
|
||||||
) else (
|
|
||||||
echo REM set "MAX_MEM=%MAX_MEM%">"%ENV_FILE%"
|
|
||||||
echo REM set "JAVA=%JAVA%">>"%ENV_FILE%"
|
|
||||||
echo REM set "JAVA_OPTS=%JAVA_OPTS%">>"%ENV_FILE%"
|
|
||||||
echo.>>"%ENV_FILE%"
|
|
||||||
)
|
|
||||||
|
|
||||||
start "" "%JAVA%" %JAVA_OPTS% -Xmx%MAX_MEM% -cp "%CP%" %MAIN_CLASS%
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
@@ -1,22 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
ATCS_DIR=$(dirname $(readlink -f "$0" || greadlink -f "$0" || stat -f "$0"))
|
|
||||||
MAX_MEM=512M
|
|
||||||
CP=$(find ${ATCS_DIR}/lib/ -name '*.jar' | paste -sd: -)
|
|
||||||
JAVA=java
|
|
||||||
JAVA_OPTS='-DFONT_SCALE=1.0 -Dswing.aatext=true'
|
|
||||||
ENV_FILE=${ATCS_DIR}/ATCS.env
|
|
||||||
MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio
|
|
||||||
|
|
||||||
if [ -f ${ENV_FILE} ]
|
|
||||||
then
|
|
||||||
source ${ENV_FILE}
|
|
||||||
else
|
|
||||||
echo "#MAX_MEM=${MAX_MEM}" > ${ENV_FILE}
|
|
||||||
echo "#JAVA=${JAVA}" >> ${ENV_FILE}
|
|
||||||
echo "#JAVA_OPTS=${JAVA_OPTS}" >> ${ENV_FILE}
|
|
||||||
echo "" >> ${ENV_FILE}
|
|
||||||
fi
|
|
||||||
|
|
||||||
export ENV_FILE
|
|
||||||
|
|
||||||
$JAVA ${JAVA_OPTS} -Xmx${MAX_MEM} -cp ${CP} ${MAIN_CLASS}
|
|
||||||
1
packaging/Linux/ATCS/lib/.gitignore
vendored
1
packaging/Linux/ATCS/lib/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
/*.jar
|
|
||||||
@@ -1,21 +1,26 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
ATCS_DIR=$(dirname $(readlink -f "$0" || greadlink -f "$0" || stat -f "$0"))
|
ATCS_DIR="$(dirname "$(readlink -f "$0" || greadlink -f "$0" || stat -f "$0")")"
|
||||||
|
echo "ATCS_DIR: '${ATCS_DIR}'"
|
||||||
|
|
||||||
MAX_MEM=512M
|
MAX_MEM="512M"
|
||||||
|
JAVA="java"
|
||||||
JAVA=java
|
|
||||||
JAVA_OPTS='-DFONT_SCALE=1.0 -Dswing.aatext=true'
|
JAVA_OPTS='-DFONT_SCALE=1.0 -Dswing.aatext=true'
|
||||||
ENV_FILE=${ATCS_DIR}/ATCS.env
|
|
||||||
|
|
||||||
if [ -f ${ENV_FILE} ]; then
|
ENV_FILE="${ATCS_DIR}/ATCS.env"
|
||||||
source ${ENV_FILE}
|
|
||||||
|
if [ -f "${ENV_FILE}" ]; then
|
||||||
|
source "${ENV_FILE}"
|
||||||
else
|
else
|
||||||
echo "#MAX_MEM=${MAX_MEM}" >${ENV_FILE}
|
{
|
||||||
echo "#JAVA=${JAVA}" >>${ENV_FILE}
|
echo "#MAX_MEM=\"${MAX_MEM}\""
|
||||||
echo "#JAVA_OPTS=${JAVA_OPTS}" >>${ENV_FILE}
|
echo "#JAVA=\"${JAVA}\""
|
||||||
echo "" >>${ENV_FILE}
|
echo "#JAVA_OPTS=\"${JAVA_OPTS}\""
|
||||||
|
echo ""
|
||||||
|
}>"${ENV_FILE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export ENV_FILE
|
export ENV_FILE
|
||||||
|
|
||||||
$JAVA ${JAVA_OPTS} -Xmx${MAX_MEM} -jar ${ATCS_DIR}/ATCS.jar
|
# shellcheck disable=SC2086
|
||||||
|
# (spellchecker is disabled for this line, because we want it to be split into multiple arguments)
|
||||||
|
$JAVA ${JAVA_OPTS} -Xmx${MAX_MEM} -jar "${ATCS_DIR}/ATCS.jar"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ ATCS_SOURCE_DIR=$(dirname "${PACKAGING_DIR}")
|
|||||||
TEMP_DIR="${PACKAGING_DIR}/tmp"
|
TEMP_DIR="${PACKAGING_DIR}/tmp"
|
||||||
JAR_LOCATION="${PACKAGING_DIR}/ATCS.jar" # Output JAR location as per script
|
JAR_LOCATION="${PACKAGING_DIR}/ATCS.jar" # Output JAR location as per script
|
||||||
MANIFEST_LOCATION="${PACKAGING_DIR}/Manifest.txt"
|
MANIFEST_LOCATION="${PACKAGING_DIR}/Manifest.txt"
|
||||||
VERSION_FILE="${PACKAGING_DIR}/ATCS_latest"
|
VERSION_FILE="${ATCS_SOURCE_DIR}/res/ATCS_latest"
|
||||||
SOURCE_BASE_DIR="${ATCS_SOURCE_DIR}/src" # Base directory for standard source code
|
SOURCE_BASE_DIR="${ATCS_SOURCE_DIR}/src" # Base directory for standard source code
|
||||||
LIB_BASE_DIR="${ATCS_SOURCE_DIR}/lib" # Base directory for libraries
|
LIB_BASE_DIR="${ATCS_SOURCE_DIR}/lib" # Base directory for libraries
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ EXTRA_SOURCE_DIRS=(
|
|||||||
"siphash-zackehh/src/main/java"
|
"siphash-zackehh/src/main/java"
|
||||||
)
|
)
|
||||||
|
|
||||||
# --- Libraries to include (from IntelliJ artifact definition) ---
|
# --- Libraries to include ---
|
||||||
LIBRARIES=(
|
LIBRARIES=(
|
||||||
"AndorsTrainer_v0.1.5.jar"
|
"AndorsTrainer_v0.1.5.jar"
|
||||||
"bsh-2.0b4.jar"
|
"bsh-2.0b4.jar"
|
||||||
@@ -44,7 +44,7 @@ LIBRARIES=(
|
|||||||
|
|
||||||
# --- Get version ---
|
# --- Get version ---
|
||||||
echo "Getting version"
|
echo "Getting version"
|
||||||
VERSION=$(cat "${VERSION_FILE}")
|
VERSION=$(tr -d '[:space:]' < "${VERSION_FILE}")
|
||||||
echo "Got version ${VERSION}"
|
echo "Got version ${VERSION}"
|
||||||
|
|
||||||
# --- Prepare temporary directory ---
|
# --- Prepare temporary directory ---
|
||||||
@@ -62,7 +62,7 @@ done
|
|||||||
|
|
||||||
# --- Set ClassPath ---
|
# --- Set ClassPath ---
|
||||||
echo "Getting source files"
|
echo "Getting source files"
|
||||||
# Find all java files in source directories and compile them
|
# Find all java files in source directories
|
||||||
SOURCE_FILES=$(find "${SOURCE_BASE_DIR}" "${EXTRA_SOURCE_DIRS[@]/#/${ATCS_SOURCE_DIR}/}" -name "*.java" -print)
|
SOURCE_FILES=$(find "${SOURCE_BASE_DIR}" "${EXTRA_SOURCE_DIRS[@]/#/${ATCS_SOURCE_DIR}/}" -name "*.java" -print)
|
||||||
#echo "SourceFiles: ${SOURCE_FILES}"
|
#echo "SourceFiles: ${SOURCE_FILES}"
|
||||||
echo ""
|
echo ""
|
||||||
@@ -70,6 +70,8 @@ echo ""
|
|||||||
# --- Build Java classes ---
|
# --- Build Java classes ---
|
||||||
echo 'Building java classes'
|
echo 'Building java classes'
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
# (we need word splitting here to pass multiple files)
|
||||||
javac -cp "${TEMP_DIR}" -d "${TEMP_DIR}" ${SOURCE_FILES}
|
javac -cp "${TEMP_DIR}" -d "${TEMP_DIR}" ${SOURCE_FILES}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Compilation failed. Please check errors above."
|
echo "Compilation failed. Please check errors above."
|
||||||
@@ -84,6 +86,7 @@ mkdir -p "${TEMP_DIR}/com/gpl/rpg/atcontentstudio/img"
|
|||||||
mkdir -p "${TEMP_DIR}/tiled/io/resources/"
|
mkdir -p "${TEMP_DIR}/tiled/io/resources/"
|
||||||
cp -r "${ATCS_SOURCE_DIR}"/src/com/gpl/rpg/atcontentstudio/img/* "${TEMP_DIR}/com/gpl/rpg/atcontentstudio/img/" # some icons
|
cp -r "${ATCS_SOURCE_DIR}"/src/com/gpl/rpg/atcontentstudio/img/* "${TEMP_DIR}/com/gpl/rpg/atcontentstudio/img/" # some icons
|
||||||
cp -r "${ATCS_SOURCE_DIR}"/hacked-libtiled/tiled/io/resources/* "${TEMP_DIR}/tiled/io/resources/" # dtd file for tmx maps
|
cp -r "${ATCS_SOURCE_DIR}"/hacked-libtiled/tiled/io/resources/* "${TEMP_DIR}/tiled/io/resources/" # dtd file for tmx maps
|
||||||
|
cp "${VERSION_FILE}" "${TEMP_DIR}/" # Copy version file
|
||||||
|
|
||||||
# --- Create JAR file ---
|
# --- Create JAR file ---
|
||||||
echo ""
|
echo ""
|
||||||
@@ -114,7 +117,10 @@ else
|
|||||||
# Use zip command on Linux
|
# Use zip command on Linux
|
||||||
zip -r "ATCS_${VERSION}.zip" common/* # archive the 'common' folder which now contains the JAR and libs
|
zip -r "ATCS_${VERSION}.zip" common/* # archive the 'common' folder which now contains the JAR and libs
|
||||||
fi
|
fi
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Archive creation failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo "Created archive at ${PACKAGING_DIR}/ATCS_${VERSION}.zip"
|
echo "Created archive at ${PACKAGING_DIR}/ATCS_${VERSION}.zip"
|
||||||
cd "${PACKAGING_DIR}" || exit
|
|
||||||
|
|
||||||
echo "Script finished."
|
echo "Script finished."
|
||||||
|
|||||||
@@ -14,11 +14,7 @@ import java.io.InputStreamReader;
|
|||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Enumeration;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
@@ -42,8 +38,7 @@ import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
|
|||||||
public class ATContentStudio {
|
public class ATContentStudio {
|
||||||
|
|
||||||
public static final String APP_NAME = "Andor's Trail Content Studio";
|
public static final String APP_NAME = "Andor's Trail Content Studio";
|
||||||
public static final String APP_VERSION = "v0.6.21";
|
public static final String APP_VERSION = readVersionFromFile();
|
||||||
|
|
||||||
public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest";
|
public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest";
|
||||||
public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806";
|
public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806";
|
||||||
|
|
||||||
@@ -231,4 +226,13 @@ public class ATContentStudio {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private static String readVersionFromFile() {
|
||||||
|
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
|
||||||
|
Objects.requireNonNull(ATContentStudio.class.getResourceAsStream("/ATCS_latest"))))) {
|
||||||
|
return reader.readLine();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user