setlocal
call settings.bat

git clone -b tags/1.11.2 https://github.com/OSGeo/gdal.git
cd gdal\gdal

if "%1"=="clean" (git clean -f -x)

SET "PREFIX1=%PREFIX:\=/%"
set GDAL_HOME=%PREFIX%

if "%COMPILER%" == "MINGW" (
  SET PKG_CONFIG_PATH=/%PREFIX1::=%/lib/pkgconfig
  SET "PATH=%MSYSDIR%;%PREFIX%\bin;%PATH%"
rem set "LIBS=-lspatialite -lsqlite3 -lgeos_c -lfreexl -lexpat -lproj -lxml2 -liconv -lz"
  if NOT EXIST GDALmake.opt (bash -c "./configure %CONFARGS% --without-libtool --disable-static --enable-shared --without-python --with-spatialite=%PREFIX:\=/% --with-expat=%PREFIX:\=/% --with-sqlite3=%PREFIX:\=/% --with-freexl=%PREFIX:\=/" )
  %ER%
rem Build EXEs against DLL, not static .a
  bash -c "sed -i GDALmake.opt -e 's@endif # HAVE_LIBTOOL@endif # HAVE_LIBTOOL\nEXE_DEP_LIBS=$(GDAL_SLIB)@g'"
rem Omit GDAL_ROOT to shorten command line
  bash -c "sed -i GNUmakefile -e 's@\$(GDAL_ROOT)\/@@g'"
  bash -c "make install"
  %ER%
  copy /y %PREFIX%\lib\libgdal.dll %PREFIX%\bin
) else (

if "%COMPILER:32=%"=="%COMPILER%" (
  "%SEDC%" -i nmake.opt -e "s@#WIN64@WIN64@"
)

rem "%SEDC%" -i nmake.opt -e "s@DLLBUILD=1@DLLBUILD=0@"

"%SEDC%" -i nmake.opt -e "s@#SQLITE_INC=.*@SQLITE_INC=-I$(PREFIX)\\\\include -DHAVE_SPATIALITE@"
"%SEDC%" -i nmake.opt -e "s@#SQLITE_LIB=.*@SQLITE_LIB=$(PREFIX)\\\\lib\\\\spatialite.lib $(PREFIX)\\\\lib\\\\geos_c.lib $(PREFIX)\\\\lib\\\\sqlite3.lib@"
"%SEDC%" -i nmake.opt -e "s@#SPATIALITE_412_OR_LATER@SPATIALITE_412_OR_LATER@"

"%SEDC%" -i nmake.opt -e "s@#LIBXML2_INC =.*@LIBXML2_INC = -I$(PREFIX)\\\\include@"
"%SEDC%" -i nmake.opt -e "s@#LIBXML2_LIB =.*@LIBXML2_LIB = $(PREFIX)\\\\lib\\\\libxml2_a.lib@"

"%SEDC%" -i nmake.opt -e "s@#FREEXL_CFLAGS =.*@FREEXL_CFLAGS = -I$(PREFIX)\\\\include@"
"%SEDC%" -i nmake.opt -e "s@#FREEXL_LIBS =.*@FREEXL_LIBS = $(PREFIX)\\\\lib\\\\freexl.lib@"

"%SEDC%" -i nmake.opt -e "s@#LIBICONV_INCLUDE =.*@LIBICONV_INCLUDE = -I$(PREFIX)\\\\include@"
"%SEDC%" -i nmake.opt -e "s@#LIBICONV_LIBRARY =.*@LIBICONV_LIBRARY = $(PREFIX)\\\\lib\\\\libiconv.lib@"
"%SEDC%" -i nmake.opt -e "s@#LIBICONV_CFLAGS =.*@LIBICONV_CFLAGS = -DICONV_CONST=const@"

"%SEDC%" -i nmake.opt -e "s@#PROJ_FLAGS =.*@PROJ_FLAGS = -DPROJ_STATIC@"
"%SEDC%" -i nmake.opt -e "s@#PROJ_INCLUDE =.*@PROJ_INCLUDE = -I$(PREFIX)\\\\include@"
"%SEDC%" -i nmake.opt -e "s@#PROJ_LIBRARY =.*@PROJ_LIBRARY = $(PREFIX)\\\\lib\\\\proj.lib@"

rem "%SEDC%" -i nmake.opt -e s@#SQLITE_LIB=.*@SQLITE_LIB=\$\(PREFIX\)\\\\lib\\\\sqlite3.lib@"
rem "%SEDC%" -i nmake.opt -e "s@#SQLITE_INC=.*@SQLITE_INC=-I\$\(PREFIX\)\\\\include@"

if "%Variant%" == "Debug" (
   set "DBG=DEBUG=1"
   "%SEDC%" -i nmake.opt -e "s@\/MD @\/MDd @"
) else (
   set DBG
)

nmake -f makefile.vc %DBG%
%ER%
nmake -f makefile.vc %DBG% devinstall
%ER%
ECHO -------------  Installed to %PREFIX%  --------------

cd ..\..

)

setlocal
call settings.bat

git clone -b tags/1.11.2 https://github.com/OSGeo/gdal.git
cd gdal\gdal

if "%1"=="clean" (git clean -f -x)

SET "PREFIX1=%PREFIX:\=/%"
set GDAL_HOME=%PREFIX%

if "%COMPILER%" == "MINGW" (
  SET PKG_CONFIG_PATH=/%PREFIX1::=%/lib/pkgconfig
  SET "PATH=%MSYSDIR%;%PREFIX%\bin;%PATH%"
rem set "LIBS=-lspatialite -lsqlite3 -lgeos_c -lfreexl -lexpat -lproj -lxml2 -liconv -lz"
  if NOT EXIST GDALmake.opt (bash -c "./configure %CONFARGS% --without-libtool --disable-static --enable-shared --without-python --with-spatialite=%PREFIX:\=/% --with-expat=%PREFIX:\=/% --with-sqlite3=%PREFIX:\=/% --with-freexl=%PREFIX:\=/" )
  %ER%
rem Build EXEs against DLL, not static .a
  bash -c "sed -i GDALmake.opt -e 's@endif # HAVE_LIBTOOL@endif # HAVE_LIBTOOL\nEXE_DEP_LIBS=$(GDAL_SLIB)@g'"
rem Omit GDAL_ROOT to shorten command line
  bash -c "sed -i GNUmakefile -e 's@\$(GDAL_ROOT)\/@@g'"
  bash -c "make install"
  %ER%
  copy /y %PREFIX%\lib\libgdal.dll %PREFIX%\bin
) else (

if "%COMPILER:32=%"=="%COMPILER%" (
  "%SEDC%" -i nmake.opt -e "s@#WIN64@WIN64@"
)

echo "Using latest cpl_config.h.vc file to support newer compilers"
git checkout origin/HEAD port/cpl_config.h.vc

rem "%SEDC%" -i nmake.opt -e "s@DLLBUILD=1@DLLBUILD=0@"

"%SEDC%" -i nmake.opt -e "s@#SQLITE_INC=.*@SQLITE_INC=-I$(PREFIX)\\\\include -DHAVE_SPATIALITE@"
"%SEDC%" -i nmake.opt -e "s@#SQLITE_LIB=.*@SQLITE_LIB=$(PREFIX)\\\\lib\\\\spatialite.lib $(PREFIX)\\\\lib\\\\geos_c.lib $(PREFIX)\\\\lib\\\\sqlite3.lib@"
"%SEDC%" -i nmake.opt -e "s@#SPATIALITE_412_OR_LATER@SPATIALITE_412_OR_LATER@"

"%SEDC%" -i nmake.opt -e "s@#LIBXML2_INC =.*@LIBXML2_INC = -I$(PREFIX)\\\\include@"
"%SEDC%" -i nmake.opt -e "s@#LIBXML2_LIB =.*@LIBXML2_LIB = $(PREFIX)\\\\lib\\\\libxml2_a.lib@"

"%SEDC%" -i nmake.opt -e "s@#FREEXL_CFLAGS =.*@FREEXL_CFLAGS = -I$(PREFIX)\\\\include@"
"%SEDC%" -i nmake.opt -e "s@#FREEXL_LIBS =.*@FREEXL_LIBS = $(PREFIX)\\\\lib\\\\freexl.lib@"

"%SEDC%" -i nmake.opt -e "s@#LIBICONV_INCLUDE =.*@LIBICONV_INCLUDE = -I$(PREFIX)\\\\include@"
"%SEDC%" -i nmake.opt -e "s@#LIBICONV_LIBRARY =.*@LIBICONV_LIBRARY = $(PREFIX)\\\\lib\\\\iconv.lib@"
"%SEDC%" -i nmake.opt -e "s@#LIBICONV_CFLAGS =.*@LIBICONV_CFLAGS = -DICONV_CONST=const@"

"%SEDC%" -i nmake.opt -e "s@#PROJ_FLAGS =.*@PROJ_FLAGS = -DPROJ_STATIC@"
"%SEDC%" -i nmake.opt -e "s@#PROJ_INCLUDE =.*@PROJ_INCLUDE = -I$(PREFIX)\\\\include@"
"%SEDC%" -i nmake.opt -e "s@#PROJ_LIBRARY =.*@PROJ_LIBRARY = $(PREFIX)\\\\lib\\\\proj.lib@"

"%SEDC%" -i nmake.opt -e "s@ODBC_SUPPORTED = 1@#ODBC_SUPPORTED = 1@"

rem "%SEDC%" -i nmake.opt -e s@#SQLITE_LIB=.*@SQLITE_LIB=\$\(PREFIX\)\\\\lib\\\\sqlite3.lib@"
rem "%SEDC%" -i nmake.opt -e "s@#SQLITE_INC=.*@SQLITE_INC=-I\$\(PREFIX\)\\\\include@"

if "%Variant%" == "Debug" (
   set "DBG=DEBUG=1"
   "%SEDC%" -i nmake.opt -e "s@\/MD @\/MDd @"
) else (
   set DBG
)

nmake -f makefile.vc %DBG%
%ER%
nmake -f makefile.vc %DBG% devinstall
%ER%
ECHO -------------  Installed to %PREFIX%  --------------

cd ..\..

)

use updated cpl_config.h.vc for gdal, turn off ODBC for now (problems with VS2015 RC)


setlocal
call settings.bat

call fetch.bat http://download.osgeo.org/proj/proj-4.9.1.tar.gz proj-4.9.1
cd proj-4.9.1
set INSTDIR=%PREFIX:\=\\%
if "%compiler%" == "MINGW" (
  SET "PATH=%MSYSDIR%;%PATH%"
  if NOT EXIST Makefile (bash -c "./configure %CONFARGS%")
  %ER%
  bash -c "make install"
  %ER%
) else (
  cmake %GENERATOR% -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX1% -DPROJ_INCLUDE_SUBDIR=include -DPROJ_LIB_SUBDIR=lib -DBUILD_LIBPROJ_SHARED=YES
  %ER%
  %MSBUILDINSTALL%
  %ER%
  copy /y %PREFIX%\lib\proj_4_9.lib %PREFIX%\lib\proj_i.lib
  cmake %GENERATOR% -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX1% -DPROJ_INCLUDE_SUBDIR=include -DPROJ_LIB_SUBDIR=lib -DBUILD_LIBPROJ_SHARED=NO
  %ER%
  %MSBUILDINSTALL%
  %ER%
  copy /y %PREFIX%\lib\proj_4_9.lib %PREFIX%\lib\proj.lib
)

cd ..

setlocal
call settings.bat

call fetch.bat http://download.osgeo.org/proj/proj-4.9.1.tar.gz proj-4.9.1
cd proj-4.9.1
set INSTDIR=%PREFIX:\=\\%
if "%compiler%" == "MINGW" (
  SET "PATH=%MSYSDIR%;%PATH%"
  if NOT EXIST Makefile (bash -c "./configure %CONFARGS%")
  %ER%
  bash -c "make install"
  %ER%
) else (
  cmake %GENERATOR% -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX1% -DPROJ_INCLUDE_SUBDIR=include -DPROJ_LIB_SUBDIR=lib -DBUILD_LIBPROJ_SHARED=YES
  %ER%
  %MSBUILDINSTALL%
  %ER%
  copy /y %PREFIX%\lib\proj_4_9.lib %PREFIX%\lib\proj_i.lib
  cmake %GENERATOR% -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX1% -DPROJ_INCLUDE_SUBDIR=include -DPROJ_LIB_SUBDIR=lib -DBUILD_LIBPROJ_SHARED=NO
  %ER%
  %MSBUILDINSTALL%
  %ER%
  copy /y %PREFIX%\lib\proj_4_9.lib %PREFIX%\lib\proj.lib
  copy /y %PREFIX%\lib\proj_4_9_d.lib %PREFIX%\lib\proj.lib
)

cd ..

install debug proj.4

install debug proj.4


cls
call "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
cl /c /DEBUG ring_opengl11.c -I "..\..\..\libdepwin\glew\include" -I "..\..\..\libdepwin\freeglut\include" -I"..\..\..\include"
link /DEBUG ring_opengl11.obj  ..\..\..\lib\ring.lib ..\..\..\libdepwin\glew\lib\release\win32\glew32.lib ..\..\..\libdepwin\freeglut\lib\freeglut.lib /DLL /OUT:..\..\..\bin\ring_opengl11.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_opengl11.obj

cls
call ../../../src/locatevc.bat
cl /c /DEBUG ring_opengl11.c -I "..\..\..\libdepwin\glew\include" -I "..\..\..\libdepwin\freeglut\include" -I"..\..\..\include"
link /DEBUG ring_opengl11.obj  ..\..\..\lib\ring.lib ..\..\..\libdepwin\glew\lib\release\win32\glew32.lib ..\..\..\libdepwin\freeglut\lib\freeglut.lib /DLL /OUT:..\..\..\bin\ring_opengl11.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_opengl11.obj

Update RingOpenGL 1.1 - buildvc.bat - use locatevc.bat


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  fopdf script for Windows
@rem
@rem  WARNING: This script has not yet been tested!
@rem
@rem ##########################################################################

if "%OS%"=="Windows_NT" setlocal

@rem Store full-qualified drive + path of this script
set PRG_DIR=%~dp0
if "%PRG_DIR%" == "" set PRG_DIR=.

set GRADLEW_CMD="%PRG_DIR%\gradlew"
set FOPDF_DIR="%PRG_DIR%\build\fopdf"
set FOPDF_CMD="%FOPDF_DIR%\bin\fopdf.bat"

set DOCBOOK_DIR="%FOPDF_DIR%\docbook"
set DOCBOOK_XSL_DIR="%FOPDF_DIR%\docbook-xsl"
set XSLTHL_CONFIG_URI="file:///%DOCBOOK_XSL_DIR%\xslthl-config.xml"

:init
set SOURCE_FILE=
set TYPE=pdf
@rem Process first argument
if %1a==a goto endInit
@rem Store fully-qualified drive+path+name+extension of first argument
set SOURCE_FILE=%~f1
@rem Store fully-qualified drive+path+name of first argument
set SOURCE_ROOTNAME=%~dpn1
shift
@rem Process second argument
if %1a==a goto endInit
set TYPE=%1
shift
:endInit

if "%SOURCE_FILE%" == "" (
  echo .
  echo You must specify a DocBook XML source file as the first command argument
  echo .
  goto fail
)

:install
if exist "%FOPDF_CMD%" goto endInstall
echo .
echo Initializing application...
"%GRADLEW_CMD%" -q -u installApp
if not "%ERRORLEVEL%"=="0" goto fail
echo Application initialized!
echo .
:endInstall

if "%TYPE%" == "pdf" (
  set OUTPUT_PDF_FILE="%SOURCE_ROOTNAME%.pdf"
  "%FOPDF_CMD%" -q -catalog -c "%DOCBOOK_XSL_DIR%\fop-config.xml" -xml "%SOURCE_FILE%" -xsl "%DOCBOOK_XSL_DIR%\fo-pdf.xsl" -pdf "%OUTPUT_PDF_FILE%" -param highlight.xslhl.config "%XSLTHL_CONFIG_URI%" -param admon.graphics.path "%DOCBOOK_DIR%\images\" -param callout.graphics.path "%DOCBOOK_DIR%\images\callouts\"
  if not "%ERRORLEVEL%"=="0" goto fail else goto mainEnd
)

if "%TYPE%" == "fo" (
  set OUTPUT_FO_FILE="%SOURCE_ROOTNAME%.fo"
  "%FOPDF_CMD%" -q -catalog -c "%DOCBOOK_XSL_DIR%\fop-config.xml" -xml "%SOURCE_FILE%" -xsl "%DOCBOOK_XSL_DIR%\fo-pdf.xsl" -foout "%OUTPUT_FO_FILE%" -param highlight.xslhl.config "%XSLTHL_CONFIG_URI%" -param admon.graphics.path "%DOCBOOK_DIR%\images\" -param callout.graphics.path "%DOCBOOK_DIR%\images\callouts\"
  if not "%ERRORLEVEL%"=="0" goto fail else goto mainEnd
)

:fail
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

add first cut at Windows batch script

add first cut at Windows batch script


@ECHO OFF

REM Command file for Sphinx documentation

set PYTHON=python
set SPHINXBUILD=sphinx-build
set ALLSPHINXOPTS=-d _build/doctrees %SPHINXOPTS% .
if NOT "%PAPER%" == "" (
	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
)

if "%1" == "" goto help

if "%1" == "help" (
	:help
	echo.Please use `make ^<target^>` where ^<target^> is one of
	echo.  html      to make standalone HTML files
	echo.  dirhtml   to make HTML files named index.html in directories
	echo.  pickle    to make pickle files
	echo.  json      to make JSON files
	echo.  htmlhelp  to make HTML files and a HTML help project
	echo.  qthelp    to make HTML files and a qthelp project
	echo.  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  changes   to make an overview over all changed/added/deprecated items
	echo.  linkcheck to check all external links for integrity
	echo.  doctest   to run all doctests embedded in the documentation if enabled
	goto end
)

if "%1" == "clean" (
	for /d %%i in (_build\*) do rmdir /q /s %%i
	del /q /s _build\*
	call :api-clean
	call :examples-clean
	goto end
)

if "%1" == "api-clean" (
    :api-clean
	del /q /s reference reference_cmd
	rmdir reference reference_cmd
	exit /B
	)

if "%1" == "api" (
    :api
	if not exist reference mkdir reference
	%PYTHON% tools/build_modref_templates.py dipy reference
	if not exist reference_cmd mkdir reference_cmd
	%PYTHON% tools/docgen_cmd.py dipy reference_cmd
	echo.Build API docs...done.
	exit /B
	)

if "%1" == "examples-clean" (
    :examples-clean
	cd examples_built && del /q /s *.py *.rst *.png fig
	cd ..
	exit /B
	)

if "%1" == "examples-clean-tgz" (
    call :examples-clean
    call :examples-tgz %*
	%PYTHON% ../tools/pack_examples.py ../dist
	exit /B
	)

if "%1" == "examples-tgz" (
    :examples-tgz
    call :rstexamples %*
	%PYTHON% ../tools/pack_examples.py ../dist
	exit /B
	)

if "%1" == "gitwash-update" (
	%PYTHON% ../tools/gitwash_dumper.py devel dipy --repo-name=dipy ^
	                                               --github-user=nipy ^
	                                               --project-url=http://nipy.org/dipy ^
	                                               --project-ml-url=https://mail.python.org/mailman/listinfo/neuroimaging
    )

if "%1" == "rstexamples" (
    :rstexamples
	cd examples_built && %PYTHON% ..\\..\\tools\\make_examples.py
	type nul > %*
	exit /B
	)

if "%1" == "html" (
    :html
    echo "build full docs including examples"
    call :api
    call :rstexamples %*
    call :html-after-examples
    exit /B
	)

if "%1" == "html-after-examples" (
    :html-after-examples
	%SPHINXBUILD% -b html %ALLSPHINXOPTS% _build/html
	echo.
	echo.Build finished. The HTML pages are in _build/html.
	exit /B
    )

if "%1" == "dirhtml" (
	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% _build/dirhtml
	echo.
	echo.Build finished. The HTML pages are in _build/dirhtml.
	goto end
)

if "%1" == "pickle" (
	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% _build/pickle
	echo.
	echo.Build finished; now you can process the pickle files.
	goto end
)

if "%1" == "json" (
	%SPHINXBUILD% -b json %ALLSPHINXOPTS% _build/json
	echo.
	echo.Build finished; now you can process the JSON files.
	goto end
)

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% _build/htmlhelp
	echo.
	echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in _build/htmlhelp.
	goto end
)

if "%1" == "qthelp" (
	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% _build/qthelp
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in _build/qthelp, like this:
	echo.^> qcollectiongenerator _build\qthelp\dipy.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile _build\qthelp\dipy.ghc
	goto end
)

if "%1" == "latex" (
    :latex
    call :rstexamples %*
    call :latex-after-examples
    exit /B
)

if "%1" == "latex-after-examples" (
    :latex-after-examples
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% _build/latex
	echo.
	echo.Build finished; the LaTeX files are in _build/latex.
	echo.Run make all-pdf or make all-ps in that directory to ^
	     run these through (pdf)latex.
	exit /B
)

if "%1" == "changes" (
	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% _build/changes
	echo.
	echo.The overview file is in _build/changes.
	goto end
)

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% _build/linkcheck
	echo.
	echo.Link check complete; look for any errors in the above output ^
or in _build/linkcheck/output.txt.
	goto end
)

if "%1" == "doctest" (
	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% _build/doctest
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in _build/doctest/output.txt.
	goto end
)

if "%1" == "pdf" (
    call :latex
	cd _build/latex && make all-pdf
	type nul > %*
	goto end
	)

if "%1" == "upload" (
    call :html %*
	./upload-gh-pages.sh _build/html/ dipy nipy
	goto end
	)

if "%1" == "xvfb" (
	set TEST_WITH_XVFB=true && make html
	goto end
	)

if "%1" == "memory_profile" (
	set TEST_WITH_MEMPROF=true && make html
	goto end
	)

:end

@ECHO OFF

REM Command file for Sphinx documentation

set PYTHON=python
set SPHINXBUILD=sphinx-build
set ALLSPHINXOPTS=-d _build/doctrees %SPHINXOPTS% .
if NOT "%PAPER%" == "" (
	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
)

if "%1" == "" goto help

if "%1" == "help" (
	:help
	echo.Please use `make ^<target^>` where ^<target^> is one of
	echo.  html      to make standalone HTML files
	echo.  dirhtml   to make HTML files named index.html in directories
	echo.  pickle    to make pickle files
	echo.  json      to make JSON files
	echo.  htmlhelp  to make HTML files and a HTML help project
	echo.  qthelp    to make HTML files and a qthelp project
	echo.  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  changes   to make an overview over all changed/added/deprecated items
	echo.  linkcheck to check all external links for integrity
	echo.  doctest   to run all doctests embedded in the documentation if enabled
	goto end
)

if "%1" == "clean" (
	for /d %%i in (_build\*) do rmdir /q /s %%i
	del /q /s _build\*
	call :api-clean
	call :examples-clean
	goto end
)

if "%1" == "api-clean" (
    :api-clean
	del /q /s reference reference_cmd
	rmdir reference reference_cmd
	exit /B
	)

if "%1" == "api" (
    :api
	if not exist reference mkdir reference
	%PYTHON% tools/build_modref_templates.py dipy reference
	if not exist reference_cmd mkdir reference_cmd
	%PYTHON% tools/docgen_cmd.py dipy reference_cmd
	echo.Build API docs...done.
	exit /B
	)

if "%1" == "examples-clean" (
    :examples-clean
	cd examples_built && del /q /s *.py *.rst *.png fig
	cd ..
	exit /B
	)

if "%1" == "examples-clean-tgz" (
    call :examples-clean
    call :examples-tgz %*
	%PYTHON% ../tools/pack_examples.py ../dist
	exit /B
	)

if "%1" == "examples-tgz" (
    :examples-tgz
    call :rstexamples %*
	%PYTHON% ../tools/pack_examples.py ../dist
	exit /B
	)

if "%1" == "gitwash-update" (
	%PYTHON% ../tools/gitwash_dumper.py devel dipy --repo-name=dipy ^
	                                               --github-user=nipy ^
	                                               --project-url=http://nipy.org/dipy ^
	                                               --project-ml-url=https://mail.python.org/mailman/listinfo/neuroimaging
    )

if "%1" == "rstexamples" (
    :rstexamples
	cd examples_built && %PYTHON% ..\\..\\tools\\make_examples.py
	type nul > %*
	cd ..
	exit /B
	)

if "%1" == "html" (
    :html
    echo "build full docs including examples"
    call :api
    call :rstexamples %*
    call :html-after-examples
    exit /B
	)

if "%1" == "html-after-examples" (
    :html-after-examples
	%SPHINXBUILD% -b html %ALLSPHINXOPTS% _build/html
	echo.
	echo.Build finished. The HTML pages are in _build/html.
	exit /B
    )

if "%1" == "dirhtml" (
	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% _build/dirhtml
	echo.
	echo.Build finished. The HTML pages are in _build/dirhtml.
	goto end
)

if "%1" == "pickle" (
	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% _build/pickle
	echo.
	echo.Build finished; now you can process the pickle files.
	goto end
)

if "%1" == "json" (
	%SPHINXBUILD% -b json %ALLSPHINXOPTS% _build/json
	echo.
	echo.Build finished; now you can process the JSON files.
	goto end
)

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% _build/htmlhelp
	echo.
	echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in _build/htmlhelp.
	goto end
)

if "%1" == "qthelp" (
	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% _build/qthelp
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in _build/qthelp, like this:
	echo.^> qcollectiongenerator _build\qthelp\dipy.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile _build\qthelp\dipy.ghc
	goto end
)

if "%1" == "latex" (
    :latex
    call :rstexamples %*
    call :latex-after-examples
    exit /B
)

if "%1" == "latex-after-examples" (
    :latex-after-examples
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% _build/latex
	echo.
	echo.Build finished; the LaTeX files are in _build/latex.
	echo.Run make all-pdf or make all-ps in that directory to ^
	     run these through (pdf)latex.
	exit /B
)

if "%1" == "changes" (
	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% _build/changes
	echo.
	echo.The overview file is in _build/changes.
	goto end
)

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% _build/linkcheck
	echo.
	echo.Link check complete; look for any errors in the above output ^
or in _build/linkcheck/output.txt.
	goto end
)

if "%1" == "doctest" (
	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% _build/doctest
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in _build/doctest/output.txt.
	goto end
)

if "%1" == "pdf" (
    call :latex
	cd _build/latex && make all-pdf
	type nul > %*
	goto end
	)

if "%1" == "upload" (
    call :html %*
	./upload-gh-pages.sh _build/html/ dipy nipy
	goto end
	)

if "%1" == "xvfb" (
	set TEST_WITH_XVFB=true && make html
	goto end
	)

if "%1" == "memory_profile" (
	set TEST_WITH_MEMPROF=true && make html
	goto end
	)

:end

update make.bat

update make.bat


@echo off

pushd .

IF EXIST "%ProgramFiles(x86)%" (
  set "ProgramFiles32=%ProgramFiles(x86)%"
) ELSE (
  set "ProgramFiles32=%ProgramFiles%"
)

set VC14VARS=%VS140COMNTOOLS%..\..\VC\vcvarsall.bat
IF EXIST "%VC14VARS%" (
  set "VS_VCVARS=%VC14VARS%"
) ELSE (
  for %%e in (Enterprise Professional Community BuildTools) do (
    IF EXIST "%ProgramFiles32%\Microsoft Visual Studio\2017\%%e\VC\Auxiliary\Build\vcvarsall.bat" (
      set "VS_VCVARS=%ProgramFiles32%\Microsoft Visual Studio\2017\%%e\VC\Auxiliary\Build\vcvarsall.bat"
    )
  )
)

IF EXIST "%VS_VCVARS%" (
  IF NOT DEFINED Platform (
    IF EXIST "%ProgramFiles(x86)%" (
      call "%VS_VCVARS%" x64
    ) ELSE (
      ECHO 32-bit Windows is currently unsupported.
      EXIT /B 1
    )
  )
) ELSE (
  ECHO Visual Studio 2015 or 2017 is not installed.
  ECHO Download and install Visual Studio 2015 or 2017 from https://www.visualstudio.com/
  EXIT /B 1
)

popd

where /Q py.exe
IF %ERRORLEVEL% NEQ 0 (
  python mach %*
) ELSE (
  py -2 mach %*
)

@echo off

setlocal

if EXIST "%VCINSTALLDIR%" (
  GOTO mach
)

pushd .

IF EXIST "%ProgramFiles(x86)%" (
  set "ProgramFiles32=%ProgramFiles(x86)%"
) ELSE (
  set "ProgramFiles32=%ProgramFiles%"
)

for %%v in (2019 2017) do (
  for %%e in (Enterprise Professional Community BuildTools) do (
    IF EXIST "%ProgramFiles32%\Microsoft Visual Studio\%%v\%%e\VC\Auxiliary\Build\vcvarsall.bat" (
      set "VS_VCVARS=%ProgramFiles32%\Microsoft Visual Studio\%%v\%%e\VC\Auxiliary\Build\vcvarsall.bat"
      GOTO vcvars
    )
  )
)

set VC14VARS=%VS140COMNTOOLS%..\..\VC\vcvarsall.bat
IF EXIST "%VC14VARS%" (
  set "VS_VCVARS=%VC14VARS%"
)

:vcvars
IF EXIST "%VS_VCVARS%" (
  IF NOT DEFINED Platform (
    IF EXIST "%ProgramFiles(x86)%" (
      call "%VS_VCVARS%" x64
    ) ELSE (
      ECHO 32-bit Windows is currently unsupported.
      GOTO bad_exit
    )
  )
) ELSE (
  ECHO Visual Studio 2015, 2017, or 2019 is not installed.
  ECHO Download and install Visual Studio from https://www.visualstudio.com/
  GOTO bad_exit
)

popd

:mach
where /Q py.exe
IF %ERRORLEVEL% NEQ 0 (
  python mach %*
) ELSE (
  py -2 mach %*
)

GOTO exit

:bad_exit
endlocal
EXIT /B 1

:exit
endlocal
exit /B

Rework mach.bat to support VS2019 and user-supplied environments.

As a bonus, use setlocal to avoid environment pollution.


@ECHO OFF

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set BUILDDIR=build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
set I18NSPHINXOPTS=%SPHINXOPTS% source
if NOT "%PAPER%" == "" (
	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)

if "%1" == "" goto help

if "%1" == "help" (
	:help
	echo.Please use `make ^<target^>` where ^<target^> is one of
	echo.  html       to make standalone HTML files
	echo.  dirhtml    to make HTML files named index.html in directories
	echo.  singlehtml to make a single large HTML file
	echo.  pickle     to make pickle files
	echo.  json       to make JSON files
	echo.  htmlhelp   to make HTML files and a HTML help project
	echo.  qthelp     to make HTML files and a qthelp project
	echo.  devhelp    to make HTML files and a Devhelp project
	echo.  epub       to make an epub
	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  text       to make text files
	echo.  man        to make manual pages
	echo.  texinfo    to make Texinfo files
	echo.  gettext    to make PO message catalogs
	echo.  changes    to make an overview over all changed/added/deprecated items
	echo.  xml        to make Docutils-native XML files
	echo.  pseudoxml  to make pseudoxml-XML files for display purposes
	echo.  linkcheck  to check all external links for integrity
	echo.  doctest    to run all doctests embedded in the documentation if enabled
	echo.  coverage   to run coverage check of the documentation if enabled
	goto end
)

if "%1" == "clean" (
	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
	del /q /s %BUILDDIR%\*
	goto end
)

REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 1>NUL 2>NUL
if errorlevel 9009 goto sphinx_python
goto sphinx_ok

:sphinx_python

set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

:sphinx_ok

if "%1" == "html" (
	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
	goto end
)

if "%1" == "dirhtml" (
	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
	goto end
)

if "%1" == "singlehtml" (
	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
	goto end
)

if "%1" == "pickle" (
	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the pickle files.
	goto end
)

if "%1" == "json" (
	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the JSON files.
	goto end
)

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
	goto end
)

if "%1" == "qthelp" (
	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\OpenAPS.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\OpenAPS.ghc
	goto end
)

if "%1" == "devhelp" (
	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished.
	goto end
)

if "%1" == "epub" (
	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The epub file is in %BUILDDIR%/epub.
	goto end
)

if "%1" == "latex" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdf" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf
	cd %~dp0
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdfja" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf-ja
	cd %~dp0
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "text" (
	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The text files are in %BUILDDIR%/text.
	goto end
)

if "%1" == "man" (
	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The manual pages are in %BUILDDIR%/man.
	goto end
)

if "%1" == "texinfo" (
	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
	goto end
)

if "%1" == "gettext" (
	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
	goto end
)

if "%1" == "changes" (
	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
	if errorlevel 1 exit /b 1
	echo.
	echo.The overview file is in %BUILDDIR%/changes.
	goto end
)

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
	if errorlevel 1 exit /b 1
	echo.
	echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
	goto end
)

if "%1" == "doctest" (
	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
	goto end
)

if "%1" == "coverage" (
	%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of coverage in the sources finished, look at the ^
results in %BUILDDIR%/coverage/python.txt.
	goto end
)

if "%1" == "xml" (
	%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The XML files are in %BUILDDIR%/xml.
	goto end
)

if "%1" == "pseudoxml" (
	%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
	goto end
)

:end

Revert "Delete make.bat"

Revert "Delete make.bat"

This reverts commit 1bc6e919fb32e6b2b9f4dfdb9795a36432449cc4.


ghc --make Main.hs -i../proplang -package gtk -o guihaskell.exe

ghc --make Main.hs -i../proplang -o guihaskell.exe

Fix the makefile

Fix the makefile


@setlocal
@SET PROMPT=$$$S

pushd "%~dp0"

if exist "%~dp0Misc\version.cmd" call "%~dp0Misc\version.cmd"

if exist goarch.txt for /F %%I in (goarch.txt) do set "GOARCH=%%I"
if "%GOARCH%" == "" for /F "delims=/ tokens=2" %%I in ('go version') do set "GOARCH=%%I"

if not "%1" == "" goto %1

goto build

:debug
        set "TAGS=-tags=debug"
        goto build

:release
        for /F %%I in (%~dp0Misc\version.txt) do set "VERSION=%%I"
        set "X_VERSION=-X main.version=%VERSION%"

:build
        call :fmt
        pushd "%~dp0main"
        powershell -ExecutionPolicy RemoteSigned -File makesyso.ps1
        popd
        if not exist main\bindata.go call :bindata
        for /F "delims=" %%V in ('git log -1 --date^=short --pretty^=format:"-X main.stamp=%%ad -X main.commit=%%H"') do go build -o nyagos.exe -ldflags "%%V %X_VERSION%" %TAGS% .\main
        goto end

:fmt
        for /F %%I IN ('dir /s /b /aa *.go') do go fmt "%%I" & attrib -A "%%I"
        exit /b

:status
        nyagos -e "print(nyagos.version or 'Snapshot on '..nyagos.stamp)"
        goto end

:clean
        for %%I in (nyagos.exe main\nyagos.syso version.now main\bindata.go) do if exist %%I del %%I
        powershell "ls -R | ?{ $_ -match '\.go$' } | %%{ [System.IO.Path]::GetDirectoryName($_.FullName)} | Sort-Object | Get-Unique | %%{ Write-Host 'go clean on',$_ ;  pushd $_ ; go clean ; popd }"

:sweep
        for /R %%I in (*~ *.bak) do if exist %%I del %%I
        if exist main\main.exe del main\main.exe
        goto end

:get
        powershell "Get-ChildItem . -Recurse | ?{ $_.Extension -eq '.go' } | %%{  Get-Content $_.FullName | %%{ ($_ -replace '\s*//.*$','').Split()[-1] } | ?{ $_ -match 'github.com/' } } | Sort-Object | Get-Unique | %%{ Write-Host $_ ; go get -u $_ }"
        goto end

:getbindata
        go get "github.com/jteeuwen/go-bindata"
        pushd "%GOPATH%\src\github.com\jteeuwen\go-bindata\go-bindata"
        go build
        copy go-bindata.exe "%~dp0\."
        popd
        exit /b

:bindata
        if not exist go-bindata.exe call :getbindata
        go-bindata.exe -o "main\bindata.go" "nyagos.d/..."
        exit /b

:const
        for /F %%I in ('dir /b /s makeconst.cmd') do pushd %%~dpI & call %%I & popd
        goto end

:package
        for /F %%I in ('nyagos -e "print(nyagos.version or (string.gsub(nyagos.stamp,[[/]],[[]])))"') do set VERSION=%%I
        zip -9 "nyagos-%VERSION%-%GOARCH%.zip" nyagos.exe lua53.dll nyagos.lua .nyagos makeicon.cmd nyagos.d\*.lua nyagos.d\catalog\*.lua license.txt readme_ja.md readme.md Doc\*.md
        goto end

:install
        if not "%2" == "" set "INSTALLDIR=%2" & echo @set "INSTALLDIR=%2" > "%~dp0Misc\version.cmd"
        if "%INSTALLDIR%" == "" (
            echo Please %0.cmd install PATH\TO\BIN, once
            goto end
        )
        if not exist "%INSTALLDIR%" (
            echo Please %0.cmd install EXIST\PATH\TO\BIN,  once
            goto end
        )

        robocopy nyagos.d "%INSTALLDIR%\nyagos.d" /E
        if not exist "%INSTALLDIR%\lua53.dll" copy lua53.dll "%INSTALLDIR%\."
        copy nyagos.lua "%INSTALLDIR%\."
        copy nyagos.exe "%INSTALLDIR%\."
        if errorlevel 1 (start %~0 install_ & exit /b)
        goto end

:install_
        taskkill /F /im nyagos.exe
        copy nyagos.exe "%INSTALLDIR%\."
        timeout /T 3
        exit %ERRORLEVEL%

:icon
        makeicon.cmd
        goto end

:help
        echo Usage for make.cmd
        echo  %0          : Equals to '%0 build'
        echo  %0 build    : Build nyagos.exe as snapshot (ignore version.txt)
        echo  %0 release  : Build nyagos.exe as release  (see version.txt)
        echo  %0 fmt      : Format all source files with 'go fmt'
        echo  %0 clean    : Delete nyagos.exe and nyagos.syso
        echo  %0 package  : Make the package zip-file
        echo  %0 get      : Do 'go get' for each github library
        echo  %0 upgrade  : Do 'git pull' for each github library
        echo  %0 help     : Print help
        echo  %0 install INSTALLDIR
        echo     : Copy binaries to INSTALLDIR
        echo  %0 install
        echo     : Copy binaries to last INSTALLDIR
:end
        popd

@setlocal
@SET PROMPT=$$$S

pushd "%~dp0"

if exist "%~dp0Misc\version.cmd" call "%~dp0Misc\version.cmd"

if exist goarch.txt for /F %%I in (goarch.txt) do set "GOARCH=%%I"
if "%GOARCH%" == "" for /F "delims=/ tokens=2" %%I in ('go version') do set "GOARCH=%%I"

if not "%1" == "" goto %1
        for /F %%I in ('git describe --tags') do set "X_VERSION=-X main.version=%%I"

goto build

:debug
        set "TAGS=-tags=debug"
        goto build

:release
        for /F %%I in (%~dp0Misc\version.txt) do set "VERSION=%%I"
        set "X_VERSION=-X main.version=%VERSION%"

:build
        call :fmt
        pushd "%~dp0main"
        powershell -ExecutionPolicy RemoteSigned -File makesyso.ps1
        popd
        if not exist main\bindata.go call :bindata
        for /F "delims=" %%V in ('git log -1 --date^=short --pretty^=format:"-X main.stamp=%%ad -X main.commit=%%H"') do go build -o nyagos.exe -ldflags "%%V %X_VERSION%" %TAGS% .\main
        goto end

:fmt
        for /F %%I IN ('dir /s /b /aa *.go') do go fmt "%%I" & attrib -A "%%I"
        exit /b

:status
        nyagos -e "print(nyagos.version or 'Snapshot on '..nyagos.stamp)"
        goto end

:clean
        for %%I in (nyagos.exe main\nyagos.syso version.now main\bindata.go) do if exist %%I del %%I
        powershell "ls -R | ?{ $_ -match '\.go$' } | %%{ [System.IO.Path]::GetDirectoryName($_.FullName)} | Sort-Object | Get-Unique | %%{ Write-Host 'go clean on',$_ ;  pushd $_ ; go clean ; popd }"

:sweep
        for /R %%I in (*~ *.bak) do if exist %%I del %%I
        if exist main\main.exe del main\main.exe
        goto end

:get
        powershell "Get-ChildItem . -Recurse | ?{ $_.Extension -eq '.go' } | %%{  Get-Content $_.FullName | %%{ ($_ -replace '\s*//.*$','').Split()[-1] } | ?{ $_ -match 'github.com/' } } | Sort-Object | Get-Unique | %%{ Write-Host $_ ; go get -u $_ }"
        goto end

:getbindata
        go get "github.com/jteeuwen/go-bindata"
        pushd "%GOPATH%\src\github.com\jteeuwen\go-bindata\go-bindata"
        go build
        copy go-bindata.exe "%~dp0\."
        popd
        exit /b

:bindata
        if not exist go-bindata.exe call :getbindata
        go-bindata.exe -o "main\bindata.go" "nyagos.d/..."
        exit /b

:const
        for /F %%I in ('dir /b /s makeconst.cmd') do pushd %%~dpI & call %%I & popd
        goto end

:package
        for /F %%I in ('nyagos -e "print(nyagos.version or (string.gsub(nyagos.stamp,[[/]],[[]])))"') do set VERSION=%%I
        zip -9 "nyagos-%VERSION%-%GOARCH%.zip" nyagos.exe lua53.dll nyagos.lua .nyagos makeicon.cmd nyagos.d\*.lua nyagos.d\catalog\*.lua license.txt readme_ja.md readme.md Doc\*.md
        goto end

:install
        if not "%2" == "" set "INSTALLDIR=%2" & echo @set "INSTALLDIR=%2" > "%~dp0Misc\version.cmd"
        if "%INSTALLDIR%" == "" (
            echo Please %0.cmd install PATH\TO\BIN, once
            goto end
        )
        if not exist "%INSTALLDIR%" (
            echo Please %0.cmd install EXIST\PATH\TO\BIN,  once
            goto end
        )

        robocopy nyagos.d "%INSTALLDIR%\nyagos.d" /E
        if not exist "%INSTALLDIR%\lua53.dll" copy lua53.dll "%INSTALLDIR%\."
        copy nyagos.lua "%INSTALLDIR%\."
        copy nyagos.exe "%INSTALLDIR%\."
        if errorlevel 1 (start %~0 install_ & exit /b)
        goto end

:install_
        taskkill /F /im nyagos.exe
        copy nyagos.exe "%INSTALLDIR%\."
        timeout /T 3
        exit %ERRORLEVEL%

:icon
        makeicon.cmd
        goto end

:help
        echo Usage for make.cmd
        echo  %0          : Equals to '%0 build'
        echo  %0 build    : Build nyagos.exe as snapshot (ignore version.txt)
        echo  %0 release  : Build nyagos.exe as release  (see version.txt)
        echo  %0 fmt      : Format all source files with 'go fmt'
        echo  %0 clean    : Delete nyagos.exe and nyagos.syso
        echo  %0 package  : Make the package zip-file
        echo  %0 get      : Do 'go get' for each github library
        echo  %0 upgrade  : Do 'git pull' for each github library
        echo  %0 help     : Print help
        echo  %0 install INSTALLDIR
        echo     : Copy binaries to INSTALLDIR
        echo  %0 install
        echo     : Copy binaries to last INSTALLDIR
:end
        popd

Use `git describe --tags` for the version text


SET SCALA_HOME=F:\hudson\tools\scala-2.9.0.1
SET JRUBY_OPTS=-J-XX:MaxPermSize=312m -J-Xmx1024M
SET JAVA_OPTS=-Xmx1024m -XX:MaxPermSize=312m

IF "X%BUILD_RVM%" EQ "X1.9.3" SET RUBY_HOME=F:\hudson\tools\Ruby193-p194
IF "X%BUILD_RVM%" EQ "X1.9.2" SET RUBY_HOME=F:\hudson\tools\Ruby192-p290
IF "X%BUILD_RVM%" EQ "X1.8.7" SET RUBY_HOME=F:\hudson\tools\Ruby187-p370
IF "X%BUILD_RVM%" EQ "Xjruby" SET RUBY_HOME=F:\hudson\tools\jruby-1.6.7

IF "X%BUILD_JVM%" EQ "X1.5" SET JAVA_HOME=F:\hudson\tools\java\jdk1.5.0_22-64
IF "X%BUILD_JVM%" EQ "X1.6" SET JAVA_HOME=F:\hudson\tools\java\jdk1.6.0_27-64
IF "X%BUILD_JVM%" EQ "X1.7" SET JAVA_HOME=F:\hudson\tools\java\jdk1.7.0

SET GEM_HOME=.gems
SET PATH=%JAVA_HOME%\bin;%RUBY_HOME%\bin;%GEM_HOME%\bin;%PATH%

gem install bundler
bundle install --path vendor/bundle

SET BUILD_RAKE_TASK=ci
rem rake clobber %BUILD_RAKE_TASK% --trace

SET SCALA_HOME=F:\hudson\tools\scala-2.9.0.1
SET JRUBY_OPTS=-J-XX:MaxPermSize=312m -J-Xmx1024M
SET JAVA_OPTS=-Xmx1024m -XX:MaxPermSize=312m

IF "X%BUILD_RVM%" EQ "X1.9.3" SET RUBY_HOME=F:\hudson\tools\Ruby193-p194
IF "X%BUILD_RVM%" EQ "X1.9.2" SET RUBY_HOME=F:\hudson\tools\Ruby192-p290
IF "X%BUILD_RVM%" EQ "X1.8.7" SET RUBY_HOME=F:\hudson\tools\Ruby187-p370
IF "X%BUILD_RVM%" EQ "Xjruby" SET RUBY_HOME=F:\hudson\tools\jruby-1.6.7

IF "X%BUILD_JVM%" EQ "X1.5" SET JAVA_HOME=F:\hudson\tools\java\jdk1.5.0_22-64
IF "X%BUILD_JVM%" EQ "X1.6" SET JAVA_HOME=F:\hudson\tools\java\jdk1.6.0_27-64
IF "X%BUILD_JVM%" EQ "X1.7" SET JAVA_HOME=F:\hudson\tools\java\jdk1.7.0

SET GEM_HOME=.gems
SET PATH=%JAVA_HOME%\bin;%RUBY_HOME%\bin;%GEM_HOME%\bin;%PATH%

CALL gem install bundler
CALL bundle install

SET BUILD_RAKE_TASK=ci
CALL rake clobber %BUILD_RAKE_TASK% --trace

Use CALL to invoke other bat scripts

Use CALL to invoke other bat scripts

git-svn-id: d8f3215415546ce936cf3b822120ca56e5ebeaa0@1399439 13f79535-47bb-0310-9956-ffa450edef68


@echo off
::Compiles the Visual Studio solution.
pushd "%~dp0"

rem Project settings
set SOLUTION_FILE=NanoByte.Common.sln

rem Determine VS version
if defined VS140COMNTOOLS (
  ::Visual Studio 2015
  call "%VS140COMNTOOLS%vsvars32.bat"
  goto vs_ok
)
echo ERROR: No Visual Studio installation found. >&2
exit /b 1
:vs_ok

set config=%1
if "%config%"=="" set config=Debug

echo Restoring NuGet packages...
.nuget\NuGet.exe restore %SOLUTION_FILE% -Verbosity quiet
if errorlevel 1 exit /b %errorlevel%

echo Compiling Visual Studio solution (%config%)...
if exist ..\build\%config% rd /s /q ..\build\%config%
msbuild %SOLUTION_FILE% /nologo /v:q /t:Rebuild /p:Configuration=%config%
if errorlevel 1 exit /b %errorlevel%

popd

@echo off
::Compiles the Visual Studio solution.
pushd "%~dp0"

rem Project settings
set SOLUTION_FILE=NanoByte.Common.sln

rem Determine VS version
if defined VS140COMNTOOLS (
  ::Visual Studio 2015
  call "%VS140COMNTOOLS%vsvars32.bat"
  goto vs_ok
)
echo ERROR: No Visual Studio installation found. >&2
exit /b 1
:vs_ok

set config=%1
if "%config%"=="" set config=Debug

echo Restoring NuGet packages...
.nuget\NuGet.exe restore %SOLUTION_FILE% -Verbosity quiet
if errorlevel 1 exit /b %errorlevel%

echo Compiling Visual Studio solution (%config%)...
if exist ..\build\%config% rd /s /q ..\build\%config%
msbuild %SOLUTION_FILE% /nologo /v:q /m /t:Rebuild /p:Configuration=%config%
if errorlevel 1 exit /b %errorlevel%

popd

Build script: Run MSBuild multi-threaded


defenv
setenv bootfromrecovery 0
setenv bootfromnand 0
setenv bootcmd "run start_autoscript; run storeboot;"
setenv start_autoscript "if usb start ; then run start_usb_autoscript; fi; if mmcinfo; then run start_mmc_autoscript; fi;"
setenv start_mmc_autoscript "if fatload mmc 0 1020000 s905_autoscript; then autoscr 1020000; fi;"
setenv start_usb_autoscript "if fatload usb 0 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 1 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 2 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 3 1020000 s905_autoscript; then autoscr 1020000; fi;"
setenv upgrade_step "2"
saveenv
sleep 1
reboot

defenv
setenv bootfromrecovery 0
setenv bootfromnand 0
setenv bootcmd "run start_autoscript; run storeboot;"
setenv start_autoscript "if usb start ; then run start_usb_autoscript; fi; if mmcinfo; then run start_mmc_autoscript; fi;"
setenv start_mmc_autoscript "if fatload mmc 0 1020000 s905_autoscript; then autoscr 1020000; fi;"
setenv start_usb_autoscript "if fatload usb 0 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 1 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 2 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 3 1020000 s905_autoscript; then autoscr 1020000; fi;"
setenv upgrade_step "2"
saveenv
sleep 1
reset

Fix u-boot reset command

s905-autoscript-multiboot: Fix u-boot reset command

U-Boot reboot command is 'reset' and not 'reboot'. Therfore, script
fails trying to reboot the board with the wrong command.

Signed-off-by: Daniel Gomez <a236b5c9dada6e17a3bfccc7d9d096dc7c483f21@gmail.com>


ECHO b2 install toolset=gcc ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        --with-python ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
CALL b2 install toolset=gcc ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        --with-python ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1

ECHO move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

ECHO %LIBRARY_LIB%\libboost_python-mingw49-mt-1_61.dll "%LIBRARY_BIN%"
move %LIBRARY_LIB%\libboost_python-mingw49-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

ECHO b2 install toolset=gcc ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        --with-python ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
CALL b2 install toolset=gcc ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        --with-python ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1

ECHO move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

ECHO %LIBRARY_LIB%\libboost_python-mgw49-mt-1_61.dll "%LIBRARY_BIN%"
move %LIBRARY_LIB%\libboost_python-mgw49-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

Update bld.bat

Update bld.bat


mkdir tmp-build
if errorlevel 1 exit 1
cd tmp-build
if errorlevel 1 exit 1
cmake ..\pythonfmu\pythonfmu-export -DVERBOSE -DPython3_EXECUTABLE:FILEPATH="%PYTHON%" -DCMAKE_BUILD_TYPE=Release
if errorlevel 1 exit 1
cmake --build . --config Release
if errorlevel 1 exit 1
cd ..
if errorlevel 1 exit 1

%PYTHON% -m pip install . -vv
if errorlevel 1 exit 1

mkdir tmp-build
if errorlevel 1 exit 1
cd tmp-build
if errorlevel 1 exit 1
cmake ..\pythonfmu\pythonfmu-export --verbose -DPython3_EXECUTABLE:FILEPATH="%PYTHON%" -DCMAKE_BUILD_TYPE=Release
if errorlevel 1 exit 1
cmake --build . --config Release
if errorlevel 1 exit 1
cd ..
if errorlevel 1 exit 1

%PYTHON% -m pip install . -vv
if errorlevel 1 exit 1

Correct verbose setting

Correct verbose setting


NAnt -D:project.config=release clean package

.\Tools\nant\bin\NAnt.exe -D:project.config=release clean package

Include path to Nant

GaRelease.bat: Include path to Nant


/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

:: Copyright (c) 2015-present, Facebook, Inc.
:: All rights reserved.
::
:: This source code is licensed under the BSD-style license found in the
:: LICENSE file in the root directory of this source tree. An additional grant
:: of patent rights can be found in the PATENTS file in the same directory.

Fix comments on .bat file

Fix comments on .bat file


rem Script to build SciTE for Windows with all the different
rem compilers and exercise all the projects and makefiles.
rem Current directory must be scite\scripts before running.
rem Contains references to local install directories on Neil's
rem machine so must be modified for other installations.
rem Assumes environment set up so gcc and MSVC can be called.
rem
cd ..\..
set
set MSDEV_BASE=C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin
set MSDEV71_BASE=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools
rem
rem ************************************************************
rem Target 1: basic unit tests with gcc
call scite\scripts\clearboth
cd scintilla\test\unit
mingw32-make
if ERRORLEVEL 2 goto ERROR
.\unitTest
if ERRORLEVEL 2 goto ERROR
cd ..\..\..
rem
rem ************************************************************
rem Target 2: Normal gcc build
call scite\scripts\clearboth
cd scintilla\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\test
pythonw simpleTests.py
pythonw lexTests.py
pythonw performanceTests.py
cd ..\..\scite\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 3: Microsoft VC++ build
call scite\scripts\clearboth
cd scintilla\win32
cl
nmake -f scintilla.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..\scite\win32
nmake -f scite.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem Set path for VC 6
path %MSDEV_BASE%;%path%
rem
rem ************************************************************
rem Target 4: Visual C++ .NET using scite\boundscheck\SciTE.sln
call "%MSDEV71_BASE%\vsvars32.bat"
call scite\scripts\clearboth
cd scite\boundscheck
devenv scite.sln /rebuild release
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 5: GTK+ version using gcc on scintilla\gtk\makefile
call scite\scripts\clearboth
cd scintilla\gtk
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem Visual C++ builds
call "%MSDEV_BASE%\..\..\..\VC98\bin\vcvars32.bat"
echo on
rem
rem ************************************************************
rem Target 6: Visual C++ 98 using scintilla\win32\scintilla_vc6.mak
call scite\scripts\clearboth
cd scintilla\win32
nmake -f scintilla_vc6.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Removed: Target 7
rem
rem ************************************************************
rem Removed: Target 8
rem
rem ************************************************************
rem Target 9: Visual C++ using scite\boundscheck\SciTE.dsp
call scite\scripts\clearboth
cd scite\boundscheck
msdev SciTE.dsp /MAKE "SciTE - Win32 Release" /REBUILD
if ERRORLEVEL 2 goto ERROR
cd ..\..
call scite\scripts\clearboth
goto CLEANUP
:ERROR
@echo checkbuilds.bat:1: Failed %ERRORLEVEL%
:CLEANUP
set SAVE_PATH=
set SAVE_INCLUDE=
set MSDEV_BASE=
set

rem Script to build SciTE for Windows with all the different
rem compilers and exercise all the projects and makefiles.
rem Current directory must be scite\scripts before running.
rem Contains references to local install directories on Neil's
rem machine so must be modified for other installations.
rem Assumes environment set up so gcc and MSVC can be called.
rem
cd ..\..
set
set MSDEV_BASE=C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin
set MSDEV71_BASE=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools
set WINSDK_BASE=C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin
rem
rem ************************************************************
rem Target 1: basic unit tests with gcc
call scite\scripts\clearboth
cd scintilla\test\unit
mingw32-make
if ERRORLEVEL 2 goto ERROR
.\unitTest
if ERRORLEVEL 2 goto ERROR
cd ..\..\..
rem
rem ************************************************************
rem Target 2: Normal gcc build
call scite\scripts\clearboth
cd scintilla\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\test
pythonw simpleTests.py
pythonw lexTests.py
pythonw performanceTests.py
cd ..\..\scite\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 3: Microsoft VC++ build
call scite\scripts\clearboth
cd scintilla\win32
cl
nmake -f scintilla.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..\scite\win32
nmake -f scite.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem Set path for VC 6
path %MSDEV_BASE%;%path%
rem
rem ************************************************************
rem Target 4: Visual C++ .NET using scite\boundscheck\SciTE.sln
call "%MSDEV71_BASE%\vsvars32.bat"
call scite\scripts\clearboth
cd scite\boundscheck
devenv scite.sln /rebuild release
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 5: GTK+ version using gcc on scintilla\gtk\makefile
call scite\scripts\clearboth
cd scintilla\gtk
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem Visual C++ builds
call "%MSDEV_BASE%\..\..\..\VC98\bin\vcvars32.bat"
echo on
rem
rem ************************************************************
rem Target 6: Visual C++ 98 using scintilla\win32\scintilla_vc6.mak
call scite\scripts\clearboth
cd scintilla\win32
nmake -f scintilla_vc6.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Removed: Target 7
rem
rem ************************************************************
rem Removed: Target 8
rem
rem ************************************************************
rem Target 9: Visual C++ using scite\boundscheck\SciTE.dsp
call scite\scripts\clearboth
cd scite\boundscheck
msdev SciTE.dsp /MAKE "SciTE - Win32 Release" /REBUILD
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 10: SDK 64 bit compiler
rem Currently produces too many warnings so do not run
REM ~ call scite\scripts\clearboth
REM ~ call "%WINSDK_BASE%\SetEnv.Cmd" /Release /x64 /vista
REM ~ cd scintilla\win32
REM ~ nmake -f scintilla.mak
REM ~ if ERRORLEVEL 2 goto ERROR
REM ~ cd ..\..\scite\win32
REM ~ nmake -f scite.mak
REM ~ if ERRORLEVEL 2 goto ERROR
REM ~ cd ..\..
rem
rem Finished
call scite\scripts\clearboth
goto CLEANUP
:ERROR
@echo checkbuilds.bat:1: Failed %ERRORLEVEL%
:CLEANUP
set SAVE_PATH=
set SAVE_INCLUDE=
set MSDEV_BASE=
set

Include SDK 64-bit compiler but commented out as produces many warnings.


@echo off
:: Install and configure most of the existing PM active directory software
set DeploymentServer=\\pmdc2.pennmanor.net\installs

:: Set up remote file mounts
net use %DeploymentServer% /user:pmsd_dj <PASSWORD>

:: Install Office 2013
start /wait %DeploymentServer%\msoffice2013\setup.exe
:: Custom Office Patch File
msiexec /p %DeploymentServer%\msoffice2013\updates\pmsdcustom.MSP /qn
echo "Office Setup Complete"

:: Install Frontmotion Firefox
msiexec /qn /i %DeploymentServer%\firefox\latest\FirefoxESR-latest.msi TRANSFORMS=%DeploymentServer%\firefox\latest\FirefoxESR-latest.mst
echo "Firefox Setup Complete"

:: Install Mimio
msiexec /qn /i %DeploymentServer%\mimiostudio\latest\mimio-studio-latest.msi TRANSFORMS=%DeploymentServer%\mimiostudio\latest\mimio-studio-latest.mst
echo "Mimio Studio Setup Complete"

:: Install Splashtop
msiexec /qn /i %DeploymentServer%\Splashtop\latest\Splashtop-latest.msi
echo "Splashtop Setup Complete"

:: Install ownCloud Client
msiexec /qn /i %DeploymentServer%\ownCloud\owncloud-1.8.0.msi
echo "ownCloud Setup Complete"

:: Install the various Ninite Apps
:: Use a pre-defined list of apps as input
set /p Selections=<%DeploymentServer%\ninite\selections.txt
echo "Installing Ninite Software"
echo "Selected: %Selections%"
start /wait %DeploymentServer%\ninite\NiniteOne.exe /silent /allusers /disableshortcuts /select %Selections%
echo "Installed Ninite Software"

:: Configure Comets Wireless
start %DeploymentServer%\comets\comets.bat
echo "Comets WiFi Setup Complete"

:: Create the IT Tools Folders in the main directory
if not exist "C:\IT_Tools" mkdir C:\IT_Tools
echo "IT Tools Folder Created"

:: Set up Powershell execution policy for current user (admin)
:: This allows provisioning scripts to be run as local admin during the setup phase
:: See: https://technet.microsoft.com/en-us/library/hh849812.aspx
powershell -Command "Set-ExecutionPolicy Bypass -Scope CurrentUser -Force

:: Remove the useless Windows Apps
:: Photos and Video are not worth the hassle, so get them out of the base image.
powershell -Command "%DeploymentServer%\windowsMetroApps\windowsApps.ps1"

:: Re-Run Windows Updates
:: This should be run LAST, so that any previous software installs (especially Office) get updates
:: Further, the win-updates script on %DeploymentServer is modified so that SSH doesn't get reinstalled.
powershell -Command "%DeploymentServer%\win-updates.ps1"

@echo off
:: Install and configure most of the existing PM active directory software
set DeploymentServer=\\pmdc2.pennmanor.net\installs

:: Set up remote file mounts
net use %DeploymentServer% /user:pmsd_dj <PASSWORD>

:: Install Office 2013
start /wait %DeploymentServer%\msoffice2013\setup.exe
:: Custom Office Patch File
msiexec /p %DeploymentServer%\msoffice2013\updates\pmsdcustom.MSP /qn
echo "Office Setup Complete"

:: Install Frontmotion Firefox
msiexec /qn /i %DeploymentServer%\firefox\latest\FirefoxESR-latest.msi TRANSFORMS=%DeploymentServer%\firefox\latest\FirefoxESR-latest.mst
echo "Firefox Setup Complete"

:: Install Mimio
msiexec /qn /i %DeploymentServer%\mimiostudio\latest\mimio-studio-latest.msi TRANSFORMS=%DeploymentServer%\mimiostudio\latest\mimio-studio-latest.mst
echo "Mimio Studio Setup Complete"

:: Install Splashtop
msiexec /qn /i %DeploymentServer%\Splashtop\latest\Splashtop-latest.msi
echo "Splashtop Setup Complete"

:: Install ownCloud Client
msiexec /qn /i %DeploymentServer%\ownCloud\owncloud-1.8.0.msi
echo "ownCloud Setup Complete"

:: Install the various Ninite Apps
:: Use a pre-defined list of apps as input
set /p Selections=<%DeploymentServer%\ninite\selections.txt
echo "Installing Ninite Software"
echo "Selected: %Selections%"
start /wait %DeploymentServer%\ninite\NiniteOne.exe /silent /allusers /disableshortcuts /select %Selections%
echo "Installed Ninite Software"

:: Configure Comets Wireless
start %DeploymentServer%\comets\comets.bat
echo "Comets WiFi Setup Complete"

:: Create the IT Tools Folders in the main directory
if not exist "C:\IT_Tools" mkdir C:\IT_Tools
echo "IT Tools Folder Created"

:: Set up Powershell execution policy for current user (admin)
:: This allows provisioning scripts to be run as local admin during the setup phase
:: See: https://technet.microsoft.com/en-us/library/hh849812.aspx
powershell -Command "Set-ExecutionPolicy Bypass -Scope CurrentUser -Force"

:: Remove the useless Windows Apps
:: Photos and Video are not worth the hassle, so get them out of the base image.
powershell -Command "%DeploymentServer%\windowsMetroApps\windowsApps.ps1"

:: Re-Run Windows Updates
:: This should be run LAST, so that any previous software installs (especially Office) get updates
:: Further, the win-updates script on %DeploymentServer is modified so that SSH doesn't get reinstalled.
powershell -Command "%DeploymentServer%\win-updates.ps1"

Fix typo

Fix typo

Missing a closing double-quote, which probably will cause issues.


@echo off
if "%1" == "" goto paramErr
if "%VSINSTALLDIR%" == "" goto envErr

rem Determine CMake generator
if "%1" == "vc71" set GENERATOR="Visual Studio 7 .NET 2003"
if "%1" == "vc8" set GENERATOR="Visual Studio 8 2005"
if "%1" == "vc8x64" set GENERATOR="Visual Studio 8 2005 Win64"
if "%1" == "vc9" set GENERATOR="Visual Studio 9 2008"
if "%1" == "vc9x64" set GENERATOR="Visual Studio 9 2008 Win64"
if "%1" == "vc10" set GENERATOR="Visual Studio 10"
if "%1" == "vc10x64" set GENERATOR="Visual Studio 10 Win64"

if %GENERATOR% == "" goto paramErr

set BUILD_DIR=%1

if "%2" == "clean" rmdir /Q/S %BUILD_DIR%
mkdir %BUILD_DIR%
pushd %BUILD_DIR%
rem call CMake
cmake -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=TRUE -DOGRE_INSTALL_MEDIA:BOOL=TRUE -DOGRE_INSTALL_DOCS:BOOL=TRUE -G%GENERATOR% ..\..\..
if errorlevel 1 goto cmakeerror

rem Detect whether we're using full version of VStudio or Express
devenv /?

if errorlevel 1 goto tryexpress
set DEVENV=devenv
goto detecteddevenv
:tryexpress
set DEVENV=VCExpress
:detecteddevenv

%DEVENV% OGRE.sln /build "Debug" /project "INSTALL"
%DEVENV% OGRE.sln /build "Release" /project "INSTALL"

rem call CMake in sdk
pushd sdk
cmake -G%GENERATOR% .\
if errorlevel 1 goto cmakeerror
rem delete cache (since it will include absolute paths)
del CMakeCache.txt
rmdir /S/Q CMakeFiles

rem Patch up absolute references to pdbs & debug directories
rem The former should be fixed in a future version of CMake, but the latter is because we configure these files in manually
dir /b /s *.vcproj *.vcproj.user > filestopatch.txt
for /F "delims=" %%f in ('type filestopatch.txt') do (
cscript //nologo ..\..\removeabsolutepaths.vbs "%%f"
)

popd

popd

goto end

:paramErr
echo Required: Build tool (vc71, vc8, vc8x64, vc9, vc9x64, vc10, vc10x64)
set errorlevel=1
goto end

:envErr
echo You need to run this script after running vcvars32.bat
set errorlevel=1
goto end

:cmakeerror
popd
echo CMake not found on your path or CMake error - see above and correct
:end

@echo off
if "%1" == "" goto paramErr
if "%VSINSTALLDIR%" == "" goto envErr

rem Determine CMake generator
if "%1" == "vc71" set GENERATOR="Visual Studio 7 .NET 2003"
if "%1" == "vc8" set GENERATOR="Visual Studio 8 2005"
if "%1" == "vc8x64" set GENERATOR="Visual Studio 8 2005 Win64"
if "%1" == "vc9" set GENERATOR="Visual Studio 9 2008"
if "%1" == "vc9x64" set GENERATOR="Visual Studio 9 2008 Win64"
if "%1" == "vc10" set GENERATOR="Visual Studio 10"
if "%1" == "vc10x64" set GENERATOR="Visual Studio 10 Win64"

if %GENERATOR% == "" goto paramErr

set BUILD_DIR=%1

if "%2" == "clean" rmdir /Q/S %BUILD_DIR%
mkdir %BUILD_DIR%
pushd %BUILD_DIR%
rem call CMake
cmake -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=TRUE -DOGRE_INSTALL_MEDIA:BOOL=TRUE -DOGRE_INSTALL_DOCS:BOOL=TRUE -G%GENERATOR% ..\..\..
if errorlevel 1 goto cmakeerror

rem Detect whether we're using full version of VStudio or Express
devenv /?

if errorlevel 1 goto tryexpress
set DEVENV=devenv
goto detecteddevenv
:tryexpress
set DEVENV=VCExpress
:detecteddevenv

%DEVENV% OGRE.sln /build "Debug" /project "INSTALL"
%DEVENV% OGRE.sln /build "Release" /project "INSTALL"

rem call CMake in sdk
pushd sdk
cmake -G%GENERATOR% .\
if errorlevel 1 goto cmakeerror
rem delete cache (since it will include absolute paths)
del CMakeCache.txt
rmdir /S/Q CMakeFiles

rem Patch up absolute references to pdbs & debug directories
rem The former should be fixed in a future version of CMake, but the latter is because we configure these files in manually
dir /b /s *.vcproj *.vcproj.user > filestopatch.txt
for /F "delims=" %%f in ('type filestopatch.txt') do (
cscript //nologo ..\..\removeabsolutepaths.vbs "%%f"
)
del /Q/F filestopatch.txt
popd

popd

goto end

:paramErr
echo Required: Build tool (vc71, vc8, vc8x64, vc9, vc9x64, vc10, vc10x64)
set errorlevel=1
goto end

:envErr
echo You need to run this script after running vcvars32.bat
set errorlevel=1
goto end

:cmakeerror
popd
echo CMake not found on your path or CMake error - see above and correct
:end

Delete temp file when building sdk

Delete temp file when building sdk


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.15
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

: Deployment
echo Handling node.js deployment.

:: 1. Select node version
call :SelectNodeVersion

:: 2. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! install
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

:: 3. Execute Gulp
IF EXIST "%DEPLOYMENT_TARGET%\gulpfile.js" (
    call .\node_modules\.bin\gulp build
    IF !ERRORLEVEL! NEQ 0 goto error
)

:: 4. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%\dist" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.15
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

: Deployment
echo Handling node.js deployment.

:: 1. Select node version
call :SelectNodeVersion

:: 2. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! install
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

:: 3. Execute Gulp
IF EXIST "%DEPLOYMENT_TARGET%\gulpfile.js" (
    call .\node_modules\.bin\gulp build
    IF !ERRORLEVEL! NEQ 0 goto error
)

:: 4. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%\dist" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;dists"
  IF !ERRORLEVEL! NEQ 0 goto error
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Edit deploy script

Edit deploy script


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.6
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
IF NOT DEFINED DEPLOYMENT_TEMP (
  SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
  SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)

IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
  IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
  mkdir "%DEPLOYMENT_TEMP%"
)

IF DEFINED MSBUILD_PATH goto MsbuildPathDefined
SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe
:MsbuildPathDefined

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

echo Handling backend WebApi project.

:: 1. Restore NuGet packages
IF /I "AzureFunctions.sln" NEQ "" (
  call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\AzureFunctions.sln"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AzureFunctions\AzureFunctions.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
) ELSE (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AzureFunctions\AzureFunctions.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
)

IF !ERRORLEVEL! NEQ 0 goto error

:: 3. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_TEMP%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

echo Handling frontend Angular2 project.

:: 4. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%\AzureFunctions.Client" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 5. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"

  call :ExecuteCmd npm install
  IF !ERRORLEVEL! NEQ 0 (
    call :ExecuteCmd npm install
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  call :ExecuteCmd npm run jspm:i
  IF !ERRORLEVEL! NEQ 0 (
    call :ExecuteCmd npm run jspm:i
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  call :ExecuteCmd npm run typings install
  IF !ERRORLEVEL! NEQ 0 goto error

  call :ExecuteCmd gulp
  IF !ERRORLEVEL! NEQ 0 goto error

  call :ExecuteCmd npm run tsc
  IF !ERRORLEVEL! NEQ 0 goto error

  call :ExecuteCmd npm run jspm:bundle
  IF !ERRORLEVEL! NEQ 0 goto error

  ::call :ExecuteCmd npm run uglifyjs
  ::IF !ERRORLEVEL! NEQ 0 goto error

  popd
)

:: 7. Install bower
IF EXIST "%DEPLOYMENT_TARGET%\bower.json" (
  pushd "%DEPLOYMENT_TARGET%"

  call :ExecuteCmd bower install
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

:: 8. Copy templates-update webjob
SET WEBJOB_PATH=%HOME%\site\wwwroot\App_Data\jobs\triggered\templates-update
IF NOT EXIST "%WEBJOB_PATH%" (
  mkdir "%WEBJOB_PATH%"
)

copy "%DEPLOYMENT_SOURCE%\WebJobs\templates-update\templates-update.cmd" "%WEBJOB_PATH%"
copy "%DEPLOYMENT_SOURCE%\WebJobs\templates-update\settings.job" "%WEBJOB_PATH%"

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.6
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
IF NOT DEFINED DEPLOYMENT_TEMP (
  SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
  SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)

IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
  IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
  mkdir "%DEPLOYMENT_TEMP%"
)

IF DEFINED MSBUILD_PATH goto MsbuildPathDefined
SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe
:MsbuildPathDefined

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

echo Handling backend WebApi project.

:: 1. Restore NuGet packages
IF /I "AzureFunctions.sln" NEQ "" (
  call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\AzureFunctions.sln"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AzureFunctions\AzureFunctions.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
) ELSE (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AzureFunctions\AzureFunctions.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
)

IF !ERRORLEVEL! NEQ 0 goto error

:: 3. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_TEMP%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

echo Handling frontend Angular2 project.

:: 4. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%\AzureFunctions.Client" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 5. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"

  call :ExecuteCmd npm install
  IF !ERRORLEVEL! NEQ 0 (
    call :ExecuteCmd npm install
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  call :ExecuteCmd npm run jspm:i
  IF !ERRORLEVEL! NEQ 0 (
    call :ExecuteCmd npm run jspm:i
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  call :ExecuteCmd npm run typings install
  IF !ERRORLEVEL! NEQ 0 goto error

  call :ExecuteCmd gulp
  IF !ERRORLEVEL! NEQ 0 goto error

  call :ExecuteCmd npm run tsc
  IF !ERRORLEVEL! NEQ 0 goto error

  call :ExecuteCmd npm run jspm:bundle
  IF !ERRORLEVEL! NEQ 0 goto error

  ::call :ExecuteCmd npm run uglifyjs
  ::IF !ERRORLEVEL! NEQ 0 goto error

  popd
)

:: 7. Install bower
IF EXIST "%DEPLOYMENT_TARGET%\bower.json" (
  pushd "%DEPLOYMENT_TARGET%"

  call :ExecuteCmd bower install
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

:: 8. Copy templates-update webjob
SET WEBJOB_PATH=%HOME%\site\wwwroot\App_Data\jobs\triggered\templates-update
IF NOT EXIST "%WEBJOB_PATH%" (
  mkdir "%WEBJOB_PATH%"
)

copy "%DEPLOYMENT_SOURCE%\WebJobs\templates-update\templates-update.cmd" "%WEBJOB_PATH%"
copy "%DEPLOYMENT_SOURCE%\WebJobs\templates-update\settings.job" "%WEBJOB_PATH%"

:: 9. update build.txt
call :ExecuteCmd echo %SCM_COMMIT_ID% > %DEPLOYMENT_TARGET%\build.txt
IF !ERRORLEVEL! NEQ 0 (
  call :ExecuteCmd echo %SCM_COMMIT_ID% > %DEPLOYMENT_TARGET%\build.txt
  IF !ERRORLEVEL! NEQ 0 goto error
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

create build.txt in deployment script

create build.txt in deployment script


darcs push --no-set-default ndm@venice.cs.york.ac.uk:/n/www/cs/fp/darcs/drhaskell

Add a push script

Add a push script


md build
cd build
cmake -DLIBWS_WITH_AUTOBAHN=ON ..
cmake --build .
ctest
bin\Debug\autobahntest.exe --config ..\test\autobahn\libws.cfg

Add jenkins build batch file.

Add jenkins build batch file.


@echo off

powershell Remove-AppxPackage -Package "eb9a8775-4322-4e36-a34c-eee261241f4e_1.0.0.0_x64__1v3rwxh47wwxj"

rmdir /s/q bin
rmdir /s/q obj
rmdir /s/q AppPackages

msbuild /t:Restore Couchbase.Lite.Tests.UWP.csproj
msbuild /p:Configuration=Debug /p:Platform=x64 /t:Rebuild Couchbase.Lite.Tests.UWP.csproj
vstest.console.exe /InIsolation /Platform:x64 AppPackages\Couchbase.Lite.Tests.UWP_1.0.0.0_x64_Debug_Test\Couchbase.Lite.Tests.UWP_1.0.0.0_x64_Debug.appx /Logger:trx /diag:diagnostic.txt

powershell Remove-AppxPackage -Package "eb9a8775-4322-4e36-a34c-eee261241f4e_1.0.0.0_x64__1v3rwxh47wwxj"

rmdir /s/q bin
rmdir /s/q obj
rmdir /s/q AppPackages

msbuild /t:Restore /p:Configuration=Release Couchbase.Lite.Tests.UWP.csproj
msbuild /p:Configuration=Release /p:Platform=x64 /t:Rebuild Couchbase.Lite.Tests.UWP.csproj
vstest.console.exe /InIsolation /Platform:x64 AppPackages\Couchbase.Lite.Tests.UWP_1.0.0.0_x64_Test\Couchbase.Lite.Tests.UWP_1.0.0.0_x64.appx /Logger:trx /diag:diagnostic.txt

@echo off

powershell Remove-AppxPackage -Package "eb9a8775-4322-4e36-a34c-eee261241f4e_1.0.0.0_x64__1v3rwxh47wwxj"

rmdir /s/q bin
rmdir /s/q obj
rmdir /s/q AppPackages

msbuild /t:Restore Couchbase.Lite.Tests.UWP.csproj
msbuild /p:Configuration=Debug /p:Platform=x64 /t:Rebuild Couchbase.Lite.Tests.UWP.csproj || goto :error
vstest.console.exe /InIsolation /Platform:x64 AppPackages\Couchbase.Lite.Tests.UWP_1.0.0.0_x64_Debug_Test\Couchbase.Lite.Tests.UWP_1.0.0.0_x64_Debug.appx /Logger:trx /diag:diagnostic.txt || goto :error

powershell Remove-AppxPackage -Package "eb9a8775-4322-4e36-a34c-eee261241f4e_1.0.0.0_x64__1v3rwxh47wwxj"

rmdir /s/q bin
rmdir /s/q obj
rmdir /s/q AppPackages

msbuild /t:Restore /p:Configuration=Release Couchbase.Lite.Tests.UWP.csproj
msbuild /p:Configuration=Release /p:Platform=x64 /t:Rebuild Couchbase.Lite.Tests.UWP.csproj || goto :error
vstest.console.exe /InIsolation /Platform:x64 bin\x64\Release\Couchbase.Lite.Tests.UWP.build.appxrecipe /Logger:trx /diag:diagnostic.txt /Framework:FrameworkUap10 || goto :error
goto :EOF

:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

Fix UWP testing script to work

Fix UWP testing script to work

With both debug and release (.net native) builds


@echo off
setlocal EnableExtensions EnableDelayedExpansion

rem ==========================================
rem            PARSE ARGUMENTS
rem ==========================================

set CTAGS_EXE=ctags
set CTAGS_ARGS=
set TAGS_FILE=tags
set PROJECT_ROOT=
set UPDATED_SOURCE=
set PAUSE_BEFORE_EXIT=0
set LOG_FILE=

:ParseArgs
if [%1]==[] goto :DoneParseArgs
if [%1]==[-e] (
    set CTAGS_EXE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-x] (
    set CTAGS_ARGS=%CTAGS_ARGS% --exclude=%2
    shift
    goto :LoopParseArgs
)
if [%1]==[-t] (
    set TAGS_FILE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-p] (
    set PROJECT_ROOT=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-s] (
    set UPDATED_SOURCE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-p] (
    set PAUSE_BEFORE_EXIT=1
    goto :LoopParseArgs
)
if [%1]==[-l] (
    set LOG_FILE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-o] (
    set CTAGS_ARGS=%CTAGS_ARGS% --options=%2
    shift
    goto :LoopParseArgs
)
echo Invalid Argument: %1
goto :Usage

:LoopParseArgs
shift
goto :ParseArgs

:DoneParseArgs

rem ==========================================
rem               GENERATE TAGS
rem ==========================================

if [%LOG_FILE%]==[] set LOG_FILE=CON

echo Locking tags file... > %LOG_FILE%
echo locked > "%TAGS_FILE%.lock"

if exist "%TAGS_FILE%" (
    if not [%UPDATED_SOURCE%]==[] (
        echo Removing references to: %UPDATED_SOURCE% >> %LOG_FILE%
        echo type "%TAGS_FILE%" ^| findstr /V /C:"%UPDATED_SOURCE%" ^> "%TAGS_FILE%.temp" >> %LOG_FILE%
        findstr /V /C:"%UPDATED_SOURCE%" "%TAGS_FILE%" > "%TAGS_FILE%.temp"
        set CTAGS_ARGS=%CTAGS_ARGS% --append %UPDATED_SOURCE%
    )
)

echo Running ctags >> %LOG_FILE%
echo "%CTAGS_EXE%" -R -f "%TAGS_FILE%.temp" %CTAGS_ARGS% %PROJECT_ROOT% >> %LOG_FILE%
"%CTAGS_EXE%" -R -f "%TAGS_FILE%.temp" %CTAGS_ARGS% %PROJECT_ROOT%

echo Replacing tags file >> %LOG_FILE%
echo move /Y "%TAGS_FILE%.temp" "%TAGS_FILE%" >> %LOG_FILE%
move /Y "%TAGS_FILE%.temp" "%TAGS_FILE%" >NUL 2>&1

echo Unlocking tags file... >> %LOG_FILE%
del /F "%TAGS_FILE%.lock"

echo Done. >> %LOG_FILE%
if [%PAUSE_BEFORE_EXIT%]==[1] (
    pause
)

goto :EOF

rem ==========================================
rem                 USAGE
rem ==========================================

:Usage
echo Usage:
echo    %~n0 ^<options^>
echo.
echo    -e [exe=ctags]: The ctags executable to run
echo    -t [file=tags]: The path to the ctags file to update
echo    -p [dir=]:      The path to the project root
echo    -s [file=]:     The path to the source file that needs updating
echo    -l [log=]:      The log file to output to
echo    -o [options=]:  An options file to read additional options from
echo.

Convert line endings for Windows script.


del /S pom.xml.versionsBackup
call mvn3 clean

del /S pom.xml.versionsBackup
call mvn clean

Use mvn instead of mvn3.

Use mvn instead of mvn3.


curl -sSf https://static.rust-lang.org/dist/rust-1.37.0-i686-pc-windows-msvc.exe -o rust.exe
rust.exe /VERYSILENT /NORESTART /DIR="C:\Rust"
set PATH=%PATH%;C:\Rust\bin

curl -sSf http://releases.llvm.org/%LLVM_VERSION%/LLVM-%LLVM_VERSION%-win32.exe -o LLVM.exe
7z x LLVM.exe -oC:\LLVM
set PATH=%PATH%;C:\LLVM\bin
set LIBCLANG_PATH=C:\LLVM\bin

curl -sSLf https://static.rust-lang.org/dist/rust-1.37.0-i686-pc-windows-msvc.exe -o rust.exe
rust.exe /VERYSILENT /NORESTART /DIR="C:\Rust"
set PATH=%PATH%;C:\Rust\bin

curl -sSLf https://releases.llvm.org/%LLVM_VERSION%/LLVM-%LLVM_VERSION%-win32.exe -o LLVM.exe
7z x LLVM.exe -oC:\LLVM
set PATH=%PATH%;C:\LLVM\bin
set LIBCLANG_PATH=C:\LLVM\bin

Fix AppVeyor build (#29)

Fix AppVeyor build (#29)

Update to https:// URL for LLVM downloads, set to follow redirects for future moves.


REM get stuff!
if not exist download mkdir download
if not exist install mkdir install
if not exist install\windows mkdir install\windows

set eth_server=https://build.ethdev.com/builds/windows-precompiled

call :download boost 1.55.0
call :download cryptopp 5.6.2
call :download curl 7.4.2
call :download jsoncpp 1.6.2
call :download json-rpc-cpp 0.5.0
call :download leveldb 1.2
call :download microhttpd 0.9.2
call :download qt 5.4.1

goto :EOF

:download

set eth_name=%1
set eth_version=%2

cd download

if not exist %eth_name%-%eth_version%.tar.gz (
	bitsadmin /cancel %eth_name%-%eth_version%.tar.gz
	bitsadmin /create %eth_name%-%eth_version%.tar.gz
	bitsadmin /transfer %eth_name%-%eth_version%.tar.gz /download /priority normal %eth_server%/%eth_name%-%eth_version%.tar.gz %cd%\%eth_name%-%eth_version%.tar.gz
	bitsadmin /cancel %eth_name%-%eth_version%.tar.gz
)
if not exist %eth_name%-%eth_version% cmake -E tar -zxvf %eth_name%-%eth_version%.tar.gz
cmake -E copy_directory %eth_name%-%eth_version% ..\install\windows

cd ..

goto :EOF

REM get stuff!
if not exist download mkdir download
if not exist install mkdir install
if not exist install\windows mkdir install\windows

set eth_server=https://build.ethdev.com/builds/windows-precompiled

call :download boost 1.55.0
call :download cryptopp 5.6.2
call :download curl 7.4.2
call :download jsoncpp 1.6.2
call :download json-rpc-cpp 0.5.0
call :download leveldb 1.2
call :download microhttpd 0.9.2
call :download qt 5.4.1

goto :EOF

:download

set eth_name=%1
set eth_version=%2

cd download

if not exist %eth_name%-%eth_version%.tar.gz (
	for /f "tokens=2 delims={}" %%g in ('bitsadmin /create %eth_name%-%eth_version%.tar.gz') do (
		bitsadmin /transfer {%%g} /download /priority normal %eth_server%/%eth_name%-%eth_version%.tar.gz %cd%\%eth_name%-%eth_version%.tar.gz
		bitsadmin /cancel {%%g}
	)
)
if not exist %eth_name%-%eth_version% cmake -E tar -zxvf %eth_name%-%eth_version%.tar.gz
cmake -E copy_directory %eth_name%-%eth_version% ..\install\windows

cd ..

goto :EOF

use guids for download jobs

use guids for download jobs


@echo off
:: Submodule update
::git submodule update --recursive

set SRC_ASSETS_PATH=KEngine\KEngine.UnityProject\Assets
set DST_ASSETS_PATH=KSFramework\Assets
set DST_PLUGIN_PATH=KSFramework\Assets\Plugins\KEngine
set DST_EDITOR_PATH=KSFramework\Assets\Plugins\Editor\KEngineEditor

:: Resources
::xcopy %SRC_ASSETS_PATH%\Resources\KEngineConfig.txt %DST_ASSETS_PATH%\Resources\KEngineConfig.txt /S/Y/R/I

mkdir %DST_ASSETS_PATH%\..\Product\SettingSource
mkdir %DST_ASSETS_PATH%\..\Product\Bundles

:: Codes
::xcopy %SRC_ASSETS_PATH%\KEngine %DST_PLUGIN_PATH%\KEngine /S/Y/R/I
::xcopy %SRC_ASSETS_PATH%\KEngine.Lib %DST_PLUGIN_PATH%\KEngine.Lib /S/Y/R/I
::xcopy %SRC_ASSETS_PATH%\KEngine.Editor\Editor %DST_EDITOR_PATH%\KEngine.Editor /S/Y/R/I
::xcopy %SRC_ASSETS_PATH%\KEngine.EditorTools\Editor %DST_EDITOR_PATH%\KEngine.EditorTools /S/Y/R/I

echo %SRC_ASSETS_PATH%
echo %DST_PLUGIN_PATH%

mkdir %DST_PLUGIN_PATH% 2>nul
rmdir %DST_PLUGIN_PATH%\KEngine
mklink /J %DST_PLUGIN_PATH%\KEngine %SRC_ASSETS_PATH%\KEngine
rmdir %DST_PLUGIN_PATH%\KEngine.Lib
mklink /J %DST_PLUGIN_PATH%\KEngine.Lib %SRC_ASSETS_PATH%\KEngine.Lib
rmdir %DST_PLUGIN_PATH%\KEngine.Lib.UI
mklink /J %DST_PLUGIN_PATH%\KEngine.UI %SRC_ASSETS_PATH%\KEngine.UI

mkdir %DST_EDITOR_PATH% 2>nul
rmdir %DST_EDITOR_PATH%\KEngine.Editor
mklink /J %DST_EDITOR_PATH%\KEngine.Editor %SRC_ASSETS_PATH%\KEngine.Editor\Editor
rmdir %DST_EDITOR_PATH%\KEngine.EditorTools
mklink /J %DST_EDITOR_PATH%\KEngine.EditorTools %SRC_ASSETS_PATH%\KEngine.EditorTools\Editor
rmdir %DST_EDITOR_PATH%\KEngine.UI.Editor
mklink /J %DST_EDITOR_PATH%\KEngine.UI.Editor %SRC_ASSETS_PATH%\KEngine.UI.Editor\Editor

mkdir KSFramework\Assets\Plugins\libs\ 2>nul
xcopy %SRC_ASSETS_PATH%\Plugins\Android\libs\KEngine.Android.jar KSFramework\Assets\Plugins\Android\libs\KEngine.Android.jar /S/Y/R/I

:: SLua
mkdir KSFramework\Assets\SLua
mkdir KSFramework\Assets\SLua\Resources
mkdir KSFramework\Assets\SLua\Editor
xcopy slua\Assets\SLua\Editor\CustomEditor.cs KSFramework\Assets\SLua\Editor /S/Y/R/I
xcopy slua\Assets\SLua\Editor\LuaCodeGen.cs KSFramework\Assets\SLua\Editor /S/Y/R/I

rmdir KSFramework\Assets\Plugins\Slua_Managed
mklink /J KSFramework\Assets\Plugins\Slua_Managed slua\Assets\Plugins\Slua_Managed

xcopy slua\Assets\Plugins\Android\* KSFramework\Assets\Plugins\Android /S/Y/R/I
xcopy slua\Assets\Plugins\iOS\* KSFramework\Assets\Plugins\iOS /S/Y/R/I
xcopy slua\Assets\Plugins\slua.bundle\* KSFramework\Assets\Plugins\slua.bundle /S/Y/R/I
xcopy slua\Assets\Plugins\x64\* KSFramework\Assets\Plugins\x64 /S/Y/R/I
xcopy slua\Assets\Plugins\x86\* KSFramework\Assets\Plugins\x86 /S/Y/R/I

echo Finish!
ping -n 5 127.0.0.1>nul

@echo off
:: Submodule update
::git submodule update --recursive
cd /d %~dp0
set SRC_ASSETS_PATH=KEngine\KEngine.UnityProject\Assets
set DST_ASSETS_PATH=KSFramework\Assets
set DST_PLUGIN_PATH=KSFramework\Assets\Plugins\KEngine
set DST_EDITOR_PATH=KSFramework\Assets\Plugins\Editor\KEngineEditor

:: Resources
::xcopy %SRC_ASSETS_PATH%\Resources\KEngineConfig.txt %DST_ASSETS_PATH%\Resources\KEngineConfig.txt /S/Y/R/I

mkdir %DST_ASSETS_PATH%\..\Product\SettingSource
mkdir %DST_ASSETS_PATH%\..\Product\Bundles

:: Codes
::xcopy %SRC_ASSETS_PATH%\KEngine %DST_PLUGIN_PATH%\KEngine /S/Y/R/I
::xcopy %SRC_ASSETS_PATH%\KEngine.Lib %DST_PLUGIN_PATH%\KEngine.Lib /S/Y/R/I
::xcopy %SRC_ASSETS_PATH%\KEngine.Editor\Editor %DST_EDITOR_PATH%\KEngine.Editor /S/Y/R/I
::xcopy %SRC_ASSETS_PATH%\KEngine.EditorTools\Editor %DST_EDITOR_PATH%\KEngine.EditorTools /S/Y/R/I

echo %SRC_ASSETS_PATH%
echo %DST_PLUGIN_PATH%

mkdir %DST_PLUGIN_PATH% 2>nul
rmdir %DST_PLUGIN_PATH%\KEngine
mklink /J %DST_PLUGIN_PATH%\KEngine %SRC_ASSETS_PATH%\KEngine
rmdir %DST_PLUGIN_PATH%\KEngine.Lib
mklink /J %DST_PLUGIN_PATH%\KEngine.Lib %SRC_ASSETS_PATH%\KEngine.Lib
rmdir %DST_PLUGIN_PATH%\KEngine.Lib.UI
mklink /J %DST_PLUGIN_PATH%\KEngine.UI %SRC_ASSETS_PATH%\KEngine.UI

mkdir %DST_EDITOR_PATH% 2>nul
rmdir %DST_EDITOR_PATH%\KEngine.Editor
mklink /J %DST_EDITOR_PATH%\KEngine.Editor %SRC_ASSETS_PATH%\KEngine.Editor\Editor
rmdir %DST_EDITOR_PATH%\KEngine.EditorTools
mklink /J %DST_EDITOR_PATH%\KEngine.EditorTools %SRC_ASSETS_PATH%\KEngine.EditorTools\Editor
rmdir %DST_EDITOR_PATH%\KEngine.UI.Editor
mklink /J %DST_EDITOR_PATH%\KEngine.UI.Editor %SRC_ASSETS_PATH%\KEngine.UI.Editor\Editor

mkdir KSFramework\Assets\Plugins\libs\ 2>nul
xcopy %SRC_ASSETS_PATH%\Plugins\Android\libs\KEngine.Android.jar KSFramework\Assets\Plugins\Android\libs\KEngine.Android.jar /S/Y/R/I

:: SLua
mkdir KSFramework\Assets\SLua
mkdir KSFramework\Assets\SLua\Resources
mkdir KSFramework\Assets\SLua\Editor
xcopy slua\Assets\SLua\Editor\CustomEditor.cs KSFramework\Assets\SLua\Editor /S/Y/R/I
xcopy slua\Assets\SLua\Editor\LuaCodeGen.cs KSFramework\Assets\SLua\Editor /S/Y/R/I

rmdir KSFramework\Assets\Plugins\Slua_Managed
mklink /J KSFramework\Assets\Plugins\Slua_Managed slua\Assets\Plugins\Slua_Managed

xcopy slua\Assets\Plugins\Android\* KSFramework\Assets\Plugins\Android /S/Y/R/I
xcopy slua\Assets\Plugins\iOS\* KSFramework\Assets\Plugins\iOS /S/Y/R/I
xcopy slua\Assets\Plugins\slua.bundle\* KSFramework\Assets\Plugins\slua.bundle /S/Y/R/I
xcopy slua\Assets\Plugins\x64\* KSFramework\Assets\Plugins\x64 /S/Y/R/I
xcopy slua\Assets\Plugins\x86\* KSFramework\Assets\Plugins\x86 /S/Y/R/I

echo Finish!
ping -n 5 127.0.0.1>nul

update Install.bat

update Install.bat


@echo off
setlocal
set JRE_KEY=HKLM\SOFTWARE\JavaSoft\Java Runtime Environment
if not exist "%JAVA_HOME%\bin\java.exe" (
  for /f "tokens=2* delims=	 " %%u in ('reg query "%JRE_KEY%" /v CurrentVersion') do for /f "tokens=2* delims=	 " %%i in ('reg query "%JRE_KEY%\%%v" /v JavaHome') do set JAVA_HOME=%%j
) 2>nul
if exist "%JAVA_HOME%\bin\java.exe" goto found_java
echo Could not find a Java Runtime Environment. Download one from <http://java.sun.com/javase/downloads/>.
exit /b 1
:found_java
set JAR_DIR=%~dp0
if exist "%JAR_DIR%jing.jar" goto found_jing
echo Could not find jing.jar. Must be in the same directory as jing.bat (%JAR_DIR%).
exit /b 1
:found_jing
"%JAVA_HOME%\bin\java.exe" -classpath "%JAR_DIR%jing.jar" com.thaiopensource.relaxng.util.Driver %*

Add jing.bat

Add jing.bat


@REM Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
@REM Copyright (C) 2010 Gora Khargoh <gora.khargosh@gmail.com>
@REM watchmedo.bat - Wrapper .bat file for the watchmedo Python script.

@echo off
set SCRIPT_ERRORLEVEL=
if "%OS%" == "Windows_NT" goto WinNT

@REM Windows 9x/Me you better not have more than 9 arguments.
python -c "from watchdog import watchmedo; watchmedo.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9
@REM No way to set exit status of this script for 9x/Me
goto endscript

@REM Windows NT+
:WinNT
setlocal
set path=%~dp0;%~dp0..;%path%
python -c "from watchdog import watchmedo; watchmedo.main()" %*
endlocal & set SCRIPT_ERRORLEVEL=%ERRORLEVEL%

if not "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto returncode
if errorlevel 9009 echo You do not have python in your PATH environment variable.
goto endscript

:returncode
exit /B %SCRIPT_ERRORLEVEL%

:endscript
call :returncode %SCRIPT_ERRORLEVEL%

@REM Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
@REM Copyright (C) 2010 Gora Khargosh <gora.khargosh@gmail.com>
@REM watchmedo.bat - Wrapper .bat file for the watchmedo Python script.

@echo off
set SCRIPT_ERRORLEVEL=
if "%OS%" == "Windows_NT" goto WinNT

@REM Windows 9x/Me you better not have more than 9 arguments.
python -c "from watchdog import watchmedo; watchmedo.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9
@REM No way to set exit status of this script for 9x/Me
goto endscript

@REM Windows NT+
:WinNT
setlocal
set path=%~dp0;%~dp0..;%path%
python -c "from watchdog import watchmedo; watchmedo.main()" %*
endlocal & set SCRIPT_ERRORLEVEL=%ERRORLEVEL%

if not "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto returncode
if errorlevel 9009 echo You do not have python in your PATH environment variable.
goto endscript

:returncode
exit /B %SCRIPT_ERRORLEVEL%

:endscript
call :returncode %SCRIPT_ERRORLEVEL%

Fix typo in copyright statement in watchmedo.bat

Signed-off-by: Gora Khargosh <a2078c57e3ac12c6dfb97b7c2c4e6d6d7db7e92f@gmail.com>


rem copy /y TudienAnhVietBeta-org.opf TudienAnhVietBeta.opf
mobigen.exe -unicode -s0 ../dict/TudienThienChuu.opf
mobigen.exe -unicode -s0 ../dict/TudienAnhVietBeta.opf

rem Example: createmobi.bat Tu-dien-Tong-hop-Phat-hoc
mobigen.exe -unicode -s0 ../dict/%1/%1.opf

Update bat file

Update bat file


:: Copyright 2015 Rouslan Solomakhin
::
:: Licensed under the Apache License, Version 2.0 (the "License")
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::     http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

set EDITOR=runemacs
set GYP_DEFINES="component=shared_library fastbuild=2"
set GYP_GENERATORS=ninja
set HOME=%USERPROFILE%
set PATH=%PATH%;%SYSTEMDRIVE%\emacs\bin;%SYSTEMDRIVE%\console2;%SYSTEMDRIVE%\src\depot_tools;%USERPROFILE%\.third_party\cask\bin
call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"

:: Copyright 2015 Rouslan Solomakhin
::
:: Licensed under the Apache License, Version 2.0 (the "License")
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::     http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

set EDITOR=runemacs
set GYP_DEFINES="component=shared_library fastbuild=2"
set GYP_GENERATORS=ninja
set HOME=%USERPROFILE%
set PATH=%PATH%;%SYSTEMDRIVE%\emacs\bin;%SYSTEMDRIVE%\console2;%SYSTEMDRIVE%\src\depot_tools;%USERPROFILE%\.third_party\cask\bin;%SYSTEMDRIVE%\java\jdk\bin
call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"

Add jdk path.

Add jdk path.