forked from cosmic-utils/clipboard-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
117 lines (80 loc) · 2.64 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
rootdir := ''
prefix := '/usr'
debug := '0'
export NAME := 'cosmic-ext-applet-clipboard-manager'
export APPID := 'io.github.wiiznokes.' + NAME
cargo-target-dir := env('CARGO_TARGET_DIR', 'target')
bin-src := cargo-target-dir / if debug == '1' { 'debug' / NAME } else { 'release' / NAME }
base-dir := absolute_path(clean(rootdir / prefix))
share-dst := base-dir / 'share'
bin-dst := base-dir / 'bin' / NAME
desktop-dst := share-dst / 'applications' / APPID + '.desktop'
icon-dst := share-dst / 'icons/hicolor/scalable/apps' / APPID + '-symbolic.svg'
env-dst := rootdir / 'etc/profile.d' / NAME + '.sh'
schema-dst := share-dst / 'configurator' / APPID + '.json'
default: build-release
build-debug *args:
cargo build {{args}}
build-release *args:
cargo build --release {{args}}
install:
install -Dm0755 {{bin-src}} {{bin-dst}}
install -Dm0644 res/desktop_entry.desktop {{desktop-dst}}
install -Dm0644 res/app_icon.svg {{icon-dst}}
install -Dm0644 res/env.sh {{env-dst}}
install-schema:
install -Dm0644 res/config_schema.json {{schema-dst}}
uninstall:
rm {{bin-dst}}
rm {{desktop-dst}}
rm {{icon-dst}}
rm {{env-dst}}
rm {{schema-dst}}
clean:
cargo clean
pull: fmt prettier fix test
################### Test
test:
cargo test --workspace --all-features
################### Format
fix:
cargo clippy --workspace --all-features --fix --allow-dirty --allow-staged
fmt:
cargo fmt --all
prettier:
# install on Debian: sudo snap install node --classic
# npx is the command to run npm package, node is the runtime
npx prettier -w .
git-cache:
git rm -rf --cached .
git add .
expand:
cargo expand
setup:
rm -rf flatpak-builder-tools
git clone https://github.com/flatpak/flatpak-builder-tools
pip install aiohttp toml
sources-gen:
python3 flatpak-builder-tools/cargo/flatpak-cargo-generator.py ./Cargo.lock -o cargo-sources.json
install-sdk:
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --noninteractive --user flathub \
org.freedesktop.Platform//23.08 \
org.freedesktop.Sdk//23.08 \
org.freedesktop.Sdk.Extension.rust-stable//23.08 \
org.freedesktop.Sdk.Extension.llvm17//23.08
uninstall-f:
flatpak uninstall io.github.wiiznokes.cosmic-ext-applet-clipboard-manager -y || true
# deps: flatpak-builder git-lfs
build-and-install: uninstall-f
flatpak-builder \
--force-clean \
--verbose \
--ccache \
--user --install \
--install-deps-from=flathub \
--repo=repo \
flatpak-out \
io.github.wiiznokes.cosmic-ext-applet-clipboard-manager.json
run:
flatpak run io.github.wiiznokes.cosmic-ext-applet-clipboard-manager