Eclipse.bat: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
mNo edit summary
(Updated variable names to be common with GRASS startup.)
 
(One intermediate revision by one other user not shown)
Line 10: Line 10:
echo.
echo.
echo. Eclipse 4.5 (Mars) 32-bit for GRASS Development
echo. Eclipse 4.5 (Mars) 32-bit for GRASS Development
:: top-level directory of the OSGeo4W installation
set OSGEO4W_ROOT=C:\OSGeo4W
:: top-level directory of the GRASS installation
set GISBASE=%OSGEO4W_ROOT%\src\grass7_trunk\dist.i686-pc-mingw32


:: User Home
:: User Home


set "HOME=%HOMEDRIVE%\%HOMEPATH%"
if not defined HOME set HOME=%USERPROFILE%


:: GRASS Database
:: GRASS Database


set "GISDBASE=%HOME%\grassdata"
set GISDBASE=%HOME%\grassdata
set "LOCATION_NAME=nc_spm_08_grass7"
 
set "MAPSET=user1"
:: GRASS Location and Mapset for this session
::set "MAPSET=PERMANENT"
 
::set "GUI=wxpython"
set LOCATION_NAME=nc_spm_08_grass7
set "GUI=text"
set MAPSET=user1
::set MAPSET=PERMANENT
::set GUI=wxpython
set GUI=text


:: Set Debug Message Level
:: Set Debug Message Level
::   0 - silence
:: 0 - silence
::   1 - message is printed once or few times per module
:: 1 - message is printed once or few times per module
::   3 - each row (raster) or line (vector)
:: 3 - each row (raster) or line (vector)
::   5 - each cell (raster) or point (vector)  
:: 5 - each cell (raster) or point (vector)  
 
set MESSAGE_LEVEL=0


set "MESSAGE_LEVEL=^1"
set MINGW_HOME=%OSGEO4W_ROOT%
set MSYS_HOME=%OSGEO4W_ROOT%\apps\msys


set "MINGW_HOME=C:\OSGeo4W"
set PROJ_LIB=%OSGEO4W_ROOT%\share\proj
set "MSYS_HOME=C:\OSGeo4W\apps\msys"
set GDAL_DATA=%OSGEO4W_ROOT%\share\gdal
set GDAL_DRIVER_PATH=%OSGEO4W_ROOT%\bin\gdalplugins
set GEOTIFF_CSV=%OSGEO4W_ROOT%\share\epsg_csv


:: Python Interpreter and Libraries
:: Python Interpreter and Libraries


set "PYTHONHOME=C:\OSGeo4W\apps\Python27"
set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python27
set "PYTHONPATH=C:\OSGeo4W\apps\grass\grass-7.1.svn\etc\python;C:\OSGeo4W\apps\grass\grass-7.1.svn\gui\wxpython"
 
:: Build tools and utilities


set "TOOLS=C:\OSGeo4W\bin;C:\OSGeo4W\apps\msys\bin;C:\OSGeo4W\apps\Python27"
set PYTHONPATH=%OSGEO4W_ROOT%\apps\grass\grass-7.1.svn\etc\python
set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\grass\grass-7.1.svn\gui\wxpython


:: GISBASE needs to be set to the top-level directory
:: GRASS environment
:: of the GRASS installation.


set "GISBASE=C:\OSGeo4W\src\grass7_trunk\dist.i686-pc-mingw32"
set GRASS_PYTHON=%OSGEO4W_ROOT%\bin\python.exe
set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj


:: GISRC needs to contain the absolute path to a file containing
:: GISRC needs to contain the absolute path to a file containing
:: settings for GISDBASE, LOCATION_NAME and MAPSET.
:: settings for GISDBASE, LOCATION_NAME and MAPSET.


set "GISRC=%HOME%\gisrc"
set GISRC=%HOME%\gisrc


:: Create GISRC file
:: Create GISRC file
Line 59: Line 73:
:: ./dist.i686-pc-mingw32/demolocation/.grassrc71
:: ./dist.i686-pc-mingw32/demolocation/.grassrc71


echo GISDBASE: %GISDBASE%>> %GISRC%
echo GISDBASE: %GISDBASE%> %GISRC%
echo LOCATION_NAME: %LOCATION_NAME%> %GISRC%
echo LOCATION_NAME: %LOCATION_NAME%>> %GISRC%
echo MAPSET: %MAPSET%>> %GISRC%  
echo MAPSET: %MAPSET%>> %GISRC%  
echo GUI: %GUI%>> %GISRC%
echo GUI: %GUI%>> %GISRC%
echo DEBUG: %MESSAGE_LEVEL%>> %GISRC%
echo DEBUG: ^%MESSAGE_LEVEL%>> %GISRC%
echo.


::type %GISRC%
::type %GISRC%


set "PROJ=C:\OSGeo4W\share\proj"
set PATH=%PATH%;%OSGEO4W_ROOT%\bin
set "GLIB=%GISBASE%\lib"
set PATH=%PATH%;%OSGEO4W_ROOT%\share\proj
set "GBIN=%GISBASE%\bin"
set PATH=%PATH%;%OSGEO4W_ROOT%\apps\msys\bin
set "GSCRIPTS=%GISBASE%\scripts"
set PATH=%PATH%;%OSGEO4W_ROOT%\apps\Python27
 
set PATH=%PATH%;%OSGEO4W_ROOT%\apps\Python27\Scripts
 
set PATH=%PATH%;%GISBASE%\bin
:: PATH needs to include %GISBASE%\bin and %GISBASE%\scripts and %GISBASE%\libs.
set PATH=%PATH%;%GISBASE%\lib
set PATH=%PATH%;%TOOLS%;%GBIN%;%GLIB%;%GSCRIPTS%;%PROJ%
set PATH=%PATH%;%GISBASE%\scripts


echo.
echo.
Line 83: Line 98:
echo. LOCATION_NAME  : %LOCATION_NAME%
echo. LOCATION_NAME  : %LOCATION_NAME%
echo. MAPSET          : %MAPSET%
echo. MAPSET          : %MAPSET%
echo. MESSAGE_LEVEL  : %MESSAGE_LEVEL%
echo. PYTHONPATH      : %PYTHONPATH%
echo. PYTHONPATH      : %PYTHONPATH%
echo. PYTHONHOME      : %PYTHONHOME%
echo. PYTHONHOME      : %PYTHONHOME%
 
::echo. PATH            : %PATH%
echo.


C:\eclipse-4.5-mars-32bit\eclipse.exe
C:\eclipse-4.5-mars-32bit\eclipse.exe
Line 91: Line 108:
ENDLOCAL
ENDLOCAL
</source>
</source>
[[Category: Documentation]]
[[Category: Development]]

Latest revision as of 01:25, 1 September 2015

@echo off
SETLOCAL

::
:: Reference:
:: http://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly
::

echo.
echo. Eclipse 4.5 (Mars) 32-bit for GRASS Development

:: top-level directory of the OSGeo4W installation

set OSGEO4W_ROOT=C:\OSGeo4W

:: top-level directory of the GRASS installation

set GISBASE=%OSGEO4W_ROOT%\src\grass7_trunk\dist.i686-pc-mingw32

:: User Home

if not defined HOME set HOME=%USERPROFILE%

:: GRASS Database

set GISDBASE=%HOME%\grassdata

:: GRASS Location and Mapset for this session

set LOCATION_NAME=nc_spm_08_grass7
set MAPSET=user1
::set MAPSET=PERMANENT
::set GUI=wxpython
set GUI=text

:: Set Debug Message Level
:: 0 - silence
:: 1 - message is printed once or few times per module
:: 3 - each row (raster) or line (vector)
:: 5 - each cell (raster) or point (vector) 

set MESSAGE_LEVEL=0

set MINGW_HOME=%OSGEO4W_ROOT%
set MSYS_HOME=%OSGEO4W_ROOT%\apps\msys

set PROJ_LIB=%OSGEO4W_ROOT%\share\proj
set GDAL_DATA=%OSGEO4W_ROOT%\share\gdal
set GDAL_DRIVER_PATH=%OSGEO4W_ROOT%\bin\gdalplugins
set GEOTIFF_CSV=%OSGEO4W_ROOT%\share\epsg_csv

:: Python Interpreter and Libraries

set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python27

set PYTHONPATH=%OSGEO4W_ROOT%\apps\grass\grass-7.1.svn\etc\python
set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\grass\grass-7.1.svn\gui\wxpython

:: GRASS environment

set GRASS_PYTHON=%OSGEO4W_ROOT%\bin\python.exe
set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj

:: GISRC needs to contain the absolute path to a file containing
:: settings for GISDBASE, LOCATION_NAME and MAPSET.

set GISRC=%HOME%\gisrc

:: Create GISRC file
:: Examples:
:: ./demolocation/grassrc.tmpl
:: ./dist.i686-pc-mingw32/demolocation/.grassrc71

echo GISDBASE: %GISDBASE%> %GISRC%
echo LOCATION_NAME: %LOCATION_NAME%>> %GISRC%
echo MAPSET: %MAPSET%>> %GISRC% 
echo GUI: %GUI%>> %GISRC%
echo DEBUG: ^%MESSAGE_LEVEL%>> %GISRC%
echo.

::type %GISRC%

set PATH=%PATH%;%OSGEO4W_ROOT%\bin
set PATH=%PATH%;%OSGEO4W_ROOT%\share\proj
set PATH=%PATH%;%OSGEO4W_ROOT%\apps\msys\bin
set PATH=%PATH%;%OSGEO4W_ROOT%\apps\Python27
set PATH=%PATH%;%OSGEO4W_ROOT%\apps\Python27\Scripts
set PATH=%PATH%;%GISBASE%\bin
set PATH=%PATH%;%GISBASE%\lib
set PATH=%PATH%;%GISBASE%\scripts

echo.
echo. HOME            : %HOME%
echo. GISBASE         : %GISBASE%
echo. GISRC           : %GISRC%
echo. GISDBASE        : %GISDBASE%
echo. LOCATION_NAME   : %LOCATION_NAME%
echo. MAPSET          : %MAPSET%
echo. MESSAGE_LEVEL   : %MESSAGE_LEVEL%
echo. PYTHONPATH      : %PYTHONPATH%
echo. PYTHONHOME      : %PYTHONHOME%
::echo. PATH            : %PATH%
echo.

C:\eclipse-4.5-mars-32bit\eclipse.exe

ENDLOCAL