-
Notifications
You must be signed in to change notification settings - Fork 41
/
knowhow
95 lines (64 loc) · 2.52 KB
/
knowhow
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
First time build
·················
$ meson build
$ cd build
$ ninja
Build, install and run the app with debug messages in one line
..............................................................
$ sudo ninja install && env G_MESSAGES_DEBUG=all com.github.spheras.desktopfolder
Use debugger suite
..................
Nemiver is GNOME's GUI debugger. It can be really useful for locating the source of crashes and bugs.
$ sudo apt install nemiver
After installing use this instead of the one liner above:
$ sudo ninja install && env G_MESSAGES_DEBUG=all nemiver com.github.spheras.desktopfolder
Install uncrustify
··················
Don't use sudo apt install uncrustify!
Run this one-liner to install the latest release of uncrustify:
$ cd ~/Downloads && wget https://github.com/uncrustify/uncrustify/archive/uncrustify-0.65.tar.gz && tar -xf uncrustify-0.65.tar.gz && cd uncrustify-uncrustify-0.65/cmake/ && cmake .. && sudo make install
If you want to run it step by step instead:
$ cd ~/Downloads
$ wget https://github.com/uncrustify/uncrustify/archive/uncrustify-0.65.tar.gz
$ tar -xf uncrustify-0.65.tar.gz
$ cd uncrustify-uncrustify-0.65/cmake/
$ cmake ..
$ sudo make install
This means everyone is using the same version, so the output is consistent.
Use uncrustify
··············
Go to src/ and run uncrustify like this:
$ uncrustify --replace --no-backup -c ../etc/uncrustify-elementary-vala.cfg */*.vala *.vala
Make sure you don't end comment lines with a \ (backslash), otherwise
uncrustify turns the next line into a comment as well:
// This prints a \
my_function ();
Gets turned into:
// This prints a
// my_function ();
It's okay if you put any character after it though:
// This prints a \ character.
// (or) This prints a \.
my_function ();
Show debug messages
···················
$ export G_MESSAGES_DEBUG=all
Generate pot file
·················
$ ninja com.github.spheras.desktopfolder-pot
Debian build
············
sudo apt install devscripts
From root directory:
$ debuild -uc -us
(Hint) To execute rules:
$ ./debian/rules install
GTK Introspector
················
$ gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true
After that, press Ctrl+Shift+D or Ctrl+Shift+I on the window you want to debug.
Snap creation
·············
$ sudo apt install snapcraft
$ sudo docker pull snapcore/snapcraft
$ sudo docker run -v $PWD:$PWD -w $PWD snapcore/snapcraft snapcraft