Author: bdemchak
Date: 2012-12-11 12:46:16 -0800 (Tue, 11 Dec 2012)
New Revision: 30996

Added:
   
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/cytoscape.bat
   
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/gen_vmoptions.bat
Removed:
   
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/cytoscape.bat
   
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/gen_vmoptions.bat
Log:
Changed gen_vmoptions.bat to generate memory directive in form -Xmx
Changed cytoscape.bat to consume memory directive and pass properly to Karaf

Deleted: 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/cytoscape.bat
===================================================================
--- 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/cytoscape.bat
   2012-12-11 19:33:01 UTC (rev 30995)
+++ 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/cytoscape.bat
   2012-12-11 20:46:16 UTC (rev 30996)
@@ -1,64 +0,0 @@
-@echo off
-setlocal ENABLEEXTENSIONS
-set KARAF_TITLE=Cytoscape
-set DEBUG_PORT=12345
-
-:: Create the Cytoscape.vmoptions file, if it doesn't exist.
-IF EXIST "Cytoscape.vmoptions" GOTO vmoptionsFileExists
-CMD /C gen_vmoptions.bat
-:vmoptionsFileExists
-
-
-IF EXIST "Cytoscape.vmoptions" GOTO itIsThere
-:: Run with defaults:
-echo "*** Missing Cytoscape.vmoptions, falling back to using defaults!"
-set JAVA_MAX_MEM=1550M
-GOTO setDebugOpts
-
-:: We end up here if we have a Cytoscape.vmoptions file:
-:itIsThere
-:: Read max memory
-setLocal EnableDelayedExpansion
-for /f "tokens=* delims= " %%a in (Cytoscape.vmoptions) do (
-set /a N+=1
-set opt!N!=%%a
-)
-set JAVA_MAX_MEM=!opt1!
-
-:setDebugOpts
-set JAVA_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE 
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%DEBUG_PORT%
-set PWD=%~dp0
-set KARAF_OPTS=-Xss10M -Dcytoscape.home="%PWD:\=\\%" -Duser.dir="%PWD:\=\\%" 
-splash:CytoscapeSplashScreen.png
-
-set KARAF_DATA=%USERPROFILE%\CytoscapeConfiguration\3\karaf_data
-if not exist "%KARAF_DATA%" (
-    mkdir "%KARAF_DATA%\tmp"
-)
-
-if not "X%JAVA_HOME%"=="X" goto TryJDKEnd
-goto :TryJRE
-
-:warn
-    echo %KARAF_TITLE%: %*
-goto :EOF
-
-:TryJRE
-    for /F "usebackq skip=2 tokens=3" %%A in (`reg query 
"HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" /v "CurrentVersion" 2^>nul`) 
do (
-        set CurrentVersion=%%A
-    )
-    if defined CurrentVersion (
-        for /F "usebackq skip=2 tokens=3*" %%A in (`reg query 
"HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\%CurrentVersion%" /v JavaHome 
2^>nul`) DO (
-            set JAVA_HOME=%%A %%B
-        )
-    )
-
-:TryJDKEnd
-    if not exist "%JAVA_HOME%" (
-        call :warn JAVA_HOME is not valid: "%JAVA_HOME%"
-        goto END
-    )
-    set JAVA=%JAVA_HOME%\bin\java
-:END
-
-:: This is probably wrong.  We don't really want the user to be in this 
directory, do we?
-framework/bin/karaf %1 %2 %3 %4 %5 %6 %7 %8

Added: 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/cytoscape.bat
===================================================================
--- 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/cytoscape.bat
                           (rev 0)
+++ 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/cytoscape.bat
   2012-12-11 20:46:16 UTC (rev 30996)
@@ -0,0 +1,68 @@
+@echo off
+setlocal ENABLEEXTENSIONS
+set KARAF_TITLE=Cytoscape
+set DEBUG_PORT=12345
+
+:: Create the Cytoscape.vmoptions file, if it doesn't exist.
+IF EXIST "Cytoscape.vmoptions" GOTO vmoptionsFileExists
+CMD /C gen_vmoptions.bat
+:vmoptionsFileExists
+
+
+IF EXIST "Cytoscape.vmoptions" GOTO itIsThere
+:: Run with defaults:
+echo "*** Missing Cytoscape.vmoptions, falling back to using defaults!"
+set JAVA_MAX_MEM=-Xmx1550M
+GOTO setDebugOpts
+
+:: We end up here if we have a Cytoscape.vmoptions file:
+:itIsThere
+:: Read max memory
+setLocal EnableDelayedExpansion
+for /f "tokens=* delims= " %%a in (Cytoscape.vmoptions) do (
+set /a N+=1
+set opt!N!=%%a
+)
+set JAVA_MAX_MEM=!opt1!
+
+:setDebugOpts
+set JAVA_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE 
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%DEBUG_PORT%
+set PWD=%~dp0
+set KARAF_OPTS=-Xss10M %JAVA_MAX_MEM% -Dcytoscape.home="%PWD:\=\\%" 
-Duser.dir="%PWD:\=\\%" -splash:CytoscapeSplashScreen.png
+
+set KARAF_DATA=%USERPROFILE%\CytoscapeConfiguration\3\karaf_data
+if not exist "%KARAF_DATA%" (
+    mkdir "%KARAF_DATA%\tmp"
+)
+
+if not "X%JAVA_HOME%"=="X" goto TryJDKEnd
+goto :TryJRE
+
+:warn
+    echo %KARAF_TITLE%: %*
+goto :EOF
+
+:TryJRE
+    for /F "usebackq skip=2 tokens=3" %%A in (`reg query 
"HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" /v "CurrentVersion" 2^>nul`) 
do (
+        set CurrentVersion=%%A
+    )
+    if defined CurrentVersion (
+        for /F "usebackq skip=2 tokens=3*" %%A in (`reg query 
"HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\%CurrentVersion%" /v JavaHome 
2^>nul`) DO (
+            set JAVA_HOME=%%A %%B
+        )
+    )
+
+:TryJDKEnd
+    if not exist "%JAVA_HOME%" (
+        call :warn JAVA_HOME is not valid: "%JAVA_HOME%"
+        goto END
+    )
+    set JAVA=%JAVA_HOME%\bin\java
+:END
+
+rem Karaf uses JAVA_MAX_MEM, so strip off the -Xmx and leave memory size
+set JAVA_MAX_MEM=%JAVA_MAX_MEM:-Xmx=%
+
+
+:: This is probably wrong.  We don't really want the user to be in this 
directory, do we?
+framework/bin/karaf %1 %2 %3 %4 %5 %6 %7 %8

Deleted: 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/gen_vmoptions.bat
===================================================================
--- 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/gen_vmoptions.bat
       2012-12-11 19:33:01 UTC (rev 30995)
+++ 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/gen_vmoptions.bat
       2012-12-11 20:46:16 UTC (rev 30996)
@@ -1,50 +0,0 @@
-@echo off
-
-:: Generates the Cytoscape.vmoptions file based on whether
-:: we're dealing with a 32 bit or 64 bit JVM.
-
-:: Create the .cytoscape directory if it doesn't already exist
-;if exist "%HOMEPATH%\.cytoscape" goto dot_cytoscape_exists
-;mkdir "%HOMEPATH%\.cytoscape"
-;:dot_cytoscape_exists
-
-set physmem=768
-set mem=768
-if exist findmem.out del findmem.out
-systeminfo | find "Total Physical Memory" > findmem.out
-if %ERRORLEVEL% NEQ 0 GOTO Javatest
-for /f "tokens=4" %%i in (findmem.out) do set physmem=%%i
-set physmem=%physmem:,=%
-
-if %physmem% GTR 1536 set mem=1024
-if %physmem% GTR 2048 set mem=1536
-if %physmem% GTR 3072 set /a mem=%physmem%-1024
-REM if %physmem% GTR 4096 set mem=3072
-REM if %physmem% GTR 9216 set mem=4096
-
-:Javatest
-       if exist findstr.out del findstr.out
-       java -version 2>&1 | findstr /I 64-Bit > findstr.out
-       if %ERRORLEVEL% EQU 0 GOTO 64bit
-       java -version 2>&1 | findstr /i Java > findstr.out
-       IF %ERRORLEVEL% EQU 0 GOTO 32bit
-       goto Nojava
-
-:64bit
-       REM echo "64 bit %mem% MB"
-       echo -Xmx%mem%M  >Cytoscape.vmoptions
-       goto End
-
-:32bit
-       REM echo "32 bit %mem% MB"
-       REM Some java versions can only support 1100MB
-       if %mem% GTR 1100 set mem=1100
-       echo -Xmx%mem%M >Cytoscape.vmoptions
-       goto End
-
-:Nojava
-       echo ERROR: Can't find java executable
-
-:End
-       del findstr.out
-       del findmem.out

Added: 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/gen_vmoptions.bat
===================================================================
--- 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/gen_vmoptions.bat
                               (rev 0)
+++ 
core3/gui-distribution/branches/3.0.0-release/assembly/src/main/bin/gen_vmoptions.bat
       2012-12-11 20:46:16 UTC (rev 30996)
@@ -0,0 +1,50 @@
+@echo off
+
+:: Generates the Cytoscape.vmoptions file based on whether
+:: we're dealing with a 32 bit or 64 bit JVM.
+
+:: Create the .cytoscape directory if it doesn't already exist
+;if exist "%HOMEPATH%\.cytoscape" goto dot_cytoscape_exists
+;mkdir "%HOMEPATH%\.cytoscape"
+;:dot_cytoscape_exists
+
+set physmem=768
+set mem=768
+if exist findmem.out del findmem.out
+systeminfo | find "Total Physical Memory" > findmem.out
+if %ERRORLEVEL% NEQ 0 GOTO Javatest
+for /f "tokens=4" %%i in (findmem.out) do set physmem=%%i
+set physmem=%physmem:,=%
+
+if %physmem% GTR 1536 set mem=1024
+if %physmem% GTR 2048 set mem=1536
+if %physmem% GTR 3072 set /a mem=%physmem%-1024
+REM if %physmem% GTR 4096 set mem=3072
+REM if %physmem% GTR 9216 set mem=4096
+
+:Javatest
+       if exist findstr.out del findstr.out
+       java -version 2>&1 | findstr /I 64-Bit > findstr.out
+       if %ERRORLEVEL% EQU 0 GOTO 64bit
+       java -version 2>&1 | findstr /i Java > findstr.out
+       IF %ERRORLEVEL% EQU 0 GOTO 32bit
+       goto Nojava
+
+:64bit
+       REM echo "64 bit %mem% MB"
+        echo -Xmx%mem%M  >Cytoscape.vmoptions
+       goto End
+
+:32bit
+       REM echo "32 bit %mem% MB"
+       REM Some java versions can only support 1100MB
+       if %mem% GTR 1100 set mem=1100
+        echo -Xmx%mem%M >Cytoscape.vmoptions
+       goto End
+
+:Nojava
+       echo ERROR: Can't find java executable
+
+:End
+       del findstr.out
+       del findmem.out

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to