Skip to content
Snippets Groups Projects
Commit a0947c10 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Merge branch '7-improve-app-metadata-include-fdroid-metadata-in-repository' into 'master'

Resolve "Improve app metadata, include fdroid metadata in repository"

Closes #7

See merge request !7
parents 2f22ca26 f11de3eb
No related branches found
No related tags found
1 merge request!7Resolve "Improve app metadata, include fdroid metadata in repository"
Pipeline #3146 canceled
Showing
with 224 additions and 0 deletions
Sort game, simple and classic
\ No newline at end of file
Premier commit
\ No newline at end of file
Création de l'application minimale
\ No newline at end of file
Amélioration de la chaine de construction de l'application
\ No newline at end of file
Amélioration de la chaine de construction de l'application
\ No newline at end of file
Ajout d'une notification Jabber à la création d'une nouvelle version
\ No newline at end of file
Ajout du fichier de licence GPLv3, mise à jour du framework Flutter
\ No newline at end of file
Mise à jour du framework Flutter et de ses dépendances
\ No newline at end of file
Mise à jour du framework Flutter et de ses dépendances
\ No newline at end of file
Nettoyage de code
\ No newline at end of file
Ajout des métadata f-droid au dépôt
\ No newline at end of file
Jeu de tri
\ No newline at end of file
Jeu de tri
\ No newline at end of file
Jeu de tri
\ No newline at end of file
AuthorName: 'Benoît Harrault'
Categories:
- Games
Name: Sort Game
AutoName: sortgame
License: GPL-3.0-only
WebSite: 'https://git.harrault.fr/android/org.benoitharrault.sortgame'
SourceCode: https://git.harrault.fr/android/org.benoitharrault.sortgame
IssueTracker: https://git.harrault.fr/android/org.benoitharrault.sortgame/issues
Changelog: https://git.harrault.fr/android/org.benoitharrault.sortgame/-/tags
Summary: ''
Description: |-
Sort game, simple and classic.
RepoType: git
Repo: 'https://git.harrault.fr/android/org.benoitharrault.sortgame.git'
#! /bin/bash
# Check dependencies
command -v inkscape >/dev/null 2>&1 || { echo >&2 "I require inkscape but it's not installed. Aborting."; exit 1; }
command -v scour >/dev/null 2>&1 || { echo >&2 "I require scour but it's not installed. Aborting."; exit 1; }
command -v optipng >/dev/null 2>&1 || { echo >&2 "I require optipng but it's not installed. Aborting."; exit 1; }
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
BASE_DIR="$(dirname "${CURRENT_DIR}")"
SOURCE="${CURRENT_DIR}/icon.svg"
SOURCE_FASTLANE="${CURRENT_DIR}/featureGraphic.svg"
OPTIPNG_OPTIONS="-preserve -quiet -o7"
if [ ! -f "${SOURCE}" ]; then
echo "Missing file: ${SOURCE}"
fi
if [ ! -f "${SOURCE_FASTLANE}" ]; then
echo "Missing file: ${SOURCE_FASTLANE}"
fi
# optimize svg
cp ${SOURCE} ${SOURCE}.tmp
scour \
--remove-descriptive-elements \
--enable-id-stripping \
--enable-viewboxing \
--enable-comment-stripping \
--nindent=4 \
--quiet \
-i ${SOURCE}.tmp \
-o ${SOURCE}
rm ${SOURCE}.tmp
# build icons
function build_icon() {
ICON_SIZE="$1"
TARGET="$2"
echo "Building ${TARGET}"
TARGET_PNG="${TARGET}.png"
inkscape \
--export-width=${ICON_SIZE} \
--export-height=${ICON_SIZE} \
--export-filename=${TARGET_PNG} \
${SOURCE}
optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG}
}
# build fastlane image
function build_fastlane_image() {
WIDTH="$1"
HEIGHT="$2"
TARGET="$3"
echo "Building ${TARGET}"
cp ${SOURCE_FASTLANE} ${SOURCE_FASTLANE}.tmp
scour \
--remove-descriptive-elements \
--enable-id-stripping \
--enable-viewboxing \
--enable-comment-stripping \
--nindent=4 \
--quiet \
-i ${SOURCE_FASTLANE}.tmp \
-o ${SOURCE_FASTLANE}
rm ${SOURCE_FASTLANE}.tmp
TARGET_PNG="${TARGET}.png"
inkscape \
--export-width=${WIDTH} \
--export-height=${HEIGHT} \
--export-filename=${TARGET_PNG} \
${SOURCE_FASTLANE}
optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG}
}
build_icon 72 ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher
build_icon 48 ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/ic_launcher
build_icon 96 ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/ic_launcher
build_icon 144 ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher
build_icon 192 ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher
build_icon 512 ${BASE_DIR}/fastlane/metadata/android/en-US/images/icon
build_fastlane_image 1024 500 ${BASE_DIR}/fastlane/metadata/android/en-US/images/featureGraphic
#! /bin/bash
# Check dependencies
command -v inkscape >/dev/null 2>&1 || { echo >&2 "I require inkscape but it's not installed. Aborting."; exit 1; }
command -v scour >/dev/null 2>&1 || { echo >&2 "I require scour but it's not installed. Aborting."; exit 1; }
command -v optipng >/dev/null 2>&1 || { echo >&2 "I require optipng but it's not installed. Aborting."; exit 1; }
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
BASE_DIR="$(dirname "${CURRENT_DIR}")"
ASSETS_DIR="${BASE_DIR}/assets"
OPTIPNG_OPTIONS="-preserve -quiet -o7"
ICON_SIZE=192
#######################################################
# Game images
AVAILABLE_GAME_IMAGES="
"
# Settings images
AVAILABLES_GAME_SETTINGS="
"
#######################################################
# optimize svg
function optimize_svg() {
SOURCE="$1"
cp ${SOURCE} ${SOURCE}.tmp
scour \
--remove-descriptive-elements \
--enable-id-stripping \
--enable-viewboxing \
--enable-comment-stripping \
--nindent=4 \
--quiet \
-i ${SOURCE}.tmp \
-o ${SOURCE}
rm ${SOURCE}.tmp
}
# build icons
function build_icon() {
SOURCE="$1"
TARGET="$2"
echo "Building ${TARGET}"
if [ ! -f "${SOURCE}" ]; then
echo "Missing file: ${SOURCE}"
exit 1
fi
optimize_svg "${SOURCE}"
inkscape \
--export-width=${ICON_SIZE} \
--export-height=${ICON_SIZE} \
--export-filename=${TARGET} \
${SOURCE}
optipng ${OPTIPNG_OPTIONS} ${TARGET}
}
function build_settings_icons() {
INPUT_STRING="$1"
SETTING_NAME="$(echo "${INPUT_STRING}" | cut -d":" -f1)"
SETTING_VALUES="$(echo "${INPUT_STRING}" | cut -d":" -f2 | tr "," " ")"
for SETTING_VALUE in ${SETTING_VALUES}
do
SETTING_CODE="${SETTING_NAME}_${SETTING_VALUE}"
build_icon ${CURRENT_DIR}/${SETTING_CODE}.svg ${ASSETS_DIR}/icons/${SETTING_CODE}.png
done
}
#######################################################
# Create output folders
mkdir -p ${ASSETS_DIR}/icons
# Delete existing generated images
find ${ASSETS_DIR}/icons -type f -name "*.png" -delete
# build game images
for GAME_IMAGE in ${AVAILABLE_GAME_IMAGES}
do
build_icon ${CURRENT_DIR}/${GAME_IMAGE}.svg ${ASSETS_DIR}/icons/${GAME_IMAGE}.png
done
# build settings images
for GAME_SETTING in ${AVAILABLES_GAME_SETTINGS}
do
build_settings_icons "${GAME_SETTING}"
done
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 1024 500" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect width="1024" height="500" rx="0" ry="0" fill="#977cff"/></svg>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment