[frontend] Firmware setup & requirement (#222)

Currently Android only, will need to be added to desktop.

Android incorrectly records firmware as 19.0.1 if on a higher version...

TODO:
- [x] desktop
- [x] fix android

Signed-off-by: crueter <swurl@swurl.xyz>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/222
Co-authored-by: crueter <swurl@swurl.xyz>
Co-committed-by: crueter <swurl@swurl.xyz>
This commit is contained in:
crueter 2025-06-27 23:23:25 +00:00 committed by crueter
parent 20bf141faa
commit f121df0aa3
22 changed files with 379 additions and 74 deletions

View file

@ -7,16 +7,9 @@ license_header = <<~EOF
EOF
print 'Getting branch changes...'
puts "\n"
branch_name = `git rev-parse --abbrev-ref HEAD`.chomp
print branch_name
puts "\n"
branch_commits = `git log #{branch_name} --not master --pretty=format:"%h"`.split("\n")
print branch_commits
puts "\n"
branch_commit_range = "#{branch_commits[-1]}^..#{branch_commits[0]}"
print branch_commit_range
puts "\n"
branch_changed_files = `git diff-tree --no-commit-id --name-only #{branch_commit_range} -r`.split("\n")
puts 'done'

85
.ci/license-header.sh Executable file
View file

@ -0,0 +1,85 @@
#!/bin/sh -e
HEADER="$(cat "$PWD/.ci/license/header.txt")"
echo "Getting branch changes"
# I created this cursed POSIX abomination only to discover a better solution
#BRANCH=`git rev-parse --abbrev-ref HEAD`
#COMMITS=`git log ${BRANCH} --not master --pretty=format:"%h"`
#RANGE="${COMMITS[${#COMMITS[@]}-1]}^..${COMMITS[0]}"
#FILES=`git diff-tree --no-commit-id --name-only ${RANGE} -r`
FILES=$(git diff --name-only master)
echo "Done"
for file in $FILES; do
EXTENSION="${file##*.}"
case "$EXTENSION" in
kts|kt|cpp|h)
CONTENT="`cat $file`"
case "$CONTENT" in
"$HEADER"*) ;;
*) BAD_FILES="$BAD_FILES $file" ;;
esac
;;
esac
done
if [ "$BAD_FILES" = "" ]; then
echo
echo "All good."
exit
fi
echo "The following files have incorrect license headers:"
echo
for file in $BAD_FILES; do echo $file; done
cat << EOF
The following license header should be added to the start of all offending files:
=== BEGIN ===
$HEADER
=== END ===
If some of the code in this PR is not being contributed by the original author,
the files which have been exclusively changed by that code can be ignored.
If this happens, this PR requirement can be bypassed once all other files are addressed.
EOF
if [ "$FIX" = "true" ]; then
echo
echo "FIX set to true. Fixing headers."
echo
for file in $BAD_FILES; do
cat $file > $file.bak
cat .ci/license/header.txt > $file
echo >> $file
cat $file.bak >> $file
rm $file.bak
git add $file
done
echo "License headers fixed."
fi
if [ "$COMMIT" = "true" ]; then
echo
echo "COMMIT set to true. Committing changes."
echo
git commit -m "Fix license headers"
echo "Changes committed. You may now push."
fi
exit

2
.ci/license/header.txt Normal file
View file

@ -0,0 +1,2 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later