-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
language-c: re-arrange files locations (#112)
language-c: re-arrange files locations
- Loading branch information
1 parent
8b1e5fc
commit 76d9009
Showing
34 changed files
with
65 additions
and
32 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
usage() | ||
{ | ||
echo "options:" | ||
echo " -i install path" | ||
echo " -s sdk path" | ||
echo " -t include test" | ||
echo " -m module name. i.e, core/manage" | ||
echo | ||
echo "usage: " | ||
echo " ./install.sh -p path" | ||
} | ||
|
||
SdkPath=".." | ||
InstallPath=".." | ||
IncludeTest="OFF" | ||
ModuleName="core" | ||
while getopts i:s:m:th flag | ||
do | ||
case "${flag}" in | ||
i) InstallPath="${OPTARG}";; | ||
s) SdkPath="${OPTARG}";; | ||
m) ModuleName="${OPTARG}";; | ||
t) IncludeTest="ON";; | ||
h) usage && exit 1;; | ||
esac | ||
done | ||
|
||
GetVersion() | ||
{ | ||
PackagePath=${SdkPath}/../../../../../../package-lock.json | ||
InputKey="name\": \"@firebolt-js/openrpc" | ||
LineNo="$(grep -n "${InputKey}" ${PackagePath} | head -n 1 | cut -d: -f1)" | ||
VersionLine=$((LineNo++)) | ||
eval "array=(`sed -n "${LineNo}p" < ${PackagePath} | sed 's/\"/\n/g'`)" | ||
Version=${array[2]} | ||
} | ||
|
||
Version=0.0 | ||
GetVersion | ||
ReleaseName=firebolt-${ModuleName}-native-sdk-${Version} | ||
ReleasePath=${InstallPath}/${ReleaseName} | ||
|
||
rm -rf ${ReleasePath} | ||
mkdir -p ${ReleasePath} | ||
cp -ar ${SdkPath}/src ${ReleasePath} | ||
cp -ar ${SdkPath}/include ${ReleasePath} | ||
cp -ar ${SdkPath}/cmake ${ReleasePath} | ||
cp -ar ${SdkPath}/scripts/build.sh ${ReleasePath} | ||
cp -ar ${SdkPath}/CMakeLists.txt ${ReleasePath} | ||
|
||
if [ "${IncludeTest}" == "ON" ]; | ||
then | ||
cp -ar ${SdkPath}/ctest ${ReleasePath}/test | ||
fi | ||
|
||
sed -i '/EnableTest="ON";;/d' ${ReleasePath}/build.sh | ||
sed -i 's/getopts p:s:tch/getopts p:s:ch/g' ${ReleasePath}/build.sh | ||
sed -i '/enable test/d' ${ReleasePath}/build.sh | ||
sed -i '/EnableTest="OFF"/d' ${ReleasePath}/build.sh | ||
sed -i 's/ -DENABLE_TESTS=${EnableTest}//g' ${ReleasePath}/build.sh | ||
|
||
cd ${ReleasePath}/../ | ||
tar -cvzf ${ReleaseName}.tgz ${ReleaseName}/* | ||
cd - |