From 7acc745478b63cdba96f6b80b2b0f60805187b98 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Wed, 19 May 2021 02:31:56 +0430 Subject: [PATCH] Merge the two windows bundlers --- .gitattributes | 3 ++- AndroidCompat/getAndroid.ps1 | 1 - AndroidCompat/getAndroid.sh | 15 ++++++-------- README.md | 2 +- scripts/windows32-bundler.ps1 | 38 +++++++++++++++++++++++++++++++++++ scripts/windows64-bundler.ps1 | 38 +++++++++++++++++++++++++++++++++++ 6 files changed, 85 insertions(+), 12 deletions(-) create mode 100644 scripts/windows32-bundler.ps1 create mode 100644 scripts/windows64-bundler.ps1 diff --git a/.gitattributes b/.gitattributes index e75b5fa..646c1b8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -24,4 +24,5 @@ *.woff binary *.pyc binary *.swp binary -*.pdf binary \ No newline at end of file +*.pdf binary +*.exe binary \ No newline at end of file diff --git a/AndroidCompat/getAndroid.ps1 b/AndroidCompat/getAndroid.ps1 index caa2b59..cbc4a7f 100644 --- a/AndroidCompat/getAndroid.ps1 +++ b/AndroidCompat/getAndroid.ps1 @@ -87,7 +87,6 @@ function Dedupe($path) } Dedupe "AndroidCompat/src/main/java" -Dedupe "server/src/main/java" Dedupe "server/src/main/kotlin" Write-Output "Copying Android.jar to library folder..." diff --git a/AndroidCompat/getAndroid.sh b/AndroidCompat/getAndroid.sh index 53e53e2..f1136ef 100755 --- a/AndroidCompat/getAndroid.sh +++ b/AndroidCompat/getAndroid.sh @@ -20,7 +20,7 @@ fi # foolproof against running from AndroidCompat dir instead of running from project root -if [ "$(basename $(pwd))" = "AndroidCompat" ]; then +if [ "$(basename "$(pwd)")" = "AndroidCompat" ]; then cd .. fi @@ -59,7 +59,7 @@ zip --delete android.jar javax/* echo "Removing java..." zip --delete android.jar java/* -echo "Removing overriden classes..." +echo "Removing overridden classes..." zip --delete android.jar android/app/Application.class zip --delete android.jar android/app/Service.class zip --delete android.jar android/net/Uri.class @@ -68,12 +68,12 @@ zip --delete android.jar android/os/Environment.class zip --delete android.jar android/text/format/Formatter.class zip --delete android.jar android/text/Html.class -# Dedup overriden Android classes +# Dedup overridden Android classes ABS_JAR="$(realpath android.jar)" function dedup() { pushd "$1" - CLASSES="$(find * -type f)" - echo "$CLASSES" | while read class + CLASSES="$(find ./* -type f)" + echo "$CLASSES" | while read -r class do NAME="${class%.*}" echo "Processing class: $NAME" @@ -82,13 +82,10 @@ function dedup() { popd } -pushd .. +popd dedup AndroidCompat/src/main/java -dedup server/src/main/java dedup server/src/main/kotlin -popd -popd echo "Copying Android.jar to library folder..." mv tmp/android.jar AndroidCompat/lib diff --git a/README.md b/README.md index 6ec0a14..1a6b45a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ | Build | Stable | Preview | Support Server | |-------|----------|---------|---------| -| ![CI](https://github.com/Suwayomi/Tachidesk/actions/workflows/build_push.yml/badge.svg) | [![stable release](https://img.shields.io/github/release/Suwayomi/Tachidesk.svg?maxAge=3600&label=download)](https://github.com/Suwayomi/Tachidesk/releases) | [![preview](https://img.shields.io/badge/dynamic/json?url=https://github.com/Suwayomi/Tachidesk/raw/preview/index.json&label=download&query=$.latest&color=blue)](https://github.com/Suwayomi/Tachidesk/tree/preview/latest_pointer) | [![Discord](https://img.shields.io/discord/801021177333940224.svg?label=discord&labelColor=7289da&color=2c2f33&style=flat)](https://discord.gg/DDZdqZWaHA) | +| ![CI](https://github.com/Suwayomi/Tachidesk/actions/workflows/build_push.yml/badge.svg) | [![stable release](https://img.shields.io/github/release/Suwayomi/Tachidesk.svg?maxAge=3600&label=download)](https://github.com/Suwayomi/Tachidesk/releases) | [![preview](https://img.shields.io/badge/dynamic/json?url=https://github.com/Suwayomi/Tachidesk/raw/preview/index.json&label=download&query=$.latest&color=blue)](https://github.com/Suwayomi/Tachidesk/tree/preview/) | [![Discord](https://img.shields.io/discord/801021177333940224.svg?label=discord&labelColor=7289da&color=2c2f33&style=flat)](https://discord.gg/DDZdqZWaHA) | # Tachidesk drawing diff --git a/scripts/windows32-bundler.ps1 b/scripts/windows32-bundler.ps1 new file mode 100644 index 0000000..addf297 --- /dev/null +++ b/scripts/windows32-bundler.ps1 @@ -0,0 +1,38 @@ +# Copyright (C) Contributors to the Suwayomi project +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +Write-Output "Downloading jre..." + +$jre="OpenJDK8U-jre_x86-32_windows_hotspot_8u292b10.zip" +if (!(Test-Path $jre)) { + Invoke-WebRequest -Uri "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jre_x86-32_windows_hotspot_8u292b10.zip" -OutFile $jre -UseBasicParsing +} + +Write-Output "creating windows bundle" + +$jar=$(Get-ChildItem ../server/build/Tachidesk-*.jar) +$release_name=$jar.BaseName + "-win32" + +# make release dir +New-Item -ItemType Directory $release_name + +Expand-Archive $jre -DestinationPath "./" -ErrorAction SilentlyContinue + +# move jre +Move-Item "jdk8u292-b10-jre" "$release_name/jre" + +Copy-Item $jar.FullName "$release_name/Tachidesk.jar" + +Copy-Item "resources/Tachidesk Launcher-win32.exe" $release_name +Copy-Item "resources/Tachidesk Launcher.bat" $release_name +Copy-Item "resources/Tachidesk Debug Launcher.bat" $release_name + +$zip_name="$release_name.zip" +Compress-Archive -CompressionLevel Optimal -DestinationPath $zip_name -Path $release_name -Force -ErrorAction SilentlyContinue + +Remove-Item -Force -Recurse $release_name + +Move-Item $zip_name "../server/build/" -ErrorAction SilentlyContinue diff --git a/scripts/windows64-bundler.ps1 b/scripts/windows64-bundler.ps1 new file mode 100644 index 0000000..b243c62 --- /dev/null +++ b/scripts/windows64-bundler.ps1 @@ -0,0 +1,38 @@ +# Copyright (C) Contributors to the Suwayomi project +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +Write-Output "Downloading jre..." + +$jre="OpenJDK8U-jre_x64_windows_hotspot_8u292b10.zip" +if (!(Test-Path $jre)) { + Invoke-WebRequest -Uri "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jre_x64_windows_hotspot_8u292b10.zip" -OutFile $jre -UseBasicParsing +} + +Write-Output "creating windows bundle" + +$jar=$(Get-ChildItem ../server/build/Tachidesk-*.jar) +$release_name=$jar.BaseName + "-win64" + +# make release dir +New-Item -ItemType Directory $release_name + +Expand-Archive $jre -DestinationPath "./" -ErrorAction SilentlyContinue + +# move jre +Move-Item "jdk8u292-b10-jre" "$release_name/jre" + +Copy-Item $jar.FullName "$release_name/Tachidesk.jar" + +Copy-Item "resources/Tachidesk Launcher-win64.exe" $release_name +Copy-Item "resources/Tachidesk Launcher.bat" $release_name +Copy-Item "resources/Tachidesk Debug Launcher.bat" $release_name + +$zip_name="$release_name.zip" +Compress-Archive -CompressionLevel Optimal -DestinationPath $zip_name -Path $release_name -Force -ErrorAction SilentlyContinue + +Remove-Item -Force -Recurse $release_name + +Move-Item $zip_name "../server/build/" -ErrorAction SilentlyContinue