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 1, 2019
1 parent c9d8962 commit df48d3e
Show file tree
Hide file tree
Showing 39 changed files with 101 additions and 101 deletions.
4 changes: 2 additions & 2 deletions clean
@@ -1,5 +1,5 @@
#!/bin/sh

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

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

SET AppDir=%~dp0
SET CrtDir=%~dp0

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

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

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

SET AppDir=%~dp0
SET CrtDir=%~dp0

CALL "%AppDir%scripts\genericclean" all
CALL "%CrtDir%scripts\genericclean" all
4 changes: 2 additions & 2 deletions distrib/linux/application.in
@@ -1,5 +1,5 @@
#!/bin/sh

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

"${appDir}/bin/@CMAKE_PROJECT_NAME@" $*
"${crtDir}/bin/@CMAKE_PROJECT_NAME@" $*
4 changes: 2 additions & 2 deletions distrib/linux/jupyterconsole.in
@@ -1,5 +1,5 @@
#!/bin/sh

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

"${appDir}/runjupyter" console --kernel @CMAKE_PROJECT_NAME@ $*
"${crtDir}/runjupyter" console --kernel @CMAKE_PROJECT_NAME@ $*
4 changes: 2 additions & 2 deletions distrib/linux/jupyterlab
@@ -1,5 +1,5 @@
#!/bin/sh

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

"${appDir}/runjupyter" lab --ip 127.0.0.1 $*
"${crtDir}/runjupyter" lab --ip 127.0.0.1 $*
4 changes: 2 additions & 2 deletions distrib/linux/jupyternotebook
@@ -1,5 +1,5 @@
#!/bin/sh

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

"${appDir}/runjupyter" notebook --ip 127.0.0.1 $*
"${crtDir}/runjupyter" notebook --ip 127.0.0.1 $*
4 changes: 2 additions & 2 deletions distrib/linux/pythonshell.in
@@ -1,5 +1,5 @@
#!/bin/sh

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

"${appDir}/bin/@CMAKE_PROJECT_NAME@" -c PythonShell $*
"${crtDir}/bin/@CMAKE_PROJECT_NAME@" -c PythonShell $*
8 changes: 4 additions & 4 deletions distrib/linux/runjupyter
@@ -1,9 +1,9 @@
#!/bin/sh

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

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

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

"${appDir}/python/bin/jupyter" $*
"${crtDir}/python/bin/jupyter" $*
4 changes: 2 additions & 2 deletions distrib/macos/application.in
@@ -1,5 +1,5 @@
#!/bin/sh

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

"${appDir}/@CMAKE_PROJECT_NAME@.app/Contents/MacOS/@CMAKE_PROJECT_NAME@" $*
"${crtDir}/@CMAKE_PROJECT_NAME@.app/Contents/MacOS/@CMAKE_PROJECT_NAME@" $*
4 changes: 2 additions & 2 deletions distrib/macos/jupyterconsole.in
@@ -1,5 +1,5 @@
#!/bin/sh

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

"${appDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/runjupyter" console --kernel @CMAKE_PROJECT_NAME@ $*
"${crtDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/runjupyter" console --kernel @CMAKE_PROJECT_NAME@ $*
4 changes: 2 additions & 2 deletions distrib/macos/jupyterlab.in
@@ -1,5 +1,5 @@
#!/bin/sh

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

"${appDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/runjupyter" lab --ip 127.0.0.1 $*
"${crtDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/runjupyter" lab --ip 127.0.0.1 $*
4 changes: 2 additions & 2 deletions distrib/macos/jupyternotebook.in
@@ -1,5 +1,5 @@
#!/bin/sh

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

"${appDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/runjupyter" notebook --ip 127.0.0.1 $*
"${crtDir}/@CMAKE_PROJECT_NAME@.app/Contents/Frameworks/Python/bin/runjupyter" notebook --ip 127.0.0.1 $*
4 changes: 2 additions & 2 deletions distrib/macos/pythonshell.in
@@ -1,5 +1,5 @@
#!/bin/sh

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

"${appDir}/@CMAKE_PROJECT_NAME@.app/Contents/MacOS/@CMAKE_PROJECT_NAME@" -c PythonShell $*
"${crtDir}/@CMAKE_PROJECT_NAME@.app/Contents/MacOS/@CMAKE_PROJECT_NAME@" -c PythonShell $*
8 changes: 4 additions & 4 deletions distrib/macos/runjupyter
@@ -1,9 +1,9 @@
#!/bin/sh

pythonBinDir="$(cd "$(dirname "$0")"; pwd)"
crtDir="$(cd "$(dirname "$0")"; pwd)"

export PATH=${pythonBinDir}/../../../MacOS:$PATH
export PATH=${crtDir}/../../../MacOS:$PATH

"${pythonBinDir}/python" "${pythonBinDir}/set_python_path.py" "${pythonBinDir}/.." -s
"${crtDir}/python" "${crtDir}/set_python_path.py" "${crtDir}/.." -s

"${pythonBinDir}/jupyter" $*
"${crtDir}/jupyter" $*
4 changes: 2 additions & 2 deletions distrib/windows/jupyterconsole.bat.in
Expand Up @@ -2,6 +2,6 @@

TITLE Running the Jupyter Lab environment...

SET appDir=%~dp0
SET CrtDir=%~dp0

CALL "%appDir%runjupyter.bat" console --kernel ${CMAKE_PROJECT_NAME} %*
CALL "%CrtDir%runjupyter.bat" console --kernel ${CMAKE_PROJECT_NAME} %*
4 changes: 2 additions & 2 deletions distrib/windows/jupyterlab.bat
Expand Up @@ -2,6 +2,6 @@

TITLE Running the Jupyter Lab environment...

SET appDir=%~dp0
SET CrtDir=%~dp0

CALL "%appDir%runjupyter.bat" lab --ip 127.0.0.1 %*
CALL "%CrtDir%runjupyter.bat" lab --ip 127.0.0.1 %*
6 changes: 3 additions & 3 deletions distrib/windows/jupyterlab.vbs
@@ -1,10 +1,10 @@
shell = CreateObject("WScript.Shell")
appDir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
crtDir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)

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

shell.Run updatePythonPath, 0, True

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

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

TITLE Running the Jupyter Notebook environment...

SET appDir=%~dp0
SET CrtDir=%~dp0

CALL "%appDir%runjupyter.bat" notebook --ip 127.0.0.1 %*
CALL "%CrtDir%runjupyter.bat" notebook --ip 127.0.0.1 %*
6 changes: 3 additions & 3 deletions distrib/windows/jupyternotebook.vbs
@@ -1,10 +1,10 @@
shell = CreateObject("WScript.Shell")
appDir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
crtDir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)

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

shell.Run updatePythonPath, 0, True

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

shell.Run cmd, 1, False
4 changes: 2 additions & 2 deletions distrib/windows/pythonshell.bat.in
@@ -1,5 +1,5 @@
@ECHO OFF

SET appDir=%~dp0
SET CrtDir=%~dp0

"%appDir%bin\${CMAKE_PROJECT_NAME}" -c PythonShell %*
"%CrtDir%bin\${CMAKE_PROJECT_NAME}" -c PythonShell %*
6 changes: 3 additions & 3 deletions distrib/windows/runjupyter.bat
Expand Up @@ -2,8 +2,8 @@

TITLE Running the Jupyter environment...

SET appDir=%~dp0
SET CrtDir=%~dp0

"%appDir%Python\bin\Python.exe" "%appDir%Python\Scripts\set_python_path.py" "%appDir%Python" -s
"%CrtDir%Python\bin\Python.exe" "%CrtDir%Python\Scripts\set_python_path.py" "%CrtDir%Python" -s

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

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

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

if [ "`hash clang-format 2>&1`" = "" ]; then
for i in `find ${appDir}/src -name "*.cpp" -o -name "*.h" | sort | egrep -v "(3rdparty|\/ext\/|\/qzip)"`; do
for i in `find ${crtDir}/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 AppDir=%~dp0
SET CrtDir=%~dp0
SET OrigDir=%CD%

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

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

IF DEFINED ClangFormatFound (
CD "%AppDir%src"
CD "%CrtDir%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

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

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

SET AppDir=%~dp0
SET CrtDir=%~dp0

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

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

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

SET AppDir=%~dp0
SET CrtDir=%~dp0

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

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

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

exitCode=$?

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

origDir=`pwd`

cd ${appDir}/build
cd ${crtDir}/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 AppDir=%~dp0
SET CrtDir=%~dp0

CALL "%AppDir%clean"
CALL "%AppDir%make" %*
CALL "%CrtDir%clean"
CALL "%CrtDir%make" %*

SET ExitCode=!ERRORLEVEL!

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

SET OrigDir=%CD%

CD "%AppDir%build"
CD "%CrtDir%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"

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

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

if [ -f ${appExe} ]; then
Expand Down
6 changes: 3 additions & 3 deletions run.vbs
@@ -1,13 +1,13 @@
appExe = Left(Wscript.ScriptFullName, Len(Wscript.ScriptFullName)-Len(Wscript.ScriptName))&"build\bin\OpenCOR.exe"
AppExe = Left(Wscript.ScriptFullName, Len(Wscript.ScriptFullName)-Len(Wscript.ScriptName))&"build\bin\OpenCOR.exe"

If CreateObject("Scripting.FileSystemObject").FileExists(appExe) Then
If CreateObject("Scripting.FileSystemObject").FileExists(AppExe) Then
args = ""

For Each arg in WScript.Arguments
args = args&" "&arg
Next

cmd = """"&appExe&args&""""
cmd = """"&AppExe&args&""""

CreateObject("WScript.Shell").Run cmd, 1, False
Else
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"

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

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

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

TITLE Running OpenCOR's tests...

SET appTestsExe=%~dp0build\bin\runtests.exe
SET AppTestsExe=%~dp0build\bin\runtests.exe

IF NOT EXIST %appTestsExe% (
IF NOT EXIST %AppTestsExe% (
ECHO OpenCOR's tests must first be built before being run.
) ELSE (
"%appTestsExe%"
"%AppTestsExe%"
)

0 comments on commit df48d3e

Please sign in to comment.