Skip to content

Commit e357ca9

Browse files
committed
Merge remote-tracking branch 'upstream/master' into native-code-script
2 parents 4c59d55 + 73f4397 commit e357ca9

File tree

6 files changed

+64
-30
lines changed

6 files changed

+64
-30
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/compile.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
id: create_draft_release
2121
uses: actions/create-release@v1
2222
env:
23-
GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACCESS_TOKEN }}
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424
with:
2525
tag_name: ${{ env.RELEASE_VERSION }}
2626
release_name: ${{ env.RELEASE_VERSION }}
@@ -30,7 +30,7 @@ jobs:
3030
- name: Upload universalJavaApplicationStub.sh asset
3131
uses: actions/upload-release-asset@v1
3232
env:
33-
GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACCESS_TOKEN }}
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3434
with:
3535
upload_url: ${{ steps.create_draft_release.outputs.upload_url }}
3636
asset_name: universalJavaApplicationStub.sh
@@ -80,7 +80,7 @@ jobs:
8080
- name: Upload universalJavaApplicationStub.x86_64 asset
8181
uses: actions/upload-release-asset@v1
8282
env:
83-
GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACCESS_TOKEN }}
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8484
with:
8585
upload_url: ${{ needs.draft_release.outputs.upload_url }}
8686
asset_name: universalJavaApplicationStub.x86_64
@@ -90,7 +90,7 @@ jobs:
9090
- name: Upload universalJavaApplicationStub.arm64 asset
9191
uses: actions/upload-release-asset@v1
9292
env:
93-
GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACCESS_TOKEN }}
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9494
with:
9595
upload_url: ${{ needs.draft_release.outputs.upload_url }}
9696
asset_name: universalJavaApplicationStub.arm64
@@ -100,7 +100,7 @@ jobs:
100100
- name: Upload universalJavaApplicationStub asset
101101
uses: actions/upload-release-asset@v1
102102
env:
103-
GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACCESS_TOKEN }}
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104104
with:
105105
upload_url: ${{ needs.draft_release.outputs.upload_url }}
106106
asset_name: universalJavaApplicationStub
@@ -144,6 +144,6 @@ jobs:
144144
steps:
145145
- uses: eregon/publish-release@v1
146146
env:
147-
GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACCESS_TOKEN }}
147+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148148
with:
149149
release_id: ${{ needs.draft_release.outputs.release_id }}

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9+
## [3.3.0] - 2023-02-04
10+
11+
PLEASE NOTE: This is the last official release as I'm going to sunset this project for personal reasons.
12+
13+
### Added
14+
- Support country specific locales such as Brazilian Portuguese (`pt-BR`)
15+
- Translation of messages to Brazilian Portuguese (#115, Thanks to @israelins85 for his contribution)
16+
17+
### Changed
18+
- Changed Adopt OpenJDK link and name to Adoptium
19+
20+
### Removed
21+
- Option to fund this project
22+
23+
924
## [3.2.0] - 2021-02-21
1025
### Added
1126
- Also expand variables `$APP_PACKAGE`, `$JAVAROOT` and `$USER_HOME` in Oracle style PList files

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2021 Tobias Fischer
3+
Copyright (c) 2014-2023 Tobias Fischer
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
universalJavaApplicationStub
22
============================
33

4-
![Tests and Shellcheck](https://github.com/tofi86/universalJavaApplicationStub/workflows/Tests%20and%20Shellcheck/badge.svg) [![Current release](https://img.shields.io/github/release/tofi86/universalJavaApplicationStub.svg)](https://github.com/tofi86/universalJavaApplicationStub/releases) [![Donate to this project using Buy Me A Coffee](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg)](https://ko-fi.com/tofi86)
4+
![Tests and Shellcheck](https://github.com/tofi86/universalJavaApplicationStub/workflows/Tests%20and%20Shellcheck/badge.svg) [![Current release](https://img.shields.io/github/release/tofi86/universalJavaApplicationStub.svg)](https://github.com/tofi86/universalJavaApplicationStub/releases)
55

66
A BASH based _launcher stub_ for Java based macOS Apps that works with both Apple's and Oracle's plist format. It is released under the [MIT License](https://github.com/tofi86/universalJavaApplicationStub/blob/master/LICENSE).
77

@@ -11,8 +11,6 @@ A BASH based _launcher stub_ for Java based macOS Apps that works with both Appl
1111

1212
🤔 ❓ If you have a _general question_ about how a feature works or would like to _share an idea_ or a _usecase for this project_, then please use the [GitHub Discussions Page](https://github.com/tofi86/universalJavaApplicationStub/discussions).
1313

14-
❤️ ☕ If you want to support this independent project, you can buy me a coffee: [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/tofi86)
15-
1614

1715
Why
1816
---

src/universalJavaApplicationStub

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
# #
1212
# @author Tobias Fischer #
1313
# @url https://github.com/tofi86/universalJavaApplicationStub #
14-
# @date 2021-02-21 #
15-
# @version 3.2.0 #
14+
# @date 2023-02-04 #
15+
# @version 3.3.0 #
1616
# #
1717
##################################################################################
1818
# #
1919
# The MIT License (MIT) #
2020
# #
21-
# Copyright (c) 2014-2021 Tobias Fischer #
21+
# Copyright (c) 2014-2023 Tobias Fischer #
2222
# #
2323
# Permission is hereby granted, free of charge, to any person obtaining a copy #
2424
# of this software and associated documentation files (the "Software"), to deal #
@@ -246,6 +246,7 @@ if [ $exitcode -eq 0 ]; then
246246

247247
# read options file name
248248
JVMOptionsFile=$(plist_get_java ':JVMOptionsFile')
249+
JVMOptionsFile=$(eval echo "${JVMOptionsFile}")
249250

250251
# read bootstrap script file name
251252
BootstrapScript=$(plist_get_java ':BootstrapScript')
@@ -313,6 +314,7 @@ else
313314

314315
# read options file name
315316
JVMOptionsFile=$(plist_get ':JVMOptionsFile')
317+
JVMOptionsFile=$(eval echo "${JVMOptionsFile}")
316318

317319
# read bootstrap script file name
318320
BootstrapScript=$(plist_get ':BootstrapScript')
@@ -360,7 +362,7 @@ done
360362
############################################
361363

362364
# supported languages / available translations
363-
stubLanguages="^(fr|de|zh|es|en)-"
365+
stubLanguages=("de" "en" "es" "fr" "pt-BR" "zh")
364366

365367
# read user preferred languages as defined in macOS System Preferences (#101)
366368
stub_logger '[LanguageSearch] Checking preferred languages in macOS System Preferences...'
@@ -371,15 +373,19 @@ language=""
371373
for i in "${appleLanguages[@]}"
372374
do
373375
langValue="${i%-*}"
374-
if [[ "$i" =~ $stubLanguages ]]; then
375-
stub_logger "[LanguageSearch] ... selected '$i' ('$langValue') as the default language for the launcher stub"
376+
if [[ " ${stubLanguages[*]} " =~ " ${i} " ]]; then
377+
stub_logger "[LanguageSearch] ... selected '$i' as the default language for the launcher stub"
378+
language=${i}
379+
break
380+
elif [[ " ${stubLanguages[*]} " =~ " ${langValue} " ]]; then
381+
stub_logger "[LanguageSearch] ... selected '$langValue' (from '$i') as the default language for the launcher stub"
376382
language=${langValue}
377-
break
383+
break
378384
fi
379385
done
380386
if [ -z "${language}" ]; then
381-
language="en"
382-
stub_logger "[LanguageSearch] ... selected fallback 'en' as the default language for the launcher stub"
387+
language="en"
388+
stub_logger "[LanguageSearch] ... selected fallback 'en' as the default language for the launcher stub"
383389
fi
384390
stub_logger "[Language] $language"
385391

@@ -398,7 +404,7 @@ fr)
398404
MSG_INSTALL_JAVA="Java doit être installé sur votre système.\nRendez-vous sur java.com et suivez les instructions d'installation..."
399405
MSG_LATER="Plus tard"
400406
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
401-
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
407+
MSG_VISIT_ADOPTIUM="Java by Adoptium"
402408
;;
403409

404410
# German
@@ -414,7 +420,7 @@ de)
414420
MSG_INSTALL_JAVA="Auf Ihrem System muss die 'Java'-Software installiert sein.\nBesuchen Sie java.com für weitere Installationshinweise."
415421
MSG_LATER="Später"
416422
MSG_VISIT_JAVA_DOT_COM="Java von Oracle"
417-
MSG_VISIT_ADOPTOPENJDK="Java von AdoptOpenJDK"
423+
MSG_VISIT_ADOPTIUM="Java von Adoptium"
418424
;;
419425

420426
# Simplified Chinese
@@ -430,7 +436,7 @@ zh)
430436
MSG_INSTALL_JAVA="你需要在Mac中安装Java运行环境!\n访问 java.com 了解如何安装。"
431437
MSG_LATER="稍后"
432438
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
433-
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
439+
MSG_VISIT_ADOPTIUM="Java by Adoptium"
434440
;;
435441

436442
# Spanish
@@ -446,9 +452,25 @@ es)
446452
MSG_INSTALL_JAVA="¡Necesita tener JAVA instalado en su Mac!\nVisite java.com para consultar las instrucciones para su instalación..."
447453
MSG_LATER="Más tarde"
448454
MSG_VISIT_JAVA_DOT_COM="Java de Oracle"
449-
MSG_VISIT_ADOPTOPENJDK="Java de AdoptOpenJDK"
455+
MSG_VISIT_ADOPTIUM="Java de Adoptium"
450456
;;
451457

458+
# Brazilian Portuguese
459+
pt-BR)
460+
MSG_ERROR_LAUNCHING="ERRO iniciando '${CFBundleName}'."
461+
MSG_MISSING_MAINCLASS="'MainClass' não foi definida!\nA aplicação java não poderá ser iniciada!"
462+
MSG_JVMVERSION_REQ_INVALID="A sintaxe da versão Java requerida não é valida: %s\nPor favor contacte o desenvolvedor dessa aplicação."
463+
MSG_NO_SUITABLE_JAVA="Não foi encontrado uma versão Java compatível no seu sistema!\nEsta aplicação precisa do Java %s"
464+
MSG_JAVA_VERSION_OR_LATER="ou maior"
465+
MSG_JAVA_VERSION_LATEST="(última atualização)"
466+
MSG_JAVA_VERSION_MAX="máxima %s"
467+
MSG_NO_SUITABLE_JAVA_CHECK="Verifique se instalou a versão Java necessária."
468+
MSG_INSTALL_JAVA="Você precisa instalar o JAVA no seu Mac!\nPor favor, visite java.com para instruções de instalação..."
469+
MSG_LATER="Depois"
470+
MSG_VISIT_JAVA_DOT_COM="Java por Oracle"
471+
MSG_VISIT_ADOPTIUM="Java por Adoptium"
472+
;;
473+
452474
# English | default
453475
en|*)
454476
MSG_ERROR_LAUNCHING="ERROR launching '${CFBundleName}'."
@@ -462,7 +484,7 @@ en|*)
462484
MSG_INSTALL_JAVA="You need to have JAVA installed on your Mac!\nVisit java.com for installation instructions..."
463485
MSG_LATER="Later"
464486
MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
465-
MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
487+
MSG_VISIT_ADOPTIUM="Java by Adoptium"
466488
;;
467489
esac
468490

@@ -828,21 +850,21 @@ if [ -z "${JAVACMD}" ] || [ ! -x "${JAVACMD}" ] ; then
828850
stub_logger "[EXIT 3] ${MSG_NO_SUITABLE_JAVA_EXPANDED}"
829851

830852
# display error message with AppleScript
831-
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA_EXPANDED}\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\" buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \
853+
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA_EXPANDED}\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\" buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTIUM}\"} default button 1${DialogWithIcon}" \
832854
-e "set response to button returned of the result" \
833855
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \
834-
-e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""
856+
-e "if response is \"${MSG_VISIT_ADOPTIUM}\" then open location \"https://adoptium.net/releases.html\""
835857
# exit with error
836858
exit 3
837859

838860
else
839861
# log exit cause
840862
stub_logger "[EXIT 1] ${MSG_ERROR_LAUNCHING}"
841863
# display error message with AppleScript
842-
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_INSTALL_JAVA}\" with title \"${CFBundleName}\" buttons {\"${MSG_LATER}\", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \
864+
osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_INSTALL_JAVA}\" with title \"${CFBundleName}\" buttons {\"${MSG_LATER}\", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTIUM}\"} default button 1${DialogWithIcon}" \
843865
-e "set response to button returned of the result" \
844866
-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \
845-
-e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""
867+
-e "if response is \"${MSG_VISIT_ADOPTIUM}\" then open location \"https://adoptium.net/releases.html\""
846868
# exit with error
847869
exit 1
848870
fi
@@ -885,7 +907,7 @@ stub_logger "[WorkingDirectory] ${WorkingDirectory}"
885907
[ -x "$BootstrapScript" ] && "$BootstrapScript"
886908

887909
# fix: read JVM options from file
888-
[ -f $JVMOptionsFile ] && while read -r option; do JVMDefaultOptions+=" $option"; done <<< $(sed "/^#.*$/d" $JVMOptionsFile)
910+
[ -f $JVMOptionsFile ] && IFS= && while read -r option; do JVMOptionsArr+=("$option"); done <<< $(sed "/^#.*$/d" $JVMOptionsFile) && unset IFS
889911

890912
# execute Java and set
891913
# - classpath

0 commit comments

Comments
 (0)