From 90ebf58554d6725226d5b5d2b678b4b14607794d Mon Sep 17 00:00:00 2001
From: "[ ]" <[ ]>
Date: Mon, 25 Sep 2023 00:31:06 +0900
Subject: [PATCH] build: Add .idea project files tracking
---
.gitignore | 1 -
.idea/.gitignore | 8 ++
.idea/cmake.xml | 11 +++
.idea/inspectionProfiles/Project_Default.xml | 72 +++++++++++++++
.idea/misc.xml | 4 +
.idea/modules.xml | 8 ++
.idea/runConfigurations/Deploy_Debug_.xml | 20 +++++
.idea/runConfigurations/Deploy_Release_.xml | 20 +++++
.../runConfigurations/Distribute_Release_.xml | 20 +++++
.idea/runConfigurations/spicetools_cfg.xml | 9 ++
.idea/runConfigurations/spicetools_spice.xml | 9 ++
.../runConfigurations/spicetools_spice64.xml | 9 ++
.idea/spicetools.iml | 2 +
.idea/vcs.xml | 7 ++
cmake.sh | 89 +++++++++++++------
15 files changed, 260 insertions(+), 29 deletions(-)
create mode 100644 .idea/.gitignore
create mode 100644 .idea/cmake.xml
create mode 100644 .idea/inspectionProfiles/Project_Default.xml
create mode 100644 .idea/misc.xml
create mode 100644 .idea/modules.xml
create mode 100644 .idea/runConfigurations/Deploy_Debug_.xml
create mode 100644 .idea/runConfigurations/Deploy_Release_.xml
create mode 100644 .idea/runConfigurations/Distribute_Release_.xml
create mode 100644 .idea/runConfigurations/spicetools_cfg.xml
create mode 100644 .idea/runConfigurations/spicetools_spice.xml
create mode 100644 .idea/runConfigurations/spicetools_spice64.xml
create mode 100644 .idea/spicetools.iml
create mode 100644 .idea/vcs.xml
diff --git a/.gitignore b/.gitignore
index f4f6b25..268577f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,6 @@
.vscode/*
# JetBrains IDEs
-.idea
.idea_modules
*.iws
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..13566b8
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/cmake.xml b/.idea/cmake.xml
new file mode 100644
index 0000000..1c42ffd
--- /dev/null
+++ b/.idea/cmake.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..d69431f
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..79b3c94
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..ca1b020
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Deploy_Debug_.xml b/.idea/runConfigurations/Deploy_Debug_.xml
new file mode 100644
index 0000000..ba88928
--- /dev/null
+++ b/.idea/runConfigurations/Deploy_Debug_.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Deploy_Release_.xml b/.idea/runConfigurations/Deploy_Release_.xml
new file mode 100644
index 0000000..27a57d0
--- /dev/null
+++ b/.idea/runConfigurations/Deploy_Release_.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Distribute_Release_.xml b/.idea/runConfigurations/Distribute_Release_.xml
new file mode 100644
index 0000000..92e6fd5
--- /dev/null
+++ b/.idea/runConfigurations/Distribute_Release_.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/spicetools_cfg.xml b/.idea/runConfigurations/spicetools_cfg.xml
new file mode 100644
index 0000000..e31f011
--- /dev/null
+++ b/.idea/runConfigurations/spicetools_cfg.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/spicetools_spice.xml b/.idea/runConfigurations/spicetools_spice.xml
new file mode 100644
index 0000000..585a16d
--- /dev/null
+++ b/.idea/runConfigurations/spicetools_spice.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/spicetools_spice64.xml b/.idea/runConfigurations/spicetools_spice64.xml
new file mode 100644
index 0000000..aefebf9
--- /dev/null
+++ b/.idea/runConfigurations/spicetools_spice64.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/spicetools.iml b/.idea/spicetools.iml
new file mode 100644
index 0000000..f08604b
--- /dev/null
+++ b/.idea/spicetools.iml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..6cc311d
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cmake.sh b/cmake.sh
index 0a1a890..0c7e540 100755
--- a/cmake.sh
+++ b/cmake.sh
@@ -1,39 +1,72 @@
#!/bin/bash
-_G_buildir="bin/build"
-_G_bindir="bin"
-_G_debug=false
-_G_clean=false
+: ${_G_buildir:="bin/build"}
+: ${_G_bindir:="bin"}
+: ${_G_debug:=false}
+: ${_G_clean:=false}
+# Hidden build all temporary environment for sourcing
+<<__BUILDALLINIT__
+# Auto-config for build_al.sh
+GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "none")
+GIT_HEAD=$(git rev-parse --short HEAD || echo "none")
+BUILD_TYPE=$({ $_G_debug && echo Debug; } || echo Release)
+OUTDIR="$_G_bindir/${BUILD_TYPE}"
+DIST_FOLDER="$_G_bindir/Distribution"
+DIST_NAME="${GIT_BRANCH}-${GIT_HEAD}.zip"
+DIST_COMMENT="$(date +%Y)/$(date +%m)/$(date +%d):$(git rev-parse HEAD)"
+: ${DIST_ENABLE:=$({ $_G_debug && echo 0; } || echo 1)}
+UPX_ENABLE="$DIST_ENABLE"
+INCLUDE_SRC=0
+UPX_FLAGS="-q --best --lzma --compress-exports=0"
+CLEAN_BUILD=$({ $_G_clean && echo 1; } || echo 0)
+DEBUG=$({ $_G_debug && echo 1; } || echo 0)
+TOOLCHAIN_32="external/cmake-various/toolchain/toolchain-mingw_nix-win-x86.cmake"
+TARGETS_32="spicetools_stubs_kbt spicetools_stubs_kld spicetools_cfg spicetools_spice"
+BUILDDIR_32="$_G_buildir/x86/${BUILD_TYPE}"
+TOOLCHAIN_64="external/cmake-various/toolchain/toolchain-mingw_nix-win-x64.cmake"
+TARGETS_64="spicetools_stubs_kbt64 spicetools_stubs_kld64 spicetools_spice64"
+BUILDDIR_64="$_G_buildir/x64/${BUILD_TYPE}"
+__BUILDALLINIT__
run_build_all() {
- # Auto-config for build_al.sh
- GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "none")
- GIT_HEAD=$(git rev-parse --short HEAD || echo "none")
- BUILD_TYPE=$({ $_G_debug && echo Debug; } || echo Release)
- OUTDIR="$_G_bindir/${BUILD_TYPE}"
- DIST_FOLDER="$_G_bindir"
- DIST_NAME="${GIT_BRANCH}-${GIT_HEAD}.zip"
- DIST_COMMENT="$(date +%Y)/$(date +%m)/$(date +%d):$(git rev-parse HEAD)"
- DIST_ENABLE=$({ $_G_debug && echo 0; } || echo 1)
- UPX_ENABLE="$DIST_ENABLE"
- INCLUDE_SRC=0
- UPX_FLAGS="-q --best --lzma --compress-exports=0"
- CLEAN_BUILD=$({ $_G_clean && echo 1; } || echo 0)
- DEBUG=$({ $_G_debug && echo 1; } || echo 0)
- TOOLCHAIN_32="/usr/share/mingw/toolchain-i686-w64-mingw32.cmake"
- TARGETS_32="spicetools_stubs_kbt spicetools_stubs_kld spicetools_cfg spicetools_spice"
- BUILDDIR_32="$_G_buildir/x86/${BUILD_TYPE}"
- TOOLCHAIN_64="/usr/share/mingw/toolchain-x86_64-w64-mingw32.cmake"
- TARGETS_64="spicetools_stubs_kbt64 spicetools_stubs_kld64 spicetools_spice64"
- BUILDDIR_64="$_G_buildir/x64/${BUILD_TYPE}"
+ # Init build_all.sh
+ source <(sed -n '/__BUILDALLINIT__/{:a;n;/__BUILDALLINIT__/q;p;$!ba}' "$0")
+ source <(head -n +20 ./build_all.sh)
# Run build_all.sh
- source <(head -n +20 ./build_all.sh)
source <(tail -n +59 ./build_all.sh | head -n -3 | sed 's~.*pushd ${OUTDIR}/.. > /dev/null*~\tpushd ${OUTDIR} > /dev/null~')
}
-# Run build_all.sh
-run_build_all
+run_deploy_all() {
+ DIST_ENABLE=0
-# Continue
+ # Init build_all.sh
+ source <(sed -n '/__BUILDALLINIT__/{:a;n;/__BUILDALLINIT__/q;p;$!ba}' "$0")
+ source <(head -n +20 ./build_all.sh)
+
+ # Run deploy in build_all.sh
+ source <(tail -n +150 ./build_all.sh | head -n -3 | sed 's~.*pushd ${OUTDIR}/.. > /dev/null*~\tpushd ${OUTDIR} > /dev/null~')
+}
+
+run_distribute_all() {
+ # Init build_all.sh
+ source <(sed -n '/__BUILDALLINIT__/{:a;n;/__BUILDALLINIT__/q;p;$!ba}' "$0")
+ source <(head -n +20 ./build_all.sh)
+
+ # Run deploy in build_all.sh
+ source <(tail -n +150 ./build_all.sh | head -n -3 | sed 's~.*pushd ${OUTDIR}/.. > /dev/null*~\tpushd ${OUTDIR} > /dev/null~')
+}
+
+# Sanity checks
+[ -d "external/cmake-various/toolchain" ] || { echo "Toolchain not found" ; exit 1; }
+[ "$(md5sum ./build_all.sh | cut -c -32)" = "9a89bba3fa2435983e5bce423d0f4a61" ] || { echo "Version mismatch for build_all.sh " ; exit 1; }
+
+# Run requested task
+if [[ $(type -t "run_${1}_${2}") == function ]]; then
+ echo "Starting task: 'run_${1}_${2}'"
+ "run_${1}_${2}"
+else
+ echo "Invalid task: 'run_${1}_${2}'"
+ exit 1
+fi