This simple web page provides a table of all icons. So developers can easily know which icon size is
missing, or not in dark theme.
Neato! Looks pretty handy. Two issues I found:
- generate_web_data.sh isn't executable
- I'd like to see this run as part of the build process, so that index.html gets updated automatically, and so running it doesn't pollute your source folder since you're of course doing out-of-source builds :) Then you don't have to add the generated text files to .gitignore.
mmm, I'm afraid that didn't work. running cmake on it reveals the following:
CMake Error at CMakeLists.txt:71 (add_custom_target): add_custom_target cannot create target "generate-web" because another target with the same name already exists. The existing target is a custom target created in source directory "/home/dev/kde/src/breeze-icons/icons". See documentation for policy CMP0002 for more details.
You have it inside the generate_binary_resource function, which means that it can be called twice. You'll need to move this target outside of that function.
Scanning dependencies of target generate-web make: generate_web_data.sh: Command not found CMakeFiles/generate-web.dir/build.make:57: recipe for target 'CMakeFiles/generate-web' failed
Are you able to test this yourself?
Thanks, it compiles with CMake now! \o/
I'm not a fan of how it dumps all this stuff in the source directory. Ideally it would put everything to the build directory when doing an out-of-source build so the source dir isn't cluttered up with transient and rapidly-changing information. Then you also wouldn't need to add these files to gitignore.
The challenge is that in HTML file, it uses certain relative paths to icons and data files. CMake build directory can be anywhere. I have to make sure icons, index.html, .breeze.txt always in same relative paths.
Few notes on the new generate_web_data.sh script:
- please quote the paths properly, otherwise it will break when either the source directory or the build directory contain e.g. spaces
- it does not seem using any bash-specific features, so make it using /bin/sh, to help non-Linux Unices (where usually bash is not available by default, and/or not in /bin)
- please harden the script using at least -e and -u flags for set: this way, it will not keep executing when a command fails, and undeclared variables are not silently expanded to empty string (to prevent typos)
- -e: exits whenever any of the programs return a non-zero (i.e. failure) return code; this is useful to not silently ignore failures, and makes the behaviour similar to each line in a target of a Makefile
- -u: immediately fails when trying to expand a variable that was not previously set; this way, things like mkdir "$DIR/foo" will immediately fail if $FOO was not set previously (so prevent misbehaviours due to typos, or code path not taken into account)
this should go to stderr, as it is an error
Always using the network is not exactly a good idea:
At least in Debian I see a libjs-vue package, so please make sure to work with local copies only. Otherwise this is a big privacy concern.