Skip to content

Commit

Permalink
Some minor cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Nov 2, 2019
1 parent 95c1cff commit bce956f
Show file tree
Hide file tree
Showing 23 changed files with 69 additions and 69 deletions.
4 changes: 2 additions & 2 deletions clean
@@ -1,5 +1,5 @@
#!/bin/sh

homeDir="$(cd "$(dirname "$0")"; pwd)"
appDir="$(cd "$(dirname "$0")"; pwd)"

${homeDir}/scripts/genericclean
${appDir}/scripts/genericclean
4 changes: 2 additions & 2 deletions clean.bat
@@ -1,5 +1,5 @@
@ECHO OFF

SET HomeDir=%~dp0
SET AppDir=%~dp0

CALL "%HomeDir%scripts\genericclean"
CALL "%AppDir%scripts\genericclean"
4 changes: 2 additions & 2 deletions cleanall
@@ -1,5 +1,5 @@
#!/bin/sh

homeDir="$(cd "$(dirname "$0")"; pwd)"
appDir="$(cd "$(dirname "$0")"; pwd)"

${homeDir}/scripts/genericclean all
${appDir}/scripts/genericclean all
4 changes: 2 additions & 2 deletions cleanall.bat
@@ -1,5 +1,5 @@
@ECHO OFF

SET HomeDir=%~dp0
SET AppDir=%~dp0

CALL "%HomeDir%scripts\genericclean" all
CALL "%AppDir%scripts\genericclean" all
8 changes: 4 additions & 4 deletions distrib/linux/runjupyter
@@ -1,9 +1,9 @@
#!/bin/sh

homeDir="$(cd "$(dirname "$0")"; pwd)/../.."
appDir="$(cd "$(dirname "$0")"; pwd)/../.."

export PATH="${homeDir}/bin":$PATH
export PATH="${appDir}/bin":$PATH

"${homeDir}/python/bin/python" "${homeDir}/python/bin/set_python_path.py" "${homeDir}/python" -s
"${appDir}/python/bin/python" "${appDir}/python/bin/set_python_path.py" "${appDir}/python" -s

"${homeDir}/python/bin/jupyter" $*
"${appDir}/python/bin/jupyter" $*
12 changes: 6 additions & 6 deletions distrib/macos/runjupyter.in
@@ -1,12 +1,12 @@
#!/bin/sh

homeDir="$(cd "$(dirname "$0")"; pwd)/../../../../.."
appDir="$(cd "$(dirname "$0")"; pwd)/../../../../.."

export PATH="${homeDir}/@CMAKE_PROJECT_NAME@.app/Contents/MacOS":$PATH
export PATH="${appDir}/@CMAKE_PROJECT_NAME@.app/Contents/MacOS":$PATH

"${homeDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/python" \
"${homeDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/set_python_path.py" \
"${homeDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python" \
"${appDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/python" \
"${appDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/set_python_path.py" \
"${appDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python" \
-s

"${homeDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/jupyter" $*
"${appDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/jupyter" $*
6 changes: 3 additions & 3 deletions distrib/windows/jupyterlab.vbs
@@ -1,10 +1,10 @@
shell = CreateObject("WScript.Shell")
homeDir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
appDir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)

updatePythonPath = """"&homeDir&"\Python\bin\Python.exe"" """&homeDir&"\Python\Scripts\set_python_path.py"" """&homeDir&"\Python"" -s"
updatePythonPath = """"&appDir&"\Python\bin\Python.exe"" """&appDir&"\Python\Scripts\set_python_path.py"" """&appDir&"\Python"" -s"

shell.Run updatePythonPath, 0, True

cmd = """"&homeDir&"\Python\bin\Python.exe"" """&homeDir&"\Python\Scripts\start_jupyter.py"" lab --ip 127.0.0.1"
cmd = """"&appDir&"\Python\bin\Python.exe"" """&appDir&"\Python\Scripts\start_jupyter.py"" lab --ip 127.0.0.1"

shell.Run cmd, 1, False
6 changes: 3 additions & 3 deletions distrib/windows/jupyternotebook.vbs
@@ -1,10 +1,10 @@
shell = CreateObject("WScript.Shell")
homeDir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
appDir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)

updatePythonPath = """"&homeDir&"\Python\bin\Python.exe"" """&homeDir&"\Python\Scripts\set_python_path.py"" """&homeDir&"\Python"" -s"
updatePythonPath = """"&appDir&"\Python\bin\Python.exe"" """&appDir&"\Python\Scripts\set_python_path.py"" """&appDir&"\Python"" -s"

shell.Run updatePythonPath, 0, True

cmd = """"&homeDir&"\Python\bin\Python.exe"" """&homeDir&"\Python\Scripts\start_jupyter.py"" notebook --ip 127.0.0.1"
cmd = """"&appDir&"\Python\bin\Python.exe"" """&appDir&"\Python\Scripts\start_jupyter.py"" notebook --ip 127.0.0.1"

shell.Run cmd, 1, False
6 changes: 3 additions & 3 deletions distrib/windows/runjupyter.bat
Expand Up @@ -2,8 +2,8 @@

TITLE Running the Jupyter environment...

SET HomeDir=%~dp0..\..\
SET AppDir=%~dp0..\..\

"%HomeDir%Python\bin\Python.exe" "%HomeDir%Python\Scripts\set_python_path.py" "%HomeDir%Python" -s
"%AppDir%Python\bin\Python.exe" "%AppDir%Python\Scripts\set_python_path.py" "%AppDir%Python" -s

"%HomeDir%Python\bin\Python.exe" "%HomeDir%Python\Scripts\start_jupyter.py" %*
"%AppDir%Python\bin\Python.exe" "%AppDir%Python\Scripts\start_jupyter.py" %*
6 changes: 3 additions & 3 deletions format
@@ -1,12 +1,12 @@
#!/bin/sh

homeDir="$(cd "$(dirname "$0")"; pwd)"
appDir="$(cd "$(dirname "$0")"; pwd)"

if [ -d "${homeDir}/src" ]; then
if [ -d "${appDir}/src" ]; then
echo "\033[44;37;1mFormatting OpenCOR...\033[0m"

if [ "`hash clang-format 2>&1`" = "" ]; then
for i in `find ${homeDir}/src -name "*.cpp" -o -name "*.h" | sort | egrep -v "(3rdparty|\/ext\/|\/qzip)"`; do
for i in `find ${appDir}/src -name "*.cpp" -o -name "*.h" | sort | egrep -v "(3rdparty|\/ext\/|\/qzip)"`; do
echo "Formatting $i..."

clang-format -i -style=file $i
Expand Down
6 changes: 3 additions & 3 deletions format.bat
@@ -1,17 +1,17 @@
@ECHO OFF

SET HomeDir=%~dp0
SET AppDir=%~dp0
SET OrigDir=%CD%

IF EXIST "%HomeDir%src" (
IF EXIST "%AppDir%src" (
TITLE Formatting OpenCOR...

FOR %%X IN (clang-format.exe) DO (
SET ClangFormatFound=%%~$PATH:X
)

IF DEFINED ClangFormatFound (
CD "%HomeDir%src"
CD "%AppDir%src"

FOR /R %%I IN (*.cpp *.h) DO (
ECHO.%%I | FINDSTR /V "3rdparty \ext\ \qzip">NUL && (
Expand Down
4 changes: 2 additions & 2 deletions make
@@ -1,5 +1,5 @@
#!/bin/sh

homeDir="$(cd "$(dirname "$0")"; pwd)"
appDir="$(cd "$(dirname "$0")"; pwd)"

${homeDir}/scripts/genericmake Release $*
${appDir}/scripts/genericmake Release $*
4 changes: 2 additions & 2 deletions make.bat
@@ -1,5 +1,5 @@
@ECHO OFF

SET HomeDir=%~dp0
SET AppDir=%~dp0

CALL "%HomeDir%scripts\genericmake" Release %*
CALL "%AppDir%scripts\genericmake" Release %*
4 changes: 2 additions & 2 deletions maketests
@@ -1,5 +1,5 @@
#!/bin/sh

homeDir="$(cd "$(dirname "$0")"; pwd)"
appDir="$(cd "$(dirname "$0")"; pwd)"

${homeDir}/scripts/genericmake Tests $*
${appDir}/scripts/genericmake Tests $*
4 changes: 2 additions & 2 deletions maketests.bat
@@ -1,5 +1,5 @@
@ECHO OFF

SET HomeDir=%~dp0
SET AppDir=%~dp0

CALL "%HomeDir%scripts\genericmake" Tests %*
CALL "%AppDir%scripts\genericmake" Tests %*
8 changes: 4 additions & 4 deletions package
@@ -1,9 +1,9 @@
#!/bin/sh

homeDir="$(cd "$(dirname "$0")"; pwd)"
appDir="$(cd "$(dirname "$0")"; pwd)"

${homeDir}/clean
${homeDir}/make $*
${appDir}/clean
${appDir}/make $*

exitCode=$?

Expand All @@ -15,7 +15,7 @@ echo "\033[44;37;1mPackaging OpenCOR...\033[0m"

origDir=`pwd`

cd ${homeDir}/build
cd ${appDir}/build

if [ "`uname -s`" = "Linux" ]; then
cpack
Expand Down
8 changes: 4 additions & 4 deletions package.bat
Expand Up @@ -2,10 +2,10 @@

SETLOCAL ENABLEDELAYEDEXPANSION

SET HomeDir=%~dp0
SET AppDir=%~dp0

CALL "%HomeDir%clean"
CALL "%HomeDir%make" %*
CALL "%AppDir%clean"
CALL "%AppDir%make" %*

SET ExitCode=!ERRORLEVEL!

Expand All @@ -14,7 +14,7 @@ IF !ExitCode! EQU 0 (

SET OrigDir=%CD%

CD "%HomeDir%build"
CD "%AppDir%build"

cpack

Expand Down
6 changes: 3 additions & 3 deletions run
Expand Up @@ -2,12 +2,12 @@

echo "\033[44;37;1mRunning OpenCOR...\033[0m"

homeDir="$(cd "$(dirname "$0")"; pwd)"
appDir="$(cd "$(dirname "$0")"; pwd)"

if [ "`uname -s`" = "Linux" ]; then
appExe=${homeDir}/build/bin/OpenCOR
appExe=${appDir}/build/bin/OpenCOR
else
appExe=${homeDir}/build/OpenCOR.app/Contents/MacOS/OpenCOR
appExe=${appDir}/build/OpenCOR.app/Contents/MacOS/OpenCOR
fi

if [ -f ${appExe} ]; then
Expand Down
6 changes: 3 additions & 3 deletions runtests
Expand Up @@ -2,12 +2,12 @@

echo "\033[44;37;1mRunning OpenCOR's tests...\033[0m"

homeDir="$(cd "$(dirname "$0")"; pwd)"
appDir="$(cd "$(dirname "$0")"; pwd)"

if [ "`uname -s`" = "Linux" ]; then
OPENCOR_TESTS_EXE=${homeDir}/build/bin/runtests
OPENCOR_TESTS_EXE=${appDir}/build/bin/runtests
else
OPENCOR_TESTS_EXE=${homeDir}/build/OpenCOR.app/Contents/MacOS/runtests
OPENCOR_TESTS_EXE=${appDir}/build/OpenCOR.app/Contents/MacOS/runtests
fi

if [ -f ${OPENCOR_TESTS_EXE} ]; then
Expand Down
6 changes: 3 additions & 3 deletions scripts/genericclean
Expand Up @@ -6,12 +6,12 @@ else
echo "\033[44;37;1mCleaning OpenCOR...\033[0m"
fi

homeDir="$(cd "$(dirname "$0")"; pwd)"/..
appDir="$(cd "$(dirname "$0")"; pwd)"/..

rm -fr ${homeDir}/build/.clang-tidy ${homeDir}/build/.ninja* ${homeDir}/build/* > /dev/null 2>&1
rm -fr ${appDir}/build/.clang-tidy ${appDir}/build/.ninja* ${appDir}/build/* > /dev/null 2>&1

if [ "$1" = "all" ]; then
rm -fr ${homeDir}/ext/* > /dev/null 2>&1
rm -fr ${appDir}/ext/* > /dev/null 2>&1
fi

echo "\033[42;37;1mAll done!\033[0m"
10 changes: 5 additions & 5 deletions scripts/genericclean.bat
Expand Up @@ -6,20 +6,20 @@ IF "%1" == "all" (
TITLE Cleaning OpenCOR...
)

SET HomeDir=%~dp0..\
SET AppDir=%~dp0..\
SET OrigDir=%CD%

IF EXIST "%HomeDir%build" (
CD "%HomeDir%build"
IF EXIST "%AppDir%build" (
CD "%AppDir%build"

FOR %%I IN (*.*) DO ATTRIB -R "%%I"
FOR /D %%I IN (*.*) DO RMDIR /S /Q "%%I"
FOR %%I IN (*.*) DO IF NOT "%%I" == ".gitignore" DEL /Q "%%I"
)

IF "%1" == "all" (
IF EXIST "%HomeDir%ext" (
CD "%HomeDir%ext"
IF EXIST "%AppDir%ext" (
CD "%AppDir%ext"

FOR /D %%I IN (*.*) DO RMDIR /S /Q "%%I"
FOR %%I IN (*.*) DO IF NOT "%%I" == ".gitignore" DEL /Q "%%I"
Expand Down
6 changes: 3 additions & 3 deletions scripts/genericmake
@@ -1,8 +1,8 @@
#!/bin/sh

homeDir="$(cd "$(dirname "$0")"; pwd)"/..
appDir="$(cd "$(dirname "$0")"; pwd)"/..

if [ -d "${homeDir}/build" ]; then
if [ -d "${appDir}/build" ]; then
cmakeBuildType=$1

if [ "$cmakeBuildType" = "Release" ]; then
Expand Down Expand Up @@ -30,7 +30,7 @@ if [ -d "${homeDir}/build" ]; then

origDir=`pwd`

cd ${homeDir}/build
cd ${appDir}/build

cmake -G "$cmakeGenerator" -DCMAKE_BUILD_TYPE=$cmakeBuildType -DENABLE_TESTS=$enableTests ..

Expand Down
6 changes: 3 additions & 3 deletions scripts/genericmake.bat
@@ -1,8 +1,8 @@
SETLOCAL ENABLEDELAYEDEXPANSION

SET HomeDir=%~dp0..\
SET AppDir=%~dp0..\

IF EXIST "%HomeDir%build" (
IF EXIST "%AppDir%build" (
SET CMakeBuildType=%1

IF "!CMakeBuildType!" == "Release" (
Expand Down Expand Up @@ -34,7 +34,7 @@ IF EXIST "%HomeDir%build" (

SET OrigDir=%CD%

CD "%HomeDir%build"
CD "%AppDir%build"

IF DEFINED NinjaFound (
SET CMakeGenerator=Ninja
Expand Down

0 comments on commit bce956f

Please sign in to comment.