-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
48 lines (41 loc) · 2.86 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
SHELL:=/bin/bash -O globstar
.PHONY: setup lint test ci sandbox flatpak
.DEFAULT_GOAL := ci
setup:
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --user --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
flatpak install --or-update --user --noninteractive flathub org.gnome.Sdk//46 org.gnome.Sdk.Docs//46
flatpak install --or-update --user --noninteractive flathub org.flatpak.Builder org.freedesktop.Sdk.Extension.node18//23.08
npm install
lint:
# ESLint
flatpak run --user --command=/usr/lib/sdk/node18/bin/node --filesystem=host:ro org.gnome.Sdk//46beta node_modules/.bin/eslint --max-warnings=0 src
# gettext
# find po/ -type f -name "*po" -print0 | xargs -0 -n1 msgfmt -o /dev/null --check
# Flatpak manifests
flatpak run --user --command=flatpak-builder-lint org.flatpak.Builder manifest --exceptions build-aux/app.drey.Biblioteca.json
flatpak run --user --command=flatpak-builder-lint org.flatpak.Builder manifest --exceptions build-aux/app.drey.Biblioteca.Devel.json
# https://github.com/ximion/appstream/issues/398#issuecomment-1129454985
# flatpak run org.freedesktop.appstream.cli validate --override=release-time-missing=info --no-net data/app.metainfo.xml
# desktop-file-validate --no-hints data/app.desktop
# https://discourse.gnome.org/t/gtk-builder-tool-requires-and-libraries/9222
# gtk-builder-tool validate src/*.ui
# flatpak run org.flathub.flatpak-external-data-checker app.drey.Biblioteca.json
# flatpak run org.flathub.flatpak-external-data-checker app.drey.Biblioteca.Devel.json
# as used by Flathub
# flatpak run --env=G_DEBUG=fatal-criticals --command=appstream-util org.flatpak.Builder validate data/app.metainfo.xml
test: lint
ci: setup lint
# Note that if you have Sdk extensions installed they will be used
# make sure to test without the sdk extensions installed
sandbox: setup
flatpak-builder --ccache --user --install --force-clean flatpak build-aux/app.drey.Biblioteca.Devel.json
# flatpak remove --noninteractive org.gnome.Sdk.Docs//45 org.freedesktop.Sdk.Extension.rust-stable//23.08 org.freedesktop.Sdk.Extension.vala//23.08 org.freedesktop.Sdk.Extension.llvm16//23.08
flatpak run --command="bash" app.drey.Biblioteca.Devel
flatpak: setup
flatpak-builder --ccache --force-clean flatpak build-aux/app.drey.Biblioteca.Devel.json
# This is what Flathub does - consider moving to lint
flatpak run --env=G_DEBUG=fatal-criticals --command=appstream-util org.flatpak.Builder validate flatpak/files/share/appdata/app.drey.Biblioteca.Devel.appdata.xml
flatpak run --command="desktop-file-validate" --filesystem=host:ro org.freedesktop.Sdk//23.08 flatpak/files/share/applications/app.drey.Biblioteca.Devel.desktop
# appstreamcli validate --override=release-time-missing=info /path/to/your/app.metainfo.xml
flatpak-builder --run flatpak build-aux/app.drey.Biblioteca.Devel.json bash