forked from yilozt/rounded-window-corners
-
Notifications
You must be signed in to change notification settings - Fork 10
/
justfile
58 lines (47 loc) · 1.49 KB
/
justfile
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
49
50
51
52
53
54
55
56
57
58
# Expand path patterns like **/*.ui
set shell := ['bash', '-O', 'globstar', '-c']
buildDir := './_build'
uuid := 'rounded-window-corners@fxgn'
# Compile the extension and all resources
build: clean && pot
# Compile TypeScript
npm install
npx tsc --outDir {{buildDir}}
# Copy non-JS files
cp -r ./resources/* {{buildDir}}
for file in $(find src -type f ! -name "*.ts" -printf '%P\n'); do \
path={{buildDir}}/$(dirname $file); \
mkdir -p $path; \
cp src/$file $path; \
done;
# Compile schemas
glib-compile-schemas {{buildDir}}/schemas
# Build and install the extension from source
install: build
rm -rf ~/.local/share/gnome-shell/extensions/{{uuid}}
cp -r {{buildDir}} ~/.local/share/gnome-shell/extensions/{{uuid}}
# Build and pack the extension
pack: build
cd {{buildDir}} && zip -9r ../{{uuid}}.shell-extension.zip .
# Delete the build directory
clean:
rm -rf {{buildDir}} {{uuid}}.shell-extension.zip
# Update and compile the translation files
pot:
xgettext --from-code=UTF-8 \
--output=po/{{uuid}}.pot \
src/**/*.ui
xgettext --from-code=UTF-8 \
--output=po/{{uuid}}.pot \
--language=JavaScript \
--join-existing \
src/**/*.ts
for file in po/*.po; do \
msgmerge -q -U --backup=off $file po/{{uuid}}.pot; \
done;
for file in po/*.po; do \
locale=$(basename $file .po); \
dir="{{buildDir}}/locale/$locale/LC_MESSAGES"; \
mkdir -p $dir; \
msgfmt -o $dir/{{uuid}}.mo $file; \
done;