feat: setup script
This commit is contained in:
parent
30e7b03892
commit
e0d1a8999e
|
@ -1,4 +1,4 @@
|
|||
project ('vala-gtk4-template', ['c', 'vala'],
|
||||
project ('vala-gtk-template', ['c', 'vala'],
|
||||
version: '0.1.0',
|
||||
meson_version: '>= 0.59.0',
|
||||
default_options: [ 'warning_level=2', 'werror=false' ],
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
set -xe
|
||||
|
||||
# remove files that might conflict
|
||||
rm -rf build/ subprojects/blueprint-compiler/
|
||||
|
||||
# variables
|
||||
PROJECT_NAME="my-project"
|
||||
PROJECT_ID="foo.bar.$PROJECT_NAME"
|
||||
RESOURCE_PATH="/foo/bar/$PROJECT_NAME"
|
||||
NAMESPACE="MyProject"
|
||||
CNAME="my_project"
|
||||
AUTHOR="author"
|
||||
|
||||
# rename files
|
||||
mv ./data/{de.thetek.vala-gtk-template,$PROJECT_ID}.appdata.xml.in
|
||||
mv ./data/{de.thetek.vala-gtk-template,$PROJECT_ID}.desktop.in
|
||||
mv ./data/{de.thetek.vala-gtk-template,$PROJECT_ID}.gschema.xml
|
||||
mv ./data/icons/hicolor/scalable/apps/{de.thetek.vala-gtk-template,$PROJECT_ID}.svg
|
||||
mv ./data/icons/hicolor/symbolic/apps/{de.thetek.vala-gtk-template,$PROJECT_ID}-symbolic.svg
|
||||
mv ./src/{vala-gtk-template,$PROJECT_NAME}.gresource.xml
|
||||
|
||||
# replace text in files
|
||||
find . -type f -name '*' -not -path './.git/*' -exec sed -i -e "s=/de/thetek/vala-gtk-template=$RESOURCE_PATH=g" {} \;
|
||||
find . -type f -name '*' -not -path './.git/*' -exec sed -i -e "s=de.thetek.vala-gtk-template=$PROJECT_ID=g" {} \;
|
||||
find . -type f -name '*' -not -path './.git/*' -exec sed -i -e "s=vala-gtk-template=$PROJECT_NAME=g" {} \;
|
||||
find . -type f -name '*' -not -path './.git/*' -exec sed -i -e "s=vala_gtk_template=$CNAME=g" {} \;
|
||||
find . -type f -name '*' -not -path './.git/*' -exec sed -i -e "s=ValaGtkTemplate=$NAMESPACE=g" {} \;
|
||||
find . -type f -name '*' -not -path './.git/*' -exec sed -i -e "s=thetek=$AUTHOR=g" {} \;
|
Loading…
Reference in New Issue