doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
69aac5b2-5b38-415e-a687-7b29b355a50a
{ "language": "Batchfile" }
```batchfile @echo off setlocal enabledelayedexpansion pushd %1 set attempts=5 set counter=0 :retry set /a counter+=1 echo Attempt %counter% out of %attempts% if exist node_modules\azure-cli\bin\azure ( cmd /c npm update https://github.com/amitapl/azure-sdk-tools-xplat/tarball/kudu_s21_5 ) else ( cmd /c npm install https://github.com/amitapl/azure-sdk-tools-xplat/tarball/kudu_s21_5 ) IF %ERRORLEVEL% NEQ 0 goto error pushd node_modules for /r %%X IN (test) DO ( rmdir /s /q %%X 2>nul ) popd goto end :error if %counter% GEQ %attempts% goto :lastError goto retry :lastError popd echo An error has occured during npm install. exit /b 1 :end popd echo Finished successfully. exit /b 0 ``` Change npm install api for installing azure-cli as the tarball api seems to be broken.
```batchfile @echo off setlocal enabledelayedexpansion pushd %1 set attempts=5 set counter=0 :retry set /a counter+=1 echo Attempt %counter% out of %attempts% if exist node_modules\azure-cli\bin\azure ( cmd /c npm update git://github.com/amitapl/azure-sdk-tools-xplat.git#kudu_s21_5 ) else ( cmd /c npm install git://github.com/amitapl/azure-sdk-tools-xplat.git#kudu_s21_5 ) IF %ERRORLEVEL% NEQ 0 goto error pushd node_modules for /r %%X IN (test) DO ( rmdir /s /q %%X 2>nul ) popd goto end :error if %counter% GEQ %attempts% goto :lastError goto retry :lastError popd echo An error has occured during npm install. exit /b 1 :end popd echo Finished successfully. exit /b 0 ```
1c733a67-4f88-4120-a66c-28f5e0612e85
{ "language": "Batchfile" }
```batchfile mkdir build cd build cmake -G "NMake Makefiles" ^ -DCMAKE_INSTALL_PREFIX="%PREFIX%" ^ -DCMAKE_BUILD_TYPE=Release ^ %SRC_DIR% if errorlevel 1 exit 1 :: Build. nmake if errorlevel 1 exit 1 :: Test. ctest if errorlevel 1 exit 1 :: Install. nmake install if errorlevel 1 exit 1 ``` Remove ctest that doesn't do anything
```batchfile mkdir build cd build cmake -G "NMake Makefiles" ^ -DCMAKE_INSTALL_PREFIX="%PREFIX%" ^ -DCMAKE_BUILD_TYPE=Release ^ %SRC_DIR% if errorlevel 1 exit 1 :: Build. nmake if errorlevel 1 exit 1 :: Install. nmake install if errorlevel 1 exit 1 ```
3dee5f6b-3e12-4ee9-9316-1476737f7933
{ "language": "Batchfile" }
```batchfile git submodule update --init SET CLIPATH=c:\jenkins\workspace\go-cli-tests-windows32Bit SET GOPATH=%CLIPATH% c:\Go\bin\go build -v -o cf-windows-386.exe main SET GOPATH=c:\Users\Administrator\go SET CATSPATH=%GOPATH%\src\github.com\cloudfoundry\cf-acceptance-tests copy %CLIPATH%\cf-windows-386.exe %CATSPATH%\gcf.exe /Y SET PATH=%PATH%;%CATSPATH% call %environment.bat cd %CATSPATH% SET CONFIG=%CATSPATH%\config.json %GOPATH%\bin\ginkgo -r -v -slowSpecThreshold=300 -skip="admin buildpack" ``` Add cURL to the path for windows32 CATS tests
```batchfile git submodule update --init SET CLIPATH=c:\jenkins\workspace\go-cli-tests-windows32Bit SET GOPATH=%CLIPATH% c:\Go\bin\go build -v -o cf-windows-386.exe main SET GOPATH=c:\Users\Administrator\go SET CATSPATH=%GOPATH%\src\github.com\cloudfoundry\cf-acceptance-tests copy %CLIPATH%\cf-windows-386.exe %CATSPATH%\gcf.exe /Y SET PATH=%PATH%;%CATSPATH%;C:\Program Files\cURL\bin call %environment.bat cd %CATSPATH% SET CONFIG=%CATSPATH%\config.json %GOPATH%\bin\ginkgo -r -v -slowSpecThreshold=300 -skip="admin buildpack" ```
3a8871eb-b716-413e-98bc-02b1c5387b46
{ "language": "Batchfile" }
```batchfile @echo off git rev-parse HEAD > version.txt bundle exec middleman build %* ``` Update PATH before calling build command.
```batchfile @echo off SET PATH=%PATH%;D:\home\site\deployments\tools\r\ruby-2.2.2-x64-mingw32\bin git rev-parse HEAD > version.txt bundle exec middleman build %* ```
13989e93-b16d-4c0b-be7c-5a7e114c2a03
{ "language": "Batchfile" }
```batchfile @echo off if not "%ROO_CLASSPATH_FILE%" == "" goto ok echo Must set ROO_CLASSPATH_FILE to X:\checkout\spring-roo\bootstrap\target\roo_classpath.txt exit /b :ok rem echo Using Roo classpath file [%ROO_CLASSPATH_FILE%] rem Will be only one line, but the following obvious form doesn't work rem set /p ROO_CP=< %ROO_CLASSPATH_FILE% for /f "tokens=* delims= " %%a in (%ROO_CLASSPATH_FILE%) do ( set ROO_CP=%%a ) if not "%ROO_ADDON_CLASSPATH_FILE%" == "" goto run for /f "tokens=* delims= " %%a in (%ROO_ADDON_CLASSPATH_FILE%) do ( set EXTENDED_CP=%%a ) set ROO_CP=%ROO_CP%;%EXTENDED_CP% :run rem Escape in case of long file names set ROO_CP="%ROO_CP%" rem echo Using Roo classpath [%ROO_CP%] :launch java -DdevelopmentMode=true -Droo.home="%USERPROFILE%\roo-dev" -cp %ROO_CP% -Djava.ext.dirs="%USERPROFILE%\roo-dev\work" org.springframework.roo.bootstrap.Bootstrap "classpath:/roo-bootstrap.xml" %* if "%errorlevel%" == "999" goto launch ``` Add third-party add-on creation and management infrastructure
```batchfile @echo off if not "%ROO_CLASSPATH_FILE%" == "" goto ok echo Must set ROO_CLASSPATH_FILE to X:\checkout\spring-roo\bootstrap\target\roo_classpath.txt exit /b :ok rem echo Using Roo classpath file [%ROO_CLASSPATH_FILE%] rem Will be only one line, but the following obvious form doesn't work rem set /p ROO_CP=< %ROO_CLASSPATH_FILE% for /f "tokens=* delims= " %%a in (%ROO_CLASSPATH_FILE%) do ( set ROO_CP=%%a ) if not "%ROO_ADDON_CLASSPATH_FILE%" == "" goto run for /f "tokens=* delims= " %%a in (%ROO_ADDON_CLASSPATH_FILE%) do ( set EXTENDED_CP=%%a ) set ROO_CP=%ROO_CP%;%EXTENDED_CP% :run rem Escape in case of long file names set ROO_CP="%ROO_CP%" rem echo Using Roo classpath [%ROO_CP%] :launch java -DdevelopmentMode=true -Droo.home="%USERPROFILE%\roo-dev" -cp %ROO_CP% -Djava.ext.dirs="%USERPROFILE%\roo-dev\work" org.springframework.roo.bootstrap.Bootstrap "classpath:/roo-bootstrap.xml" %* if "%errorlevel%" == "100" goto launch ```
0be7ee01-f464-497c-88bc-6d89ef4d869b
{ "language": "Batchfile" }
```batchfile rem Tool to assemble Windows builds rem Requirements are 7-zip, py2exe, and FreeExtractor PATH=C:\python27;C:\python26;C:\progra~1\7-zip;C:\progra~2\7-zip;%PATH% rem ****** Clean out the old junk rmdir /q /s dist\*.* del /s /q dist\*.* rem ****** Compile our executable and core zipfile python setup.py py2exe rem ****** Remove extras from core zipfile cd dist 7z d namebench.zip tcl\*.* rmdir /s /q tcl\tcl8.5\tzdata tcl\tk8.5\demos del tcl\tk8.5\images\*.eps rem ****** Final assembly of zipfile copy ..\README.txt . 7z a namebench_for_Windows.zip -r * >nul rem ****** Test assembled zipfile namebench -x -O 8.8.8.8 -q5 -o test.html start test.html cd .. ``` Remove wildcard from del statement
```batchfile rem Tool to assemble Windows builds rem Requirements are 7-zip, py2exe, and FreeExtractor PATH=C:\python27;C:\python26;C:\progra~1\7-zip;C:\progra~2\7-zip;%PATH% rem ****** Clean out the old junk del /s /f /q dist rem ****** Compile our executable and core zipfile python setup.py py2exe rem ****** Remove extras from core zipfile cd dist 7z d namebench.zip tcl\*.* rmdir /s /q tcl\tcl8.5\tzdata tcl\tk8.5\demos del tcl\tk8.5\images\*.eps rem ****** Final assembly of zipfile copy ..\README.txt . 7z a namebench_for_Windows.zip -r * >nul rem ****** Test assembled zipfile namebench -x -O 8.8.8.8 -q5 -o test.html start test.html cd .. ```
2961c51d-4231-49b0-b7bf-d955bf52c9d3
{ "language": "Batchfile" }
```batchfile @REM Copyright (c) Microsoft. All rights reserved. @REM Licensed under the MIT license. See LICENSE file in the project root for full license information. setlocal set build-root=%~dp0.. rem // resolve to fully qualified path for %%i in ("%build-root%") do set build-root=%%~fi REM -- C -- cd %build-root%\c\build_all\windows call build.cmd --run-e2e-tests if errorlevel 1 goto :eof cd %build-root% ``` Remove run E2E tests options from Windows C build
```batchfile @REM Copyright (c) Microsoft. All rights reserved. @REM Licensed under the MIT license. See LICENSE file in the project root for full license information. setlocal set build-root=%~dp0.. rem // resolve to fully qualified path for %%i in ("%build-root%") do set build-root=%%~fi REM -- C -- cd %build-root%\c\build_all\windows call build.cmd if errorlevel 1 goto :eof cd %build-root% ```
b454e9d4-d078-457e-9019-b736c0d66f15
{ "language": "Batchfile" }
```batchfile call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 msbuild /v:m /m BuildAndTest.proj /p:CIBuild=true if ERRORLEVEL 1 ( echo Build failed exit /b 1 ) REM Kill any instances of VBCSCompiler.exe to release locked files; REM otherwise future CI runs may fail while trying to delete those files. taskkill /F /IM vbcscompiler.exe REM It is okay and expected for taskkill to fail (it's a cleanup routine). Ensure REM caller sees successful exit. exit /b 0 ``` Kill server on build failure too.
```batchfile call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 msbuild /v:m /m BuildAndTest.proj /p:CIBuild=true if ERRORLEVEL 1 ( taskkill /F /IM vbcscompiler.exe echo Build failed exit /b 1 ) REM Kill any instances of VBCSCompiler.exe to release locked files; REM otherwise future CI runs may fail while trying to delete those files. taskkill /F /IM vbcscompiler.exe REM It is okay and expected for taskkill to fail (it's a cleanup routine). Ensure REM caller sees successful exit. exit /b 0 ```
7ba6c0fe-70fa-4f38-85ac-0e1a906ba53d
{ "language": "Batchfile" }
```batchfile @echo off cls :start echo Starting server... "Nomad Server\NomadServer.exe" -name "My Oxide Server" -port 5127 -slots 10 -clientVersion "0.73" -password "" -tcpLobby "149.202.51.185" 25565 echo. echo Restarting server... echo. goto start ``` Patch for version 0.74 update
```batchfile @echo off cls :start echo Starting server... "Nomad Server\NomadServer.exe" -name "My Oxide Server" -port 5127 -slots 10 -clientVersion "0.74" -password "" -tcpLobby "149.202.51.185" 25565 echo. echo Restarting server... echo. goto start ```
8f1fc167-ff11-4449-90a7-0fc9eb15d8b7
{ "language": "Batchfile" }
```batchfile cd ..\..\ mkdir gui\deploy :: edit iss file -> AppVersion :: Copy gui/deploy.Bitsquare.jar file from mac build to windows :: edit -> -BappVersion and -srcfiles :: 64 bit build :: Needs Inno Setup 5 or later (http://www.jrsoftware.org/isdl.php) call "C:\Program Files\Java\jdk1.8.0_92\bin\javapackager.exe" -deploy -BappVersion=0.4.9 -native exe -name Bitsquare -title Bitsquare -vendor Bitsquare -outdir "\\VBOXSVR\vm_shared_windows" -appclass io.bitsquare.app.BitsquareAppMain -srcfiles "\\VBOXSVR\vm_shared_windows\Bitsquare-0.4.9.jar" -outfile Bitsquare -Bruntime="C:\Program Files\Java\jdk1.8.0_92\jre" -BjvmProperties=-Djava.net.preferIPv4Stack=true cd package\windows``` Add Xbootclasspath for windows (still not working with the app, but with the jar)
```batchfile cd ..\..\ mkdir gui\deploy :: edit iss file -> AppVersion :: Copy gui/deploy.Bitsquare.jar file from mac build to windows :: edit -> -BappVersion and -srcfiles :: 64 bit build :: Needs Inno Setup 5 or later (http://www.jrsoftware.org/isdl.php) SET version=0.4.9 SET jdk=C:\Program Files\Java\jdk1.8.0_92 SET outdir=\\VBOXSVR\vm_shared_windows call "%jdk%\bin\javapackager.exe" -deploy ^ -BjvmOptions=-Xbootclasspath/a:^"jdkfix-%version%.jar^";^"..\runtime\lib\ext\jfxrt.jar^" ^ -BappVersion=%version% ^ -native exe ^ -name Bitsquare ^ -title Bitsquare ^ -vendor Bitsquare ^ -outdir %outdir% ^ -appclass io.bitsquare.app.BitsquareAppMain ^ -srcfiles "%outdir%\Bitsquare-%version%.jar;%outdir%\jdkfix-%version%.jar" ^ -outfile Bitsquare ^ -Bruntime="%jdk%\jre" ^ -BjvmProperties=-Djava.net.preferIPv4Stack=true :: -BjvmOptions=-verbose:class :: that works if used form the terminal: :: java -Xbootclasspath/a:"jdkfix-0.4.9.jar";"C:\Users\asd\AppData\Local\Bitsquare\runtime\lib\ext\jfxrt.jar" -jar Bitsquare-0.4.9.jar cd package\windows ```
d404bd03-ffc7-48a0-be05-57ccfb5804df
{ "language": "Batchfile" }
```batchfile @echo off cls .nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion -Version 2.17.9 .nuget\nuget.exe install SourceLink.Fake -OutputDirectory packages -ExcludeVersion .nuget\nuget.exe install FSharp.Formatting -OutputDirectory packages -ExcludeVersion SET TARGET="All" IF NOT [%1]==[] (set TARGET="%1") "packages\FAKE\tools\FAKE.exe" "build.fsx" "target=%TARGET%"``` Remove version from FAKE install.
```batchfile @echo off cls .nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion .nuget\nuget.exe install SourceLink.Fake -OutputDirectory packages -ExcludeVersion .nuget\nuget.exe install FSharp.Formatting -OutputDirectory packages -ExcludeVersion SET TARGET="All" IF NOT [%1]==[] (set TARGET="%1") "packages\FAKE\tools\FAKE.exe" "build.fsx" "target=%TARGET%"```
ff1656fd-1b08-46ba-bd75-3dd6d86e627f
{ "language": "Batchfile" }
```batchfile set project=clibudp rem //expected build dir structure set buildexp=build\\Visual_Studio_12_2013\\x86 set currentdir=%cd% set builddir=.\\%buildexp% mkdir %builddir% rem //get path to clibcdc libs set clibcdc=..\\..\\clibcdc\\%buildexp% pushd %clibcdc% set clibcdc=%cd% popd rem //launch cmake to generate build environment pushd %builddir% cmake -G "Visual Studio 12 2013" -Dclibcdc_DIR:PATH=%clibcdc% %currentdir% popd rem //build from generated build environment cmake --build %builddir% ``` Fix build script for MS Windows x86
```batchfile set project=clibudp rem //expected build dir structure set buildexp=build\\Visual_Studio_12_2013\\x86 set currentdir=%cd% set builddir=.\\%buildexp% set libsdir=..\\libs mkdir %builddir% rem //get path to clibcdc libs set clibcdc=%libsdir%\\clibcdc\\%buildexp% pushd %clibcdc% set clibcdc=%cd% popd rem //get path to clibspi libs set clibspi=%libsdir%\\clibspi\\%buildexp% pushd %clibspi% set clibspi=%cd% popd rem //get path to clibdpa libs set clibdpa=%libsdir%\\clibdpa\\%buildexp% pushd %clibdpa% set clibdpa=%cd% popd rem //get path to cutils libs set cutils=%libsdir%\\cutils\\%buildexp% pushd %cutils% set cutils=%cd% popd rem //launch cmake to generate build environment pushd %builddir% cmake -G "Visual Studio 12 2013" -Dclibdpa_DIR:PATH=%clibdpa% -Dcutils_DIR:PATH=%cutils% -Dclibcdc_DIR:PATH=%clibcdc% -Dclibspi_DIR:PATH=%clibspi% %currentdir% popd rem //build from generated build environment cmake --build %builddir% ```
57a0f931-8b21-412d-9be4-4c7ca3bfcb5d
{ "language": "Batchfile" }
```batchfile @echo off cls :start echo Starting server... TheForest -batchmode -nographics -ip 0.0.0.0 -port 27000 -maxplayers 10 -hostname "My Oxide Server" -friendsonly 0 echo. echo Restarting server... echo. goto start ``` Set default port in .bat to what it should be
```batchfile @echo off cls :start echo Starting server... TheForest -batchmode -nographics -ip 0.0.0.0 -port 27016 -maxplayers 10 -hostname "My Oxide Server" -friendsonly 0 echo. echo Restarting server... echo. goto start ```
993391ee-10fc-41dc-99eb-19925d3461fb
{ "language": "Batchfile" }
```batchfile @echo off set PYTHONPATH=%CD% C:\Python27\python.exe reader_browser\reader_browser.py %* ``` Replace absolute path of python
```batchfile @echo off set PYTHONPATH=%CD% python reader_browser\reader_browser.py %* ```
cd12d083-9c59-41b8-8925-8a0e34081199
{ "language": "Batchfile" }
```batchfile @echo off echo. echo James Build System echo ------------------- set ANT_HOME=tools set CLASSPATH=lib\xerces.jar %ANT_HOME%\bin\ant.bat -emacs %1 %2 %3 %4 %5 %6 %7 %8 goto cleanup :cleanup set ANT_HOME= ``` Use velocity and jdom that was copied from jakarta-site2
```batchfile @echo off echo. echo James Build System echo ------------------- set ANT_HOME=tools set CLASSPATH=lib\xerces-1.4.3.jar;tools\lib\velocity-1.3-dev.jar;tools\lib\jdom-b7.jar %ANT_HOME%\bin\ant.bat -emacs %1 %2 %3 %4 %5 %6 %7 %8 goto cleanup :cleanup set ANT_HOME= ```
ef275b74-4c66-4afc-ad1b-b1bca25d63a1
{ "language": "Batchfile" }
```batchfile @echo off if not exist "genie.exe" ( echo Downloading genie... bitsadmin /transfer "genie" "https://github.com/bkaradzic/bx/raw/master/tools/bin/windows/genie.exe" "%~dp0\genie.exe" ) IF "%1"=="" ( echo No argument set echo Exemple : build.bat vs2015 exit 1 ) genie.exe %* ``` Use powershell instead of bitsadmin for download genie.exe
```batchfile @echo off if not exist "genie.exe" ( echo Downloading genie... rem bitsadmin /transfer "genie" "https://github.com/bkaradzic/bx/raw/master/tools/bin/windows/genie.exe" "%~dp0\genie.exe" powershell Invoke-WebRequest -Uri "https://github.com/bkaradzic/bx/raw/master/tools/bin/windows/genie.exe" -OutFile "%~dp0\genie.exe" ) IF "%1"=="" ( echo No argument set echo Exemple : build.bat vs2015 exit 1 ) genie.exe %* ```
02672bda-98e1-4043-8aaa-8a112c7d62e0
{ "language": "Batchfile" }
```batchfile git init touch README.md git add README.md git add .gitignore git commit -m"initial commit" cd external git submodule add --depth 1 -- https://github.com/fmtlib/fmt.git git submodule add --depth 1 -- https://github.com/gabime/spdlog.git cd .. ``` Fix batch script missing submodule
```batchfile git init touch README.md git add README.md git add .gitignore git commit -m"initial commit" cd external git submodule add --depth 1 -- https://github.com/fmtlib/fmt.git git submodule add --depth 1 -- https://github.com/gabime/spdlog.git git submodule add --depth 1 -- https://github.com/onqtam/doctest.git cd .. ```
463c3e50-081a-4bf4-b5c6-5cbc969d2384
{ "language": "Batchfile" }
```batchfile @echo off cls :start echo Starting server... "Nomad Server\NomadServer.exe" -name "My Oxide Server" -port 5127 -slots 10 -clientVersion "0.91" -password "" -tcpLobby "149.202.51.185" 25565 echo. echo Restarting server... echo. goto start ``` Patch for version 0.92 update
```batchfile @echo off cls :start echo Starting server... "Nomad Server\NomadServer.exe" -name "My Oxide Server" -port 5127 -slots 10 -clientVersion "0.92" -password "" -tcpLobby "149.202.51.185" 25565 echo. echo Restarting server... echo. goto start ```
3c1b005d-b6b1-424b-8e15-2dc390b2286b
{ "language": "Batchfile" }
```batchfile @echo off pushd "%~dp0" for /f "tokens=*" %%f in ('dir /s /b *.tt') do ( echo>&2 dotnet t4 "%%f" dotnet t4 "%%f" || goto :end ) :end popd ``` Fix error propagation in T4 batch script
```batchfile @echo off pushd "%~dp0" for /f "tokens=*" %%f in ('dir /s /b *.tt') do ( echo>&2 dotnet t4 "%%f" dotnet t4 "%%f" || goto :end ) :end popd exit /b %ERRORLEVEL% ```
778f0a1c-7f3f-43af-9e99-6e087fb96d45
{ "language": "Batchfile" }
```batchfile git flow version > NUL if %ERRORLEVEL% GEQ 1 ( copy gitflow-windows-dependencies\* "C:\Program Files (x86)\Git\bin" cd gitflow contrib\msysgit-install.cmd "C:\Program Files (x86)\Git" ) echo "Installing..." copy git-release "C:\Program Files (x86)\Git\bin" echo "Done!" ``` Use pushd instead of cd
```batchfile git flow version > NUL if %ERRORLEVEL% GEQ 1 ( copy gitflow-windows-dependencies\* "C:\Program Files (x86)\Git\bin" pushd gitflow contrib\msysgit-install.cmd "C:\Program Files (x86)\Git" popd ) echo "Installing..." copy git-release "C:\Program Files (x86)\Git\bin" echo "Done!" ```
7465feee-d1fe-4ac9-a7de-19590bcbca89
{ "language": "Batchfile" }
```batchfile @REM Starts Visual Studio Developer Command Prompt. @IF DEFINED VisualStudioVersion EXIT /B 0 @REM https://developercommunity.visualstudio.com/content/problem/26780/vsdevcmdbat-changes-the-current-working-directory.html SET "VSCMD_START_DIR=%CD%" @REM VS2017 uses vswhere.exe for locating the installation. FOR /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease -latest -property installationPath`) do ( IF EXIST "%%i\Common7\Tools\VsDevCmd.bat" (CALL "%%i\Common7\Tools\VsDevCmd.bat" && GOTO OkRestoreEcho || GOTO Error) ) @REM VS2015 uses %VS140COMNTOOLS% for locating the installation. IF "%VS140COMNTOOLS%" NEQ "" (CALL "%VS140COMNTOOLS%VsDevCmd.bat" x86 && GOTO OkRestoreEcho || GOTO Error) :Error @ECHO ERROR: Cannot find Visual Studio. @EXIT /B 1 :OkRestoreEcho @ECHO ON @ECHO %~nx0 SUCCESSFULLY COMPLETED. ``` Build script: Better error handling if cannot locate Visual Studio.
```batchfile @REM Starts Visual Studio Developer Command Prompt. @IF DEFINED VisualStudioVersion EXIT /B 0 @REM https://developercommunity.visualstudio.com/content/problem/26780/vsdevcmdbat-changes-the-current-working-directory.html SET "VSCMD_START_DIR=%CD%" @REM VS2017 uses vswhere.exe for locating the installation. FOR /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease -latest -property installationPath`) do ( IF EXIST "%%i\Common7\Tools\VsDevCmd.bat" (CALL "%%i\Common7\Tools\VsDevCmd.bat" && GOTO OkRestoreEcho || GOTO Error) ) @REM VS2015 uses %VS140COMNTOOLS% for locating the installation. IF "%VS140COMNTOOLS%" NEQ "" ( IF EXIST "%VS140COMNTOOLS%VsDevCmd.bat" ( CALL "%VS140COMNTOOLS%VsDevCmd.bat" x86 && GOTO OkRestoreEcho || GOTO Error ) ) :Error @ECHO ERROR: Cannot find Visual Studio. @EXIT /B 1 :OkRestoreEcho @ECHO ON @ECHO %~nx0 SUCCESSFULLY COMPLETED. ```
aca5dbc8-9717-4b0e-a9e1-67dac5c1bd23
{ "language": "Batchfile" }
```batchfile @echo off cls :start echo Starting server... "Nomad Server\NomadServer.exe" -name "My Oxide Server" -port 5127 -slots 10 -clientVersion "0.92" -password "" -tcpLobby "149.202.51.185" 25565 echo. echo Restarting server... timeout /t 10 echo. goto start ``` Patch for version 0.93 update
```batchfile @echo off cls :start echo Starting server... "Nomad Server\NomadServer.exe" -name "My Oxide Server" -port 5127 -slots 10 -clientVersion "0.93" -password "" -tcpLobby "149.202.51.185" 25565 echo. echo Restarting server... timeout /t 10 echo. goto start ```
c93d43e9-a782-4f99-8118-256f7cbad828
{ "language": "Batchfile" }
```batchfile ``` Add a script to generate MDB files: those are needed for Windows-compiled Sharpmake to run on Linux
```batchfile :: Script that generates Mono MDB files from Windows/.NET PDB files. @echo off setlocal enabledelayedexpansion set CONFIGURATIONS= if "%~1" equ "" ( set CONFIGURATIONS=Debug Release ) else if /i "%~1" equ "debug" ( set CONFIGURATIONS=Debug ) else if /i "%~1" equ "release" ( set CONFIGURATIONS=Release ) else ( echo. echo [%~nx0] ERROR: Unknown configuration type: %1^^! exit /b 1 ) pushd "%~dp0" :: pdb2mdb.exe was originally taken from https://gist.github.com/jbevain/ba23149da8369e4a966f :: as that version: :: 1) Handles the VS2015+ PDB format, and :: 2) Can be launched using .NET (i.e. does not need to run within Mono) :: We now use another executable (still compliant with the said criteria), fetched with NuGet: nuget install Mono.Unofficial.pdb2mdb :: Look for pdb2mdb.exe. Its root directory has an undetermined name, because it contains a version :: e.g. Mono.Unofficial.pdb2mdb.4.2.3.4. set PDB2MDB_EXE= for /f %%A in ('dir /b /s pdb2mdb.exe') do ( set PDB2MDB_EXE=%%A ) if not defined PDB2MDB_EXE ( echo. echo [%~nx0] ERROR: Could not find pdb2mdb.exe^^! exit /b 1 ) :: For each specified configuration for %%c in (%CONFIGURATIONS%) do ( :: For each subdirectory... for /R "." /D %%d in (*) do ( :: ...that matches the current configuration if /i "%%~nxd" equ "%%c" ( :: For each EXE and DLL file for %%f in (%%d\*.exe %%d\*.dll) do ( call :PROCESS_BIN_FILE %%f ) ) ) ) exit /b 0 :PROCESS_BIN_FILE :: If this binary file does not have an associated PDB file, skip it! if not exist %~dpn1.pdb ( goto :EOF ) set FILENAME=%~1 echo *** Generating MDB file for "!FILENAME:%CD%\=!"... *** %PDB2MDB_EXE% %1 if not exist "%~1.mdb" ( echo ERROR: "%~1.mdb" was NOT generated^^! ) ```
cf617b87-0796-4026-8d0d-333d14fdd7b8
{ "language": "Batchfile" }
```batchfile cd %RECIPE_DIR% cd ..\..\ python setup.py install --target=nd --single-version-externally-managed --record=record.txt || exit 1 rd /s /q %SP_DIR%\__pycache__ rd /s /q %SP_DIR%\numpy rd /s /q %SP_DIR%\Cython ``` Make sure the Python from the build environment is used when building dynd.nd.
```batchfile cd %RECIPE_DIR% cd ..\..\ %PYTHON% setup.py install --target=nd --single-version-externally-managed --record=record.txt || exit 1 rd /s /q %SP_DIR%\__pycache__ rd /s /q %SP_DIR%\numpy rd /s /q %SP_DIR%\Cython ```
f716c5c9-d3c6-4d89-8648-e10cad2cfe6b
{ "language": "Batchfile" }
```batchfile @echo OFF setlocal ENABLEDELAYEDEXPANSION IF [%1]==[] GOTO :USAGE set MKREPO_PATH=%1 SET MKREPO_PATH=%MKREPO_PATH:/=\% REM Check if its fully qualified. echo %MKREPO_PATH% | findstr /b ^\\\\ >nul IF ERRORLEVEL 1 ( echo ERROR: "%MKREPO_PATH%" is not a fully qualified UNC share name. exit /b 1 ) REM FIX up path separators SET MKREPO_NIX_PATH=%MKREPO_PATH:\=/% ECHO Going to initialize a git repo in %MKREPO_PATH% :INITIALIZE_REPO If EXIST %MKREPO_PATH% ( echo Directory %MKREPO_PATH% already exists. GOTO :END ) git init --bare %MKREPO_NIX_PATH% if NOT ERRORLEVEL 1 ( echo -------- CREATED REMOTE REPO ----------- GOTO :END ) exit /b 1 :USAGE echo makeremoterepo.cmd {UNC SHARE} exit /b 1 :END endlocal&SET MKREPO_PATH=%MKREPO_NIX_PATH%``` Validate if the folder passed in is a git repo and terminate if not.
```batchfile @echo OFF setlocal ENABLEDELAYEDEXPANSION IF [%1]==[] GOTO :USAGE set MKREPO_PATH=%1 SET MKREPO_PATH=%MKREPO_PATH:/=\% REM Check if its fully qualified. echo %MKREPO_PATH% | findstr /b ^\\\\ >nul IF ERRORLEVEL 1 ( echo ERROR: "%MKREPO_PATH%" is not a fully qualified UNC share name. exit /b 1 ) REM FIX up path separators SET MKREPO_NIX_PATH=%MKREPO_PATH:\=/% ECHO Going to initialize a git repo in %MKREPO_PATH% :INITIALIZE_REPO If EXIST %MKREPO_PATH% ( echo Directory %MKREPO_PATH% already exists. pushd %MKREPO_PATH% git rev-parse IF ERRORLEVEL 1 exit /b 1 popd GOTO :END ) git init --bare %MKREPO_NIX_PATH% if NOT ERRORLEVEL 1 ( echo -------- CREATED REMOTE REPO ----------- GOTO :END ) exit /b 1 :USAGE echo makeremoterepo.cmd {UNC SHARE} exit /b 1 :END endlocal&SET MKREPO_PATH=%MKREPO_NIX_PATH%```
92d649cc-03f5-4696-8f67-6288accc67d3
{ "language": "Batchfile" }
```batchfile set CACHE=C:\cache set CYGWIN_MIRROR="http://cygwin.mirror.constant.com" set CYGWIN_ADDITIONAL_REPO="http://www.dronecode.org.uk/cygwin/" set CYGWIN_ADDITIONAL_REPO_KEY="http://www.dronecode.org.uk/cygwin/dronecode.gpg" if _%arch%_ == _x64_ set SETUP=setup-x86_64.exe && set CYGWIN_ROOT=C:\cygwin64 if _%arch%_ == _x86_ set SETUP=setup-x86.exe && set CYGWIN_ROOT=C:\cygwin if not exist %CACHE% mkdir %CACHE% echo Updating Cygwin and installing ninja and test prerequisites %CYGWIN_ROOT%\%SETUP% -qnNdO -R "%CYGWIN_ROOT%" -s "%CYGWIN_MIRROR%" -s "%CYGWIN_ADDITIONAL_REPO%" -K "%CYGWIN_ADDITIONAL_REPO_KEY%" -l "%CACHE%" -g -P "ninja,gcc-objc,gcc-objc++,libglib2.0-devel,zlib-devel,python3-pip" echo Install done ``` Revert "Add an additional Cygwin package repo with patched ninja"
```batchfile set CACHE=C:\cache set CYGWIN_MIRROR="http://cygwin.mirror.constant.com" if _%arch%_ == _x64_ set SETUP=setup-x86_64.exe && set CYGWIN_ROOT=C:\cygwin64 if _%arch%_ == _x86_ set SETUP=setup-x86.exe && set CYGWIN_ROOT=C:\cygwin if not exist %CACHE% mkdir %CACHE% echo Updating Cygwin and installing ninja and test prerequisites %CYGWIN_ROOT%\%SETUP% -qnNdO -R "%CYGWIN_ROOT%" -s "%CYGWIN_MIRROR%" -l "%CACHE%" -g -P "ninja,gcc-objc,gcc-objc++,libglib2.0-devel,zlib-devel,python3-pip" echo Install done ```
f5ef2fd6-b04b-482c-99ad-69e16f88c16b
{ "language": "Batchfile" }
```batchfile set SOURCE_DIR=%CD% set BUILD_DIR="../build-sqlitewrapper" set CMAKE_COMMAND=cmake.exe set MAKE_COMMAND=C:\Qt\Tools\QtCreator\bin\jom.exe /J 2 call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" python projectfiles_unchanged.py if %ERRORLEVEL% NEQ 0 ( RMDIR /S /Q "%BUILD_DIR%" ) if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%" cd "%BUILD_DIR%" || goto error %CMAKE_COMMAND% -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" "%SOURCE_DIR%" || goto error %MAKE_COMMAND% || goto error cd "%SOURCE_DIR%" exit /b 0 :error cd "%SOURCE_DIR%" exit /b 1 ``` Remove quotes from path variable definition
```batchfile set SOURCE_DIR=%CD% set BUILD_DIR=../build-sqlitewrapper set CMAKE_COMMAND=cmake.exe set MAKE_COMMAND=C:\Qt\Tools\QtCreator\bin\jom.exe /J 2 call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" python projectfiles_unchanged.py if %ERRORLEVEL% NEQ 0 ( RMDIR /S /Q "%BUILD_DIR%" ) if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%" cd "%BUILD_DIR%" || goto error %CMAKE_COMMAND% -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" "%SOURCE_DIR%" || goto error %MAKE_COMMAND% || goto error cd "%SOURCE_DIR%" exit /b 0 :error cd "%SOURCE_DIR%" exit /b 1 ```
a3c3958a-caeb-466b-83fd-fcb3b98e73be
{ "language": "Batchfile" }
```batchfile @@@ setlocal @@@ for /f %%i in ('dir /b /ad /on "%windir%\Microsoft.NET\Framework\v*"') do @if exist "%windir%\Microsoft.NET\Framework\%%i\msbuild".exe set msbuild=%windir%\Microsoft.NET\Framework\%%i\msbuild.exe @@@ if not defined msbuild (echo MSBuild.exe not found>&2 & exit /b 42) @@@ if defined msbuild "%msbuild%" NUnitFramework.msbuild %*``` Build using xbuild on Windows for mono
```batchfile @echo off setlocal for %%a in (%*) do echo "%%a" | findstr /C:"mono">nul && set buildtool=xbuild.bat if not defined buildtool for /f %%i in ('dir /b /ad /on "%windir%\Microsoft.NET\Framework\v*"') do @if exist "%windir%\Microsoft.NET\Framework\%%i\msbuild".exe set buildtool=%windir%\Microsoft.NET\Framework\%%i\msbuild.exe if not defined buildtool (echo no MSBuild.exe or xbuild was found>&2 & exit /b 42) if defined buildtool "%buildtool%" %~dp0NUnitFramework.msbuild %*```
439b6144-960d-427d-b833-9cd8f1905374
{ "language": "Batchfile" }
```batchfile @echo off REM Ensure we've set things up properly if [%1] == [] goto Fail REM Get authentication information set connection=%1 REM Convert the working directory to something scp can use REM First grab the invocation directory (/bin) set cwd=%~dp0 REM Replace \ slashes with / slashes set cwd=%cwd:\=/% REM Replace c: with /c so we have a UNIX-style drive reference set cwd=%cwd:c:=/c% echo Copying provision scripts to the remote host: %host% REM Copy both the provision directory and the bin directory to the remote server scp -r %cwd%../provision/ %connection%:provision scp -r %cwd% %connection%:scripts echo Invoking scripts on the remote host. REM Install dos2unix so we can fix line endings ssh -t %connection% 'sudo apt-get install dos2unix -y' REM Convert line endings of the deploy script ssh -t %connection% 'dos2unix scripts/remote-provision.sh' REM Fire the provision script so we can build the server ssh -t %connection% 'sudo scripts/remote-provision.sh' goto End :Fail echo Invalid invocation. Please specify a username (with sudo rights) and hostname. :End``` Remove what we don't need
```batchfile @echo off REM Ensure we've set things up properly if [%1] == [] goto Fail REM Get authentication information set connection=%1 REM Convert the working directory to something scp can use REM First grab the invocation directory (/bin) set cwd=%~dp0 REM Replace \ slashes with / slashes set cwd=%cwd:\=/% REM Replace c: with /c so we have a UNIX-style drive reference set cwd=%cwd:c:=/c% echo Copying provision scripts to the remote host: %host% REM Copy both the provision directory and the bin directory to the remote server scp -r %cwd%../provision/ %connection%:provision scp -r %cwd% %connection%:scripts echo Invoking scripts on the remote host. REM Install dos2unix so we can fix line endings ssh -t %connection% 'sudo apt-get install dos2unix -y' REM Convert line endings of the deploy script ssh -t %connection% 'dos2unix scripts/remote-provision.sh' REM Fire the provision script so we can build the server ssh -t %connection% 'sudo scripts/remote-provision.sh' REM Remove remote execution scripts ssh -t %connection% 'rm -rf provision scripts' goto End :Fail echo Invalid invocation. Please specify a username (with sudo rights) and hostname. :End```
059dff5e-5f65-4e26-9a6f-4c483c04ec21
{ "language": "Batchfile" }
```batchfile @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``` Build script: Run MSBuild multi-threaded
```batchfile @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```
e96dec67-39b3-4bb1-9f5e-f87042bba0ec
{ "language": "Batchfile" }
```batchfile /** * 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
```batchfile :: 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. ```
6cf52080-97a8-451b-b5a4-1d6a9c17f078
{ "language": "Batchfile" }
```batchfile ``` Add jenkins build batch file.
```batchfile md build cd build cmake -DLIBWS_WITH_AUTOBAHN=ON .. cmake --build . ctest bin\Debug\autobahntest.exe --config ..\test\autobahn\libws.cfg ```
d7ec15a1-c358-4c9a-84c1-9f8fda56091f
{ "language": "Batchfile" }
```batchfile if %sentinel% NEQ __sentinel__ exit call %tmp%\wget_and_install.bat http://downloads.sourceforge.net/sevenzip 7z465.msi %base_dir%\7z ``` Update 7zip to version 9.20
```batchfile if %sentinel% NEQ __sentinel__ exit call %tmp%\wget_and_install.bat http://downloads.sourceforge.net/sevenzip 7z920.msi %base_dir%\7z ```
446dde51-3032-4cd0-bfc7-31e858ec2b82
{ "language": "Batchfile" }
```batchfile @echo off REM Download Mingw 64 on Windows from http://win-builds.org/download.html set GOARCH=%1 IF "%1" == "" (set GOARCH=amd64) set ORG_PATH=github.com\hashicorp set REPO_PATH=%ORG_PATH%\consul set GOPATH=%cd%\gopath rmdir /s /q %GOPATH%\src\%REPO_PATH% 2>nul mkdir %GOPATH%\src\%ORG_PATH% 2>nul go get .\... mklink /J "%GOPATH%\src\%REPO_PATH%" "%cd%" 2>nul %GOROOT%\bin\go build -o bin\%GOARCH%\consul.exe %REPO_PATH%``` Add missing switch -u, which updates packages
```batchfile @echo off REM Download Mingw 64 on Windows from http://win-builds.org/download.html set GOARCH=%1 IF "%1" == "" (set GOARCH=amd64) set ORG_PATH=github.com\hashicorp set REPO_PATH=%ORG_PATH%\consul set GOPATH=%cd%\gopath rmdir /s /q %GOPATH%\src\%REPO_PATH% 2>nul mkdir %GOPATH%\src\%ORG_PATH% 2>nul go get -u .\... mklink /J "%GOPATH%\src\%REPO_PATH%" "%cd%" 2>nul %GOROOT%\bin\go build -o bin\%GOARCH%\consul.exe %REPO_PATH%```
3affdfc0-51d6-4dc2-8e12-3954762dc80f
{ "language": "Batchfile" }
```batchfile ``` Add a helper script to test MinGW builds locally (to help debugging the build server)
```batchfile @rem MinGW build test - used to test MinGW builds locally @rem Adapt path/versions before use @rem This batch file must be used from the repository root @if exist mingw.bat cd .. @set PATH=%ProgramFiles%\mingw-w64\i686-4.9.2-win32-dwarf-rt_v3-rev1\mingw32\bin;%PATH% @set PATH=%ProgramFiles%\GnuWin32\bin;%PATH% @rem Alternative ways to use mingw @rem make CC=gcc CFLAGS=-w CFLAGS+=-Iinclude/ CFLAGS+=-lws2_32 CFLAGS+=-liphlpapi @rem gcc src\civetweb.c src\main.c -Iinclude\ -lws2_32 -lpthread -lcomdlg32 -w make build CC=gcc WITH_LUA=1 WITH_WEBSOCKET=1 ```
2c92d314-cd2e-4bf3-bf34-17a00016a0dd
{ "language": "Batchfile" }
```batchfile @echo off rem This will download the Kolibri windows installer artifact at the windows-2016 buildkite agent. rem After the installer successfully sign it will upload the signed installer at the Sign Windows installer pipeline artifact. rem To sign the Windows installer set the `SIGN_WINDOWS_INSTALLER=true` environment variable. IF NOT "%SIGN_WINDOWS_INSTALLER%" == "true" (GOTO DONT_SIGN) set current_path=%cd% buildkite-agent.exe artifact download "installer/*.exe" . --step "Build kolibri windows installer" --build %BUILDKITE_BUILD_ID% --agent-access-token %BUILDKITE_AGENT_ACCESS_TOKEN% %WINDOWS_SIGN_SCRIPT_PATH% "%current_path%\installer" && cd "%current_path%\installer\" && buildkite-agent.exe artifact upload "*.exe" GOTO END :DONT_SIGN echo Don't sign the Windows installer. :END``` Change the don’t sign message log.
```batchfile @echo off rem This will download the Kolibri windows installer artifact at the windows-2016 buildkite agent. rem After the installer successfully sign it will upload the signed installer at the Sign Windows installer pipeline artifact. rem To sign the Windows installer set the `SIGN_WINDOWS_INSTALLER=true` environment variable. IF NOT "%SIGN_WINDOWS_INSTALLER%" == "true" (GOTO DONT_SIGN) set current_path=%cd% buildkite-agent.exe artifact download "installer/*.exe" . --step "Build kolibri windows installer" --build %BUILDKITE_BUILD_ID% --agent-access-token %BUILDKITE_AGENT_ACCESS_TOKEN% %WINDOWS_SIGN_SCRIPT_PATH% "%current_path%\installer" && cd "%current_path%\installer\" && buildkite-agent.exe artifact upload "*.exe" GOTO END :DONT_SIGN echo Set the SIGN_WINDOWS_INSTALLER=true environment variable to sign the Windows installer. :END```
341da8a4-63dd-4fa6-a9a6-e1485e22e0f2
{ "language": "Batchfile" }
```batchfile @echo off setlocal set PATH=C:\Program Files (x86)\Git\bin\;%PATH% call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\vcvarsall.bat" x86 msbuild /tv:12.0 /p:BuildSignedSharpDX=false /t:RunCertificationTests /verbosity:quiet /clp:ErrorsOnly /fl /flp:Summary;Verbosity=minimal;logfile=BuildErrors.log;Append=true %* d:\Artiom\Projects\SharpDX\SharpDX.build ``` Fix path to SharpDX.build for certification tests.
```batchfile @echo off setlocal set PATH=C:\Program Files (x86)\Git\bin\;%PATH% call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\vcvarsall.bat" x86 msbuild /tv:12.0 /p:BuildSignedSharpDX=false /t:RunCertificationTests /verbosity:quiet /clp:ErrorsOnly /fl /flp:Summary;Verbosity=minimal;logfile=BuildErrors.log;Append=true %* SharpDX.build ```
f76fdb19-9f23-4868-8ce0-b0d2ca618d16
{ "language": "Batchfile" }
```batchfile REM If GitVersion is not available then run REM cinst GitVersion.Portable REM to install it GitVersion.exe /output buildserver /exec scripts\lib\FAKE\tools\Fake.exe /execArgs "scripts\build.fsx %1" /l console ``` Allow more arguments to fake
```batchfile REM If GitVersion is not available then run REM cinst GitVersion.Portable REM to install it GitVersion.exe /output buildserver /exec scripts\lib\FAKE\tools\Fake.exe /execArgs "scripts\build.fsx %1 %2 %3 %4 %5 %6 %7 %8 %9 " /l console ```
f17cb45c-b955-4079-af26-eb9361ba9b01
{ "language": "Batchfile" }
```batchfile @echo Off pushd %~dp0 setlocal :Build call npm install call npm run check call npm run build call npm run lint call npm run coverage:teamcity call npm run integration-test call npm run integration-test-stdin-windows if %ERRORLEVEL% neq 0 goto BuildFail goto BuildSuccess :BuildFail echo. echo *** BUILD FAILED *** goto End :BuildSuccess echo. echo *** BUILD SUCCEEDED *** goto End :End echo. popd exit /B %ERRORLEVEL% ``` Build script should fail for problems
```batchfile @echo Off pushd %~dp0 setlocal :Build call npm install if %ERRORLEVEL% neq 0 goto BuildFail call npm run check if %ERRORLEVEL% neq 0 goto BuildFail call npm run build if %ERRORLEVEL% neq 0 goto BuildFail call npm run lint if %ERRORLEVEL% neq 0 goto BuildFail call npm run coverage:teamcity if %ERRORLEVEL% neq 0 goto BuildFail call npm run integration-test if %ERRORLEVEL% neq 0 goto BuildFail call npm run integration-test-stdin-windows if %ERRORLEVEL% neq 0 goto BuildFail goto BuildSuccess :BuildFail echo. echo *** BUILD FAILED *** goto End :BuildSuccess echo. echo *** BUILD SUCCEEDED *** goto End :End echo. popd exit /B %ERRORLEVEL% ```
53b4d59b-d3e7-4e6b-bb9c-c05061eca9bc
{ "language": "Batchfile" }
```batchfile @echo on git submodule update --init --recursive cd Agiil.Web npm install cd .. nuget restore Agiil.sln``` Reorder build script to work around unexplained error
```batchfile @echo on git submodule update --init --recursive nuget restore Agiil.sln cd Agiil.Web REM It's very strange but this has to be the last line of the script. REM As soon as it completes, this script is terminated and nothing afterwards REM is executed. npm install ```
69549ca3-3476-4ec7-9795-949a60414f66
{ "language": "Batchfile" }
```batchfile echo y | "%ANDROID_HOME%/tools/android.bat" update sdk --no-ui --all --filter android-10,android-23,platform-tools,tools,build-tools-23.0.3 ``` Set --silent to reduce android sdk logs (hopefully).
```batchfile echo y | "%ANDROID_HOME%/tools/android.bat" --silent update sdk --no-ui --all --filter android-10,android-23,platform-tools,tools,build-tools-23.0.3 ```
dbbc7807-4190-409e-8c83-42d6adc9e3a3
{ "language": "Batchfile" }
```batchfile set "ROBOZONKY_EXECUTABLE=${com.github.robozonky.distribution.jar}" set "HERE=%~dp0%" echo Will run %ROBOZONKY_EXECUTABLE% from '%HERE%'. rem Use Java runtime bundled with RoboZonky, if available. set "CUSTOM_JRE_LOCATION=%HERE%runtime\" set "JAVA_EXECUTABLE=java.exe" IF EXIST %CUSTOM_JRE_LOCATION%bin\%JAVA_EXECUTABLE% ( set "JAVA_EXECUTABLE=%CUSTOM_JRE_LOCATION%bin\%JAVA_EXECUTABLE%" set "JAVA_HOME=%CUSTOM_JRE_LOCATION%" ) echo Will use '%JAVA_EXECUTABLE%' as the Java executable. echo JAVA_HOME set to '%JAVA_HOME%'. rem TODO Don't open java.util when Yasson can be upgraded to 1.0.8+, removing the warning. set "ROBOZONKY_OPTS=%JAVA_OPTS% --add-opens java.base/java.util=ALL-UNNAMED -XX:+ExitOnOutOfMemoryError -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true" %JAVA_EXECUTABLE% %ROBOZONKY_OPTS% -jar %HERE%%ROBOZONKY_EXECUTABLE% %* rem Don't let the window close if something went wrong. pause ``` Enable logging in installer on Windows
```batchfile set "ROBOZONKY_EXECUTABLE=${com.github.robozonky.distribution.jar}" set "HERE=%~dp0%" echo Will run %ROBOZONKY_EXECUTABLE% from '%HERE%'. rem Use Java runtime bundled with RoboZonky, if available. set "CUSTOM_JRE_LOCATION=%HERE%runtime\" set "JAVA_EXECUTABLE=java.exe" IF EXIST %CUSTOM_JRE_LOCATION%bin\%JAVA_EXECUTABLE% ( set "JAVA_EXECUTABLE=%CUSTOM_JRE_LOCATION%bin\%JAVA_EXECUTABLE%" set "JAVA_HOME=%CUSTOM_JRE_LOCATION%" ) echo Will use '%JAVA_EXECUTABLE%' as the Java executable. echo JAVA_HOME set to '%JAVA_HOME%'. rem TODO Don't open java.util when Yasson can be upgraded to 1.0.8+, removing the warning. set "ROBOZONKY_OPTS=%JAVA_OPTS% --add-opens java.base/java.util=ALL-UNNAMED -XX:+ExitOnOutOfMemoryError -Dlog4j.configurationFile=log4j2.xml -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true" %JAVA_EXECUTABLE% %ROBOZONKY_OPTS% -jar %HERE%%ROBOZONKY_EXECUTABLE% %* rem Don't let the window close if something went wrong. pause ```
881a7d00-46a2-4c1b-8a2a-6643a5be7154
{ "language": "Batchfile" }
```batchfile bash scripts/test.sh REM store return code set return=%errorlevel% call scripts\kill_applications.bat > kill.log exit /B %return% ``` Hide all kill application output
```batchfile bash scripts/test.sh REM store return code set return=%errorlevel% call scripts\kill_applications.bat > kill.log 2>&1 exit /B %return% ```
e5bd2d64-d984-4976-b5b6-d9fdbc702c7c
{ "language": "Batchfile" }
```batchfile @echo off for /f "delims=" %%i in ('npm config get prefix') do set output=%%i @node %output%/node_modules/gogo/gg.js %* echo on``` Allow spaces in directory paths of output dir
```batchfile @echo off for /f "delims=" %%i in ('npm config get prefix') do set output=%%i @node "%output%/node_modules/gogo/gg.js" %* echo on ```
66d43ab6-def4-489b-97e7-024a3e73763e
{ "language": "Batchfile" }
```batchfile @echo off setlocal EnableDelayedExpansion SET VERSIONS=2.7 3.5 3.6 3.7 3.8 SET SOURCEDIR=%cd% REM Build packages for %%v in (%VERSIONS%) do ( SET ENV_NAME=py%%v REM Create and activate environment cd %ROOT_DIR% CALL conda create -y -n py%%v python=%%v if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!) CALL conda activate py%%v if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!) pip install --no-cache-dir setuptools wheel pytest if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!) REM Build and package python setup.py build_ext bdist_wheel if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!) REM Cleanup CALL conda deactivate rmdir /S /Q build python\opencc\clib OpenCC.egg-info ) REM Upload to PyPI REM conda activate py3.8 REM python -m pip install twine REM python -m twine upload dist/* ``` Use absolute path to conda.bat in windows image
```batchfile @echo off setlocal EnableDelayedExpansion REM Initialize conda C:\Miniconda/condabin/conda.bat init powershell SET VERSIONS=2.7 3.5 3.6 3.7 3.8 SET SOURCEDIR=%cd% REM Build packages for %%v in (%VERSIONS%) do ( SET ENV_NAME=py%%v REM Create and activate environment cd %ROOT_DIR% CALL C:\Miniconda/condabin/conda.bat create -y -n py%%v python=%%v if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!) CALL C:\Miniconda/condabin/conda.bat activate py%%v if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!) pip install --no-cache-dir setuptools wheel pytest if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!) REM Build and package python setup.py build_ext bdist_wheel if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!) REM Cleanup CALL C:\Miniconda/condabin/conda.bat deactivate rmdir /S /Q build python\opencc\clib OpenCC.egg-info ) REM Upload to PyPI REM C:\Miniconda/condabin/conda.bat activate py3.8 REM python -m pip install twine REM python -m twine upload dist/* ```
b96ee5e4-e344-4002-a846-5b94cae8d4ea
{ "language": "Batchfile" }
```batchfile powershell -Command "(New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/d/d/9/dd9a82d0-52ef-40db-8dab-795376989c03/vcredist_x86.exe', 'vcredist_x86.exe')" if errorlevel 1 exit 1 powershell -Command "(New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/2/d/6/2d61c766-107b-409d-8fba-c39e61ca08e8/vcredist_x64.exe', 'vcredist_x64.exe')" if errorlevel 1 exit 1 vcredist_x86.exe /qb! if errorlevel 1 exit 1 vcredist_x64.exe /qb! if errorlevel 1 exit 1 for %%F in ("." "bin") do ( cmake -G "%CMAKE_GENERATOR%" ^ -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^ -DCMAKE_INSTALL_DEBUG_LIBRARIES:BOOL="OFF" ^ -DCMAKE_INSTALL_DEBUG_LIBRARIES_ONLY:BOOL="OFF" ^ -DCMAKE_INSTALL_OPENMP_LIBRARIES:BOOL="ON" ^ -DCMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION:STRING=%%F ^ "%RECIPE_DIR%" if errorlevel 1 exit 1 cmake --build "%SRC_DIR%" ^ --target INSTALL ^ --config Release if errorlevel 1 exit 1 ) ``` Revert "Install Visual C++ 2008 SP1 Redistributables"
```batchfile for %%F in ("." "bin") do ( cmake -G "%CMAKE_GENERATOR%" ^ -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^ -DCMAKE_INSTALL_DEBUG_LIBRARIES:BOOL="OFF" ^ -DCMAKE_INSTALL_DEBUG_LIBRARIES_ONLY:BOOL="OFF" ^ -DCMAKE_INSTALL_OPENMP_LIBRARIES:BOOL="ON" ^ -DCMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION:STRING=%%F ^ "%RECIPE_DIR%" if errorlevel 1 exit 1 cmake --build "%SRC_DIR%" ^ --target INSTALL ^ --config Release if errorlevel 1 exit 1 ) ```
ac7da52c-8844-4913-b860-d8d4b48f86b4
{ "language": "Batchfile" }
```batchfile ``` Add wrapper batch file for Jenkins to build
```batchfile mkdir ..\libm2dec\Release mkdir ..\libm2dec\Debug mkdir ..\h264dec\Release mkdir ..\h264dec\Debug mkdir ..\m2dec\Release mkdir ..\m2dec\Debug "C:\Program Files (x86)\Renesas\Hew\hmake.exe" m2dec.mak > buildlog.txt find "ERROR" buildlog.txt if errorlevel 1 exit /b 0 exit /b 1 ```
29bce97b-4256-4620-9451-fb0305291038
{ "language": "Batchfile" }
```batchfile setlocal enableextensions enabledelayedexpansion git config --system core.longpaths true set LIBRARY_PATHS=-I %LIBRARY_INC% pushd %LIBRARY_INC% for /F "usebackq delims=" %%F in (`dir /b /ad-h`) do ( set LIBRARY_PATHS=!LIBRARY_PATHS! -I %LIBRARY_INC%\%%F ) popd endlocal set PATH=%cd%\jom;%PATH% SET PATH=%cd%\gnuwin32\gnuwin32\bin;%cd%\gnuwin32\bin;%PATH% mkdir b pushd b where jom :: Set QMake prefix to LIBRARY_PREFIX qmake -set prefix %LIBRARY_PREFIX% qmake QMAKE_LIBDIR=%LIBRARY_LIB% ^ QMAKE_BINDIR=%LIBRARY_BIN% ^ INCLUDEPATH+="%LIBRARY_INC%" ^ .. echo on jom jom install ``` Install python 2.7 on a separate prefix on Windows
```batchfile setlocal enableextensions enabledelayedexpansion git config --system core.longpaths true set LIBRARY_PATHS=-I %LIBRARY_INC% pushd %LIBRARY_INC% for /F "usebackq delims=" %%F in (`dir /b /ad-h`) do ( set LIBRARY_PATHS=!LIBRARY_PATHS! -I %LIBRARY_INC%\%%F ) popd endlocal :: Chromium requires Python 2.7 to generate compilation outputs. conda create -y --prefix "%SRC_DIR%\win_python" python=2.7 -c conda-forge set PATH=%SRC_DIR%\win_python;%PATH% set PATH=%cd%\jom;%PATH% SET PATH=%cd%\gnuwin32\gnuwin32\bin;%cd%\gnuwin32\bin;%PATH% mkdir b pushd b where jom :: Set QMake prefix to LIBRARY_PREFIX qmake -set prefix %LIBRARY_PREFIX% qmake QMAKE_LIBDIR=%LIBRARY_LIB% ^ QMAKE_BINDIR=%LIBRARY_BIN% ^ INCLUDEPATH+="%LIBRARY_INC%" ^ .. echo on jom jom install ```
ffae1984-390d-4b7a-845b-4eaf61a131df
{ "language": "Batchfile" }
```batchfile :: Init Script for cmd.exe :: Sets some nice defaults :: Created as part of cmder project :: Change the prompt style :: Mmm tasty lamb @prompt $E[1;32;40m$P$S{git}$S$_$E[1;30;40m{lamb}$S$E[0m :: Pick right version of clink @if "%PROCESSOR_ARCHITECTURE%"=="x86" ( set architecture=86 ) else ( set architecture=64 ) :: Run clink @"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" :: Prepare for msysgit :: I do not even know, copypasted from their .bat @set PLINK_PROTOCOL=ssh @if not defined TERM set TERM=cygwin :: Enhance Path @set git_install_root=%CMDER_ROOT%\vendor\msysgit @set PATH=%PATH%;%CMDER_ROOT%\bin;%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%git_install_root%\share\vim\vim73; :: Add aliases @doskey /macrofile="%CMDER_ROOT%\config\aliases" :: Set home path @set HOME=%USERPROFILE% @if defined CMDER_START cd /d "%CMDER_START%" ``` Use HOME if already set.
```batchfile :: Init Script for cmd.exe :: Sets some nice defaults :: Created as part of cmder project :: Change the prompt style :: Mmm tasty lamb @prompt $E[1;32;40m$P$S{git}$S$_$E[1;30;40m{lamb}$S$E[0m :: Pick right version of clink @if "%PROCESSOR_ARCHITECTURE%"=="x86" ( set architecture=86 ) else ( set architecture=64 ) :: Run clink @"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" :: Prepare for msysgit :: I do not even know, copypasted from their .bat @set PLINK_PROTOCOL=ssh @if not defined TERM set TERM=cygwin :: Enhance Path @set git_install_root=%CMDER_ROOT%\vendor\msysgit @set PATH=%PATH%;%CMDER_ROOT%\bin;%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%git_install_root%\share\vim\vim73; :: Add aliases @doskey /macrofile="%CMDER_ROOT%\config\aliases" :: Set home path @if not defined HOME set HOME=%USERPROFILE% @if defined CMDER_START cd /d "%CMDER_START%" ```
e9540aab-2731-4d8d-a463-0fb59f921f73
{ "language": "Batchfile" }
```batchfile @ECHO OFF ECHO Press enter to install PHPUnit for PHP PAUSE cmd /C pear update-channels cmd /C pear upgrade cmd /C pear channel-discover pear.phpunit.de cmd /C pear channel-discover pear.symfony-project.com cmd /C pear clear-cache cmd /C pear install --alldeps phpunit/PHPUnit ECHO Installation complete PAUSE``` Change PHPUnit script to use channel pear.symfony.com instead of pear.symfony-project.com
```batchfile @ECHO OFF ECHO Press enter to install PHPUnit for PHP PAUSE cmd /C pear update-channels cmd /C pear upgrade cmd /C pear channel-discover pear.phpunit.de cmd /C pear channel-discover pear.symfony.com cmd /C pear clear-cache cmd /C pear install --alldeps phpunit/PHPUnit ECHO Installation complete PAUSE```
1617a453-db2e-4948-b552-a85687e6c32c
{ "language": "Batchfile" }
```batchfile @echo off copy /y bin\*.dll %PREFIX%\ > nul copy /y bin\cmake.exe %PREFIX%\ > nul xcopy share %PREFIX%\share /E /I > nul ``` Put bin and share in same place
```batchfile @echo off xcopy bin %LIBRARY_BIN%\bin /E /I > nul xcopy share %LIBRARY_BIN%\share /E /I > nul ```
9f9378dc-7b1f-400d-9d35-cb0cb57b320f
{ "language": "Batchfile" }
```batchfile @echo off setlocal set OUTFILE=%1 if [%OUTFILE%] == [] set OUTFILE=CON ( for /F %%s in ('git describe --tags') do set TY_VERSION=%%s if DEFINED TY_VERSION ( set TY_VERSION=%TY_VERSION:~1% echo /* echo * This Source Code Form is subject to the terms of the Mozilla Public echo * License, v. 2.0. If a copy of the MPL was not distributed with this echo * file, You can obtain one at http://mozilla.org/MPL/2.0/. echo */ echo. echo #ifndef TY_VERSION_H echo #define TY_VERSION_H echo. echo #define TY_VERSION "%TY_VERSION%" echo. echo #endif ) else ( type "%~dp0\..\src\version.h" ) ) >%OUTFILE% 2>NUL endlocal ``` Fix git version script on Windows
```batchfile @echo off setlocal set OUTFILE=%1 if [%OUTFILE%] == [] set OUTFILE=CON ( for /F %%t in ('git describe --tags') do ( set tag=%%t goto git_version ) ) 2>NUL goto src_version :git_version ( echo /* echo * This Source Code Form is subject to the terms of the Mozilla Public echo * License, v. 2.0. If a copy of the MPL was not distributed with this echo * file, You can obtain one at http://mozilla.org/MPL/2.0/. echo */ echo. echo #ifndef TY_VERSION_H echo #define TY_VERSION_H echo. echo #define TY_VERSION "%tag:~1%" echo. echo #endif ) >%OUTFILE% goto end :src_version type "%~dp0\..\src\version.h" >%OUTFILE% goto end :end endlocal ```
87ec6c07-f2e3-414d-a35b-21354d119bde
{ "language": "Batchfile" }
```batchfile call npm install @echo off @echo if "%%~1"=="-FIXED_CTRL_C" ( > s.bat @echo shift >> s.bat @echo ) else ( >> s.bat @echo call ^<NUL %%0 -FIXED_CTRL_C %%* >> s.bat @echo goto :EOF >> s.bat @echo ) >> s.bat @echo cd database >> s.bat @echo i.vbs "start /WAIT restart.bat" >> s.bat @echo cd .. >> s.bat @echo start "Drathybot" node ../DrathybotAlpha >> s.bat @echo CreateObject("Wscript.Shell").Run "s.bat", 0, True > Drathybot.vbs mkdir database cd database @echo CreateObject("Wscript.Shell").Run "" ^& WScript.Arguments(0) ^& "", 0, False > i.vbs @echo del db.log > start.bat @echo "C:/Program Files/MongoDB/Server/3.0/bin/mongod.exe" --dbpath %%~dp0 --logpath db.log >> start.bat @echo "C:/Program Files/MongoDB/Server/3.0/bin/mongo.exe" localhost:27017 --eval "db.adminCommand({shutdown : 1})" > stop.bat @echo call stop.bat > restart.bat @echo timeout 1 >> restart.bat @echo wscript.exe i.vbs "start.bat" >> restart.bat @echo exit >> restart.bat cd .. timeout 5``` Call node on the folder rather than on DrathybotAlpha
```batchfile call npm install @echo off @echo if "%%~1"=="-FIXED_CTRL_C" ( > s.bat @echo shift >> s.bat @echo ) else ( >> s.bat @echo call ^<NUL %%0 -FIXED_CTRL_C %%* >> s.bat @echo goto :EOF >> s.bat @echo ) >> s.bat @echo cd database >> s.bat @echo i.vbs "start /WAIT restart.bat" >> s.bat @echo cd .. >> s.bat @echo start "Drathybot" node %~dp0 >> s.bat @echo CreateObject("Wscript.Shell").Run "s.bat", 0, True > Drathybot.vbs mkdir database cd database @echo CreateObject("Wscript.Shell").Run "" ^& WScript.Arguments(0) ^& "", 0, False > i.vbs @echo del db.log > start.bat @echo "C:/Program Files/MongoDB/Server/3.0/bin/mongod.exe" --dbpath %%~dp0 --logpath db.log >> start.bat @echo "C:/Program Files/MongoDB/Server/3.0/bin/mongo.exe" localhost:27017 --eval "db.adminCommand({shutdown : 1})" > stop.bat @echo call stop.bat > restart.bat @echo timeout 1 >> restart.bat @echo wscript.exe i.vbs "start.bat" >> restart.bat @echo exit >> restart.bat cd .. timeout 5```
a9d879c4-c6cf-420b-8886-70a9607c38a0
{ "language": "Batchfile" }
```batchfile @echo off :: uninstall Python 2.7 64bit MsiExec.exe /X {16E52445-1392-469F-9ADB-FC03AF00CD62} /QN :: wipe the Python directory :: DOS hack first create dir because Windows cannot test not existing without error message md c:\Python27 1>nul 2>nul rd /s /q c:\Python27 || echo Failure: c:\Python27 still exists, please find out why and repeat. ``` Change GUID for python 2.7.12
```batchfile @echo off :: uninstall Python 2.7.12 64bit MsiExec.exe /X {9DA28CE5-0AA5-429E-86D8-686ED898C666} /QN :: wipe the Python directory :: DOS hack first create dir because Windows cannot test not existing without error message md c:\Python27 1>nul 2>nul rd /s /q c:\Python27 || echo Failure: c:\Python27 still exists, please find out why and repeat. ```
9fd43c51-8320-49c5-92dc-73306245266e
{ "language": "Batchfile" }
```batchfile ``` Add a easy rununitests script for WinCE
```batchfile set DEPOT="%CD%" IF NOT EXIST sfw.pro GOTO NOSOURCE set CETESTCOMMAND=cetest -cache %QTDIR%\.qmake.cache -libpath \Windows cd %DEPOT%\..\..\qa-dungeon\mainline\tests\wince\deploy\ call %CETESTCOMMAND% cd %DEPOT%\tests\auto\servicemetadata call %CETESTCOMMAND% cd %DEPOT%\tests\auto\servicedatabase call %CETESTCOMMAND% cd %DEPOT%\tests\auto\databasemanager call %CETESTCOMMAND% cd %DEPOT%\tests\auto\qservicemanager" call %CETESTCOMMAND% cd %DEPOT%\tests\auto\qservicefilter call %CETESTCOMMAND% cd %DEPOT%\tests\auto\qserviceinterfacedescriptor call %CETESTCOMMAND% cd %DEPOT%\tests\auto\qabstractsecuritysession call %CETESTCOMMAND% GOTO EOF :NOSOURCE echo "Unable to find sfw.pro check current directory is serviceframework source" GOTO EOF :EOF cd %DEPOT% ```
e091a8e3-b9b4-494a-979c-0c32f683ec88
{ "language": "Batchfile" }
```batchfile ``` Add a rununittests script for WinCE
```batchfile set DEPOT="%CD%" IF NOT EXIST bearermanagement.pro GOTO NOSOURCE set CETESTCOMMAND=cetest -cache %QTDIR%\.qmake.cache -libpath \Windows IF NOT EXIST %DEPOT%\..\..\qa-dungeon\mainline\tests\wince\deploy\ GOTO SKIPDEPLOY cd %DEPOT%\..\..\qa-dungeon\mainline\tests\wince\deploy\ call %CETESTCOMMAND% :SKIPDEPLOY cd %DEPOT%\..\..\qa-dungeon\mainline\tests\wince\deploy\ call %CETESTCOMMAND% cd %DEPOT%\tests\auto\qnetworkconfiguration call %CETESTCOMMAND% cd %DEPOT%\tests\auto\qnetworkconfigmanager call %CETESTCOMMAND% cd %DEPOT%\tests\auto\qnetworksession GOTO EOF :NOSOURCE echo "Unable to find bearermanagement.pro check current directory is bearermanagment source" GOTO EOF :EOF cd %DEPOT% ```
51f9bd3b-ffe7-4b04-8e79-9397f84c1e94
{ "language": "Batchfile" }
```batchfile ``` Create new ref with ref count.
```batchfile @ECHO OFF :USAGE :START :INITIALIZE SETLOCAL ENABLEDELAYEDEXPANSION SET BASE_DIR=%~DP0 SET IN_VAR_NAME=%1 SET IN_VALUE=%2 SET OUT_VAR_NAME=%1 :CODE SET GLOBALS_FILE=%BASE_DIR%\globals.txt SET REFERENCE_COUNT=1 SET VALUE= :WHILE_REF_EXISTS CALL GEN-REF REFERENCE CALL GET-GLOBAL %GLOBALS_FILE% REFERENCE VALUE IF NOT %VALUE% == "" GOTO :WHILE_REF_EXISTS CALL SET-GLOBAL %GLOBALS_FILE% REFERENCE %IN_VALUE% CALL SET-GLOBAL %GLOBALS_FILE% REFERENCE_COUNT[%REFERENCE%] %REFERENCE_COUNT% :RETURN ENDLOCAL & ( SET %OUT_VAR_NAME%=%REFERENCE% ) :EOF @ECHO ON ```
29a024ca-119e-4ddb-93cc-02951fde12fb
{ "language": "Batchfile" }
```batchfile : REM BAT-file name pk2cc5x.bat : REM %1=C:\PK2proj\ path to the tool-chain : REM %2=PIC16f690 pic device name : REM %3=C:\PK2proj\Work\ path to work directory : REM %4=hello_blink.c File name : REM %5=hello_blink File name without extension @ECHO. @ECHO -NOW COMPILING WITH CC5X "%~1Cc5x\Cc5x.exe" "%~3%~4" -I"%~1Cc5x" -O%3 -a @ECHO. @ECHO -NOW DOWNLOADING CODE WITH PK2CMD "%~1PK2Cmd\pk2cmd" -b"%~1PK2Cmd" -p%2 -f"%~3%~5.hex" -a4.5 -m -r -t -jn ``` Add proper error code handling
```batchfile : REM BAT-file name pk2cc5x.bat : REM %1=C:\PK2proj\ path to the tool-chain : REM %2=PIC16f690 pic device name : REM %3=C:\PK2proj\Work\ path to work directory : REM %4=hello_blink.c File name : REM %5=hello_blink File name without extension @ECHO. @ECHO -NOW COMPILING WITH CC5X "%~1Cc5x\Cc5x.exe" "%~3%~4" -I"%~1Cc5x" -O%3 -a @ECHO OFF IF errorlevel 1 ( exit %errorlevel% ) @ECHO ON @ECHO. @ECHO -NOW DOWNLOADING CODE WITH PK2CMD "%~1PK2Cmd\pk2cmd" -b"%~1PK2Cmd" -p%2 -f"%~3%~5.hex" -a4.5 -m -r -t -jn @ECHO OFF IF errorlevel 1 ( exit %errorlevel% ) @ECHO ON ```
e159d866-da92-4012-9983-ff35e1de24d0
{ "language": "Batchfile" }
```batchfile :: Package everything into a "Grabber.zip" file at the root of the git repository :: Copy all required files to the release directory bash scripts/package.sh "release" xcopy /I /E /Y /EXCLUDE:cpex.txt "src/sites" "release/sites/" xcopy /I /E /K /H "src/dist/windows" "release" :: Add Qt DLL and files %Qt5_Dir%/bin/windeployqt --dir "release" "release/Grabber.exe" :: Add OpenSSL and MySQL DLL copy %OPENSSL_ROOT_DIR%/libcrypto-1_1*.dll "release" copy %OPENSSL_ROOT_DIR%/libssl-1_1*.dll "release" copy %MYSQL_DRIVER_DIR%/libmysql.dll "release" :: Zip the whole directory pushd release 7z a -r "../Grabber.zip" . popd :: Cleanup ::rmdir /S /Q release ``` Remove a few unnecessary DLLs from the Windows portable version
```batchfile :: Package everything into a "Grabber.zip" file at the root of the git repository :: Copy all required files to the release directory bash scripts/package.sh "release" xcopy /I /E /Y /EXCLUDE:cpex.txt "src/sites" "release/sites/" xcopy /I /E /K /H "src/dist/windows" "release" :: Add Qt DLL and files %Qt5_Dir%/bin/windeployqt --dir "release" "release/Grabber.exe" --release --no-quick-import --angle --no-opengl-sw :: Add OpenSSL and MySQL DLL copy %OPENSSL_ROOT_DIR%/libcrypto-1_1*.dll "release" copy %OPENSSL_ROOT_DIR%/libssl-1_1*.dll "release" copy %MYSQL_DRIVER_DIR%/libmysql.dll "release" :: Zip the whole directory pushd release 7z a -r "../Grabber.zip" . popd :: Cleanup ::rmdir /S /Q release ```
ffd36fb6-d9cc-45db-afad-a2196528cd69
{ "language": "Batchfile" }
```batchfile PATH=C:\python26;C:\progra~2\7-zip;%PATH% del /q /s dist\*.* python setup.py py2exe cd dist 7z d library.zip jinja2\* dns\* 'graphy\* del /s w9xpopen.exe copy ..\README.txt . 7z a namebench_for_Windows.zip -r * namebench -x -O 8.8.8.8 -t5 -o test.html start test.html cd .. ``` Add Program Files\7-Zip to path
```batchfile PATH=C:\python26;C:\progra~1\7-zip;C:\progra~2\7-zip;%PATH% del /q /s dist\*.* python setup.py py2exe cd dist 7z d library.zip jinja2\* dns\* 'graphy\* del /s w9xpopen.exe copy ..\README.txt . 7z a namebench_for_Windows.zip -r * namebench -x -O 8.8.8.8 -t5 -o test.html start test.html cd .. ```
c3e7fc39-5c75-40d3-b6eb-ebf56713c52b
{ "language": "Batchfile" }
```batchfile ``` Add batch file to test if imports from packages work with package restore
```batchfile rmdir /S /Q %~dp0packages msbuild %~dp0src\PaketTestApp\PaketTestApp.csproj @rem If the assembly is signed then the targets file from the StrongNamer package was included correctly sn -T %~dp0src\PaketTestApp\bin\Debug\Octokit.dll```
3624ba40-0f45-435d-81d4-4f2c13594f06
{ "language": "Batchfile" }
```batchfile :<<"::CMDLITERAL" @echo off goto :CMDSCRIPT ::CMDLITERAL #!/bin/bash set -euo pipefail IFS=$$'\n\t' script_dir=$$(cd $$(dirname $$0); pwd -P) repo_dir=$$(dirname $$script_dir) build_dir=$$repo_dir/_build cmake --build $$build_dir --target test exit $$? :CMDSCRIPT @echo off setlocal call :Main "%~f0" "%~dp0" "%~dp0.." goto :eof :Main set script_path=%~f1 set script_dir=%~f2 set repo_dir=%~f3 set build_dir=%repo_dir%\_build cmake --build "%build_dir%" --target test ``` Use RUN_TESTS target with Visual Studio generator
```batchfile :<<"::CMDLITERAL" @echo off goto :CMDSCRIPT ::CMDLITERAL #!/bin/bash set -euo pipefail IFS=$$'\n\t' script_dir=$$(cd $$(dirname $$0); pwd -P) repo_dir=$$(dirname $$script_dir) build_dir=$$repo_dir/_build cmake --build $$build_dir --target test exit $$? :CMDSCRIPT @echo off setlocal call :Main "%~f0" "%~dp0" "%~dp0.." goto :eof :Main set script_path=%~f1 set script_dir=%~f2 set repo_dir=%~f3 set build_dir=%repo_dir%\_build cmake --build "%build_dir%" --target RUN_TESTS ```
ce84527e-fc5d-4b06-9cb2-31c2c5549751
{ "language": "Batchfile" }
```batchfile ``` Add upgrade script for windows
```batchfile echo "Upgrading Codebrag 1.2 to 2.0" java -Dconfig.file=codebrag.conf -cp codebrag.jar com.softwaremill.codebrag.dao.sql.MigrateV1_2ToV2_0```
1ea5cc8d-57fd-4764-8a5d-991abdf8af45
{ "language": "Batchfile" }
```batchfile @echo off echo. :: If this file fails to find git.exe add it Git install :: directorys 'bin' folder path to your PATH env variable :update_vs2008_dependency_submodule echo -- Updatating git submodule path deps/vs2008 git.exe submodule init deps/vs2008 git.exe submodule init deps/vs2008 if exist "deps\vs2008\README" ( goto :remove_all_dlls_from_bin ) else ( echo ERROR: Could not find 'deps\vs2008\README', assuming git submodule init/update failed! goto :end ) :remove_all_dlls_from_bin echo -- Removing all .dll files from /bin del bin\*.dll /q echo -- Removing CMakeCache.txt to get rid of cached dependency paths del CMakeCache.txt /q goto :copy_new_dlls_to_bin :copy_new_dlls_to_bin echo -- Copying new vs2008 dependencies to /bin xcopy deps\vs2008\runtime_deps\*.* bin /S /C /Y /Q goto :end :end echo. pause``` Fix typo in submodle fetch.
```batchfile @echo off echo. :: If this file fails to find git.exe add it Git install :: directorys 'bin' folder path to your PATH env variable :update_vs2008_dependency_submodule echo -- Updatating git submodule path deps/vs2008 git.exe submodule init deps/vs2008 git.exe submodule update deps/vs2008 if exist "deps\vs2008\README" ( goto :remove_all_dlls_from_bin ) else ( echo ERROR: Could not find 'deps\vs2008\README', assuming git submodule init/update failed! goto :end ) :remove_all_dlls_from_bin echo -- Removing all .dll files from /bin del bin\*.dll /q echo -- Removing CMakeCache.txt to get rid of cached dependency paths del CMakeCache.txt /q goto :copy_new_dlls_to_bin :copy_new_dlls_to_bin echo -- Copying new vs2008 dependencies to /bin xcopy deps\vs2008\runtime_deps\*.* bin /S /C /Y /Q goto :end :end echo. pause```
30c07c62-707e-4538-b73a-6c4d1243805f
{ "language": "Batchfile" }
```batchfile @rem This file is part of C++-Builtem <http://github.com/ufal/cpp_builtem/>. @rem @rem Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of @rem Mathematics and Physics, Charles University in Prague, Czech Republic. @rem @rem This Source Code Form is subject to the terms of the Mozilla Public @rem License, v. 2.0. If a copy of the MPL was not distributed with this @rem file, You can obtain one at http://mozilla.org/MPL/2.0/. @set PATH=%~dp0tdm-gcc-4.9.2\bin;%PATH% @%~dp0mingw32-make\mingw32-make.exe %* ``` Use tdm-gcc symlink instead of tdm-gcc-4.9.2.
```batchfile @rem This file is part of C++-Builtem <http://github.com/ufal/cpp_builtem/>. @rem @rem Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of @rem Mathematics and Physics, Charles University in Prague, Czech Republic. @rem @rem This Source Code Form is subject to the terms of the Mozilla Public @rem License, v. 2.0. If a copy of the MPL was not distributed with this @rem file, You can obtain one at http://mozilla.org/MPL/2.0/. @set PATH=%~dp0tdm-gcc\bin;%PATH% @%~dp0mingw32-make\mingw32-make.exe %* ```
17c3f734-fa47-4ba5-917d-926ae5192cce
{ "language": "Batchfile" }
```batchfile ``` Add database dump script to master branch
```batchfile :: Start Emotion in Motion in Windows Machine :: Imports latest dataBase dump (mongod needs to be running) mongodump --port 27017 -d emotion-in-motion-dev --out ./mongodb-dump mongodump --port 27017 -d emotion-in-motion-test --out ./mongodb-dump mongodump --port 27017 -d emotion-in-motion-production --out ./mongodb-dump :: Start Node (not necessary in EiM terminals) :: node server.js pause ```
94f12f4f-f37b-4bce-b74c-b1b4abfe69d1
{ "language": "Batchfile" }
```batchfile @rem = '--*-Perl-*-- @echo off if "%OS%" == "Windows_NT" goto WinNT perl6 "%~dp0\%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 goto endofperl :WinNT perl6 "%~dp0\%0" %* if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl if %errorlevel% == 9009 echo You do not have Perl in your PATH. if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul goto endofperl @rem '; __END__ :endofperl ``` Make .bat file work with powershell as well as cmd
```batchfile @rem = '--*-Perl-*-- @echo off if "%OS%" == "Windows_NT" goto WinNT perl6 "%~dp0\%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 goto endofperl :WinNT perl6 "%~dp0\%~n0" %* if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl if %errorlevel% == 9009 echo You do not have Perl in your PATH. if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul goto endofperl @rem '; __END__ :endofperl ```
d21b700d-4c54-4f0d-842d-da0c1a142659
{ "language": "Batchfile" }
```batchfile @echo off setlocal enabledelayedexpansion set sourcetreepath=SourceTree\SourceTree.exe if exist "%programfiles%\Atlassian\%sourcetreepath%" ( set sourcetreepath=%programfiles%\Atlassian\%sourcetreepath% ) else if exist "%programfiles(x86)%\Atlassian\%sourcetreepath%" ( set "sourcetreepath=%programfiles(x86)%\Atlassian\%sourcetreepath%" ) else if exist "%localappdata%\%sourcetreepath%" ( set sourcetreepath=%localappdata%\%sourcetreepath% ) else ( echo [Error]: Could not find SourceTree.exe - is it installed? 1>&2 goto :eof ) set directory=%~f1 if "%directory%" == "" set directory=%CD% echo %directory% if exist "%directory%\NUL" ( set directory=%directory% ) else ( set directory=%~dp1 ) pushd %directory% for /f "delims=" %%i in ('git rev-parse --show-toplevel') do set directory=%%i git rev-parse --show-toplevel 1> nul 2> nul if %errorlevel% EQU 0 ( start "" "%sourcetreepath%" -f "%directory:/=\%" log ) popd endlocal ``` Remove needless echo; correct directory validation when space present in path
```batchfile @echo off setlocal enabledelayedexpansion set sourcetreepath=SourceTree\SourceTree.exe if exist "%programfiles%\Atlassian\%sourcetreepath%" ( set sourcetreepath=%programfiles%\Atlassian\%sourcetreepath% ) else if exist "%programfiles(x86)%\Atlassian\%sourcetreepath%" ( set "sourcetreepath=%programfiles(x86)%\Atlassian\%sourcetreepath%" ) else if exist "%localappdata%\%sourcetreepath%" ( set sourcetreepath=%localappdata%\%sourcetreepath% ) else ( echo [Error]: Could not find SourceTree.exe - is it installed? 1>&2 goto :eof ) set directory=%~f1 if "%directory%" == "" set directory=%CD% if exist "%directory%\" ( set directory=%directory% ) else ( set directory=%~dp1 ) pushd "%directory%" for /f "delims=" %%i in ('git rev-parse --show-toplevel') do set directory=%%i git rev-parse --show-toplevel 1> nul 2> nul if %errorlevel% EQU 0 ( start "" "%sourcetreepath%" -f "%directory:/=\%" ) popd endlocal ```
fa5da065-75e4-428b-a977-0cc8cd45245c
{ "language": "Batchfile" }
```batchfile del log.txt for %%i in (CalcEBNF, ComplexRightNull, EpsilonCycle, ManyAndOne, ManyAndOpt, RightNull, SimpleEpsilon, SimpleOpt, SimpleRightNull, SimpleSome, StackingConflict, TwoEpsilonsMiddle) do ( echo . >> log.txt echo %%i >> log.txt ..\..\Bin\Release\v40\YC.YaccConstructor.exe -i %%i.yrd -c ExpandMeta ^ -g "RNGLR.EBNF.DFAGenerator -pos int -token int -module RNGLR.EBNF.DFAParser%%i -translate true -table LR -o %%i.yrd.fs" >> log.txt )``` Add one more simple test
```batchfile del log.txt for %%i in (CalcEBNF, Choice, ComplexRightNull, EpsilonCycle, ManyAndOne, ManyAndOpt, RightNull, SimpleEpsilon, SimpleOpt, SimpleRightNull, SimpleSome, StackingConflict, TwoEpsilonsMiddle) do ( echo . >> log.txt echo %%i >> log.txt ..\..\Bin\Release\v40\YC.YaccConstructor.exe -i %%i.yrd -c ExpandMeta ^ -g "RNGLR.EBNF.DFAGenerator -pos int -token int -module RNGLR.EBNF.DFAParser%%i -translate true -table LR -o %%i.yrd.fs" >> log.txt )```
1c1bfb11-c9e2-4152-832c-08cace1fe455
{ "language": "Batchfile" }
```batchfile @rem Open "Visual Studio .NET Command Prompt" to run this script @setlocal @set LUA=../../luajit-2.0 @set LSCOMPILE=cl /nologo /c /LD /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /I%LUA%/src @set LSLINK=link /nologo %LSCOMPILE% /DLUA_BUILD_AS_DLL /DWIN32_VISTA_ luasys.c sock/sys_sock.c isa/isapi/isapi_dll.c @if errorlevel 1 goto :END %LSLINK% /DLL /OUT:sys.dll /DEF:isa/isapi/isapi_dll.def *.obj %LUA%/src/lua*.lib kernel32.lib user32.lib winmm.lib shell32.lib advapi32.lib ws2_32.lib @if errorlevel 1 goto :END @del *.obj *.manifest *.lib *.exp :END ``` Check Windows version is Vista+ on build.
```batchfile @rem Open "Visual Studio .NET Command Prompt" to run this script @setlocal @set LUA=../../luajit-2.0 @set LSCOMPILE=cl /nologo /c /LD /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /I%LUA%/src @set LSLINK=link /nologo @rem Check Windows Version is Vista+ @ver | findstr /i "Version 6\." > NUL @IF %ERRORLEVEL% NEQ 0 goto END_VERSION @set WIN32_VERSION=WIN32_VISTA @goto END_VERSION @set WIN32_VERSION=WIN32_COMMON :END_VERSION %LSCOMPILE% /DLUA_BUILD_AS_DLL /D%WIN32_VERSION% luasys.c sock/sys_sock.c isa/isapi/isapi_dll.c @if errorlevel 1 goto :END %LSLINK% /DLL /OUT:sys.dll /DEF:isa/isapi/isapi_dll.def *.obj %LUA%/src/lua*.lib kernel32.lib user32.lib winmm.lib shell32.lib advapi32.lib ws2_32.lib @if errorlevel 1 goto :END @del *.obj *.manifest *.lib *.exp :END ```
1660736e-124e-4a55-8d10-2da4d066f244
{ "language": "Batchfile" }
```batchfile set CONFIGURATION=%1 set OUTPUT=%2 set OPENCOVER=".\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe" set TARGET="%VSINSTALLDIR%\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" set TARGET_ARGS=".\ThScoreFileConverterTests\bin\%CONFIGURATION%\ThScoreFileConverterTests.dll" set FILTER="+[*]* -[ThScoreFileConverterTests]*" %OPENCOVER% ^ -register:user ^ -target:%TARGET% ^ -targetargs:%TARGET_ARGS% ^ -filter:%FILTER% ^ -output:%OUTPUT% ``` Fix to log the test results by AppVeyor
```batchfile set CONFIGURATION=%1 set OUTPUT=%2 set OPENCOVER=.\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe set TARGET=%VSINSTALLDIR%\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe set TARGET_ARGS=.\ThScoreFileConverterTests\bin\%CONFIGURATION%\ThScoreFileConverterTests.dll set FILTER=+[*]* -[ThScoreFileConverterTests]* if /i "%APPVEYOR%" == "true" ( set TARGET_ARGS=/logger:Appveyor %TARGET_ARGS% ) %OPENCOVER% ^ -register:user ^ -target:"%TARGET%" ^ -targetargs:"%TARGET_ARGS%" ^ -filter:"%FILTER%" ^ -output:"%OUTPUT%" ```
1b1d7641-dba7-44eb-9417-676e9ce14124
{ "language": "Batchfile" }
```batchfile ``` Add a win32 env script to run before building so paths are set correctly
```batchfile set PYTHONPATH=%cd%\inst\lib\python3.4\site-packages set DXSDK_DIR=C:\Program Files\Microsoft DirectX SDK (June 2010)\ set PATH=%cd%\inst\bin;%PATH%```
469ad2ac-6516-4362-b719-aa0f6e51b7f4
{ "language": "Batchfile" }
```batchfile SET PATH=C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;%PATH%; CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" git pull --recurse-submodules git submodule update msbuild /p:Configuration=Normal CALL gsutil cp Normal/engine/engine.exe gs://grit-engine/ CALL gsutil cp Normal/launcher/launcher.exe gs://grit-engine/ CALL gsutil cp Normal/extract/extract.exe gs://grit-engine/ CALL gsutil cp Normal/GritXMLConverter/GritXMLConverter.exe gs://grit-engine/ ``` Make batch file exit at the end
```batchfile SET PATH=C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;%PATH%; CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" git pull --recurse-submodules git submodule update msbuild /p:Configuration=Normal CALL gsutil cp Normal/engine/engine.exe gs://grit-engine/ CALL gsutil cp Normal/launcher/launcher.exe gs://grit-engine/ CALL gsutil cp Normal/extract/extract.exe gs://grit-engine/ CALL gsutil cp Normal/GritXMLConverter/GritXMLConverter.exe gs://grit-engine/ exit ```
0c8e591c-1dba-4d15-84e5-d4e06b02b60d
{ "language": "Batchfile" }
```batchfile @call "C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" SET PATH=%PROJECT_PATH%\3rdparty\bin;%MYSQL_CONNECTOR_PATH%\lib;%MYSQL_PATH%\bin;%PYTHON_PATH%\Scripts;C:\OpenSSL-v111-Win64\bin;C:\Libraries\boost_1_67_0;%PATH% cp "%MYSQL_CONNECTOR_PATH%\lib\libmysql.dll" "%PROJECT_PATH%\build\bin\" cmake -GNinja -DCMAKE_BUILD_TYPE=%CONFIGURATION% .. cmake --build . --config %CONFIGURATION% ``` Fix VS path issue on appveyor
```batchfile @call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" SET PATH=%PROJECT_PATH%\3rdparty\bin;%MYSQL_CONNECTOR_PATH%\lib;%MYSQL_PATH%\bin;%PYTHON_PATH%\Scripts;C:\OpenSSL-v111-Win64\bin;C:\Libraries\boost_1_67_0;%PATH% cp "%MYSQL_CONNECTOR_PATH%\lib\libmysql.dll" "%PROJECT_PATH%\build\bin\" cmake -GNinja -DCMAKE_BUILD_TYPE=%CONFIGURATION% .. cmake --build . --config %CONFIGURATION% ```
3cc1f507-4ab8-4cb2-81f1-be434b50d257
{ "language": "Batchfile" }
```batchfile set MAKING_PYPARSING_RELEASE=1 copy ..\sourceforge\svn\trunk\src\CHANGES . copy ..\sourceforge\svn\trunk\src\setup.py . copy ..\sourceforge\svn\trunk\src\pyparsing.py . copy ..\sourceforge\svn\trunk\src\MANIFEST.in_bdist . copy ..\sourceforge\svn\trunk\src\MANIFEST.in_src . rmdir build rmdir dist copy/y MANIFEST.in_src MANIFEST.in if exist MANIFEST del MANIFEST python setup.py sdist --formats=gztar,zip copy/y MANIFEST.in_bdist MANIFEST.in if exist MANIFEST del MANIFEST python setup.py bdist_wininst --target-version=2.6 --plat-name=win32 python setup.py bdist_wininst --target-version=2.7 --plat-name=win32 python setup.py bdist_wininst --target-version=3.0 --plat-name=win32 python setup.py bdist_wininst --target-version=3.1 --plat-name=win32 python setup.py bdist_wininst --target-version=3.2 --plat-name=win32 python setup.py bdist_wininst --target-version=3.3 --plat-name=win32 set MAKING_PYPARSING_RELEASE= ``` Remove old Py2/3 setup flag Added copying of examples from SVN source, and cleanup any pycs that might by lying around
```batchfile copy ..\sourceforge\svn\trunk\src\CHANGES . copy ..\sourceforge\svn\trunk\src\setup.py . copy ..\sourceforge\svn\trunk\src\pyparsing.py . copy ..\sourceforge\svn\trunk\src\MANIFEST.in_bdist . copy ..\sourceforge\svn\trunk\src\MANIFEST.in_src . copy ..\sourceforge\svn\trunk\src\examples\* .\examples\ del .\examples\*.pyc rmdir build rmdir dist copy/y MANIFEST.in_src MANIFEST.in if exist MANIFEST del MANIFEST python setup.py sdist --formats=gztar,zip copy/y MANIFEST.in_bdist MANIFEST.in if exist MANIFEST del MANIFEST python setup.py bdist_wininst --target-version=2.6 --plat-name=win32 python setup.py bdist_wininst --target-version=2.7 --plat-name=win32 python setup.py bdist_wininst --target-version=3.0 --plat-name=win32 python setup.py bdist_wininst --target-version=3.1 --plat-name=win32 python setup.py bdist_wininst --target-version=3.2 --plat-name=win32 python setup.py bdist_wininst --target-version=3.3 --plat-name=win32 ```
38374e24-c963-4c58-9707-9d27427b1e5b
{ "language": "Batchfile" }
```batchfile ``` Add batch file for running subset of tests on JDK 1.1
```batchfile ' Batch file for running tests on JDK 1.1 ' SET CLASSPATH=\java\junit3.8.1\junit.jar;\java\crimson-1.1.3\crimson.jar;\java\jakarta-oro-2.0.8\jakarta-oro-2.0.8.jar;..\dist\classes;classes;resources java junit.textui.TestRunner org.apache.log4j.CoreTestSuite java junit.textui.TestRunner org.apache.log4j.MinimumTestCase java junit.textui.TestRunner org.apache.log4j.LoggerTestCase java junit.textui.TestRunner org.apache.log4j.xml.DOMTestCase java junit.textui.TestRunner org.apache.log4j.xml.CustomLevelTestCase java junit.textui.TestRunner org.apache.log4j.customLogger.XLoggerTestCase del classes\log4j.xml del classes\log4j.properties java junit.textui.TestRunner org.apache.log4j.defaultInit.TestCase1 copy input\xml\defaultInit.xml classes\log4j.xml java junit.textui.TestRunner org.apache.log4j.defaultInit.TestCase2 del classes\log4j.xml copy input\xml\defaultInit.xml classes\log4j.xml java -Dlog4j.defaultInitOverride=true junit.textui.TestRunner org.apache.log4j.defaultInit.TestCase1 del classes\log4j.xml copy input\defaultInit3.properties classes\log4j.properties java junit.textui.TestRunner org.apache.log4j.defaultInit.TestCase3 del classes\log4j.properties copy input\xml\defaultInit.xml classes\log4j.xml copy input\defaultInit3.properties classes\log4j.properties java junit.textui.TestRunner org.apache.log4j.defaultInit.TestCase4 del classes\log4j.xml del classes\log4j.properties java junit.textui.TestRunner org.apache.log4j.xml.XMLLayoutTestCase java junit.textui.TestRunner org.apache.log4j.AsyncAppenderTestCase java junit.textui.TestRunner org.apache.log4j.helpers.OptionConverterTestCase java junit.textui.TestRunner org.apache.log4j.helpers.BoundedFIFOTestCase java junit.textui.TestRunner org.apache.log4j.helpers.CyclicBufferTestCase java junit.textui.TestRunner org.apache.log4j.or.ORTestCase java junit.textui.TestRunner org.apache.log4j.varia.LevelMatchFilterTestCase java junit.textui.TestRunner org.apache.log4j.helpers.PatternParserTestCase java junit.textui.TestRunner org.apache.log4j.PatternLayoutTestCase java junit.textui.TestRunner org.apache.log4j.DRFATestCase ```
807138b0-df39-4b93-9990-e82be637ba39
{ "language": "Batchfile" }
```batchfile @echo off cd src python.exe setup.py build cd .. "%PROGRAMFILES%\Inno Setup 5\ISCC.exe" pesel2pbn.iss``` Recompile UI file on build
```batchfile @echo off cd src cd pesel2pbn pyuic5 pesel2pbn.ui > pesel2pbn_auto.py cd .. python.exe setup.py build cd .. "%PROGRAMFILES%\Inno Setup 5\ISCC.exe" pesel2pbn.iss```
ce9453b7-480c-4a2b-aadf-3ed0fa1f4890
{ "language": "Batchfile" }
```batchfile set WINSCP="C:\Program Files (x86)\WinSCP\WinSCP.com" %WINSCP% /script=dosyncftp_maven.cmd REM Publish artifact to MavenCentral pushd ..\roborio\c++\navx_frc_cpp call gradlew publish popd REM Publish artifact to MavenCentral pushd ..\roborio\java\navx_frc call gradlew publish popd ECHO To Release the MavenCentral Artifacts: ECHO ECHO - Navigate to https://oss.sonatype.org/service/local/staging/deploy/maven2 and login ECHO - At bottom of list, select the checkbox next to the staged content ECHO - Click the Close button, which triggers analysis of the artifacts (takes about 1 minute) ECHO - Then, click the Release button to migrate the staged build to the Release Repository ECHO It takes about 10 minutes to be released, and about 2 hours to show up in Maven Central Search. ``` Update maven deploy script to hopefully work around some reliability issues encountered during uploads to Sonatype Nexus (Maven Central) Repository.
```batchfile set WINSCP="C:\Program Files (x86)\WinSCP\WinSCP.com" %WINSCP% /script=dosyncftp_maven.cmd REM Publish artifact to MavenCentral pushd ..\roborio\java\navx_frc call gradlew publish popd REM Publish artifact to MavenCentral pushd ..\roborio\c++\navx_frc_cpp call gradlew publish popd ECHO To Release the MavenCentral Artifacts: ECHO ECHO - Navigate to https://oss.sonatype.org/service/local/staging/deploy/maven2 and login ECHO - At bottom of list, select the checkbox next to the staged content ECHO - Click the Close button, which triggers analysis of the artifacts (takes about 1 minute) ECHO - Then, click the Release button to migrate the staged build to the Release Repository ECHO It takes about 10 minutes to be released, and about 2 hours to show up in Maven Central Search. ```
e644af4d-5647-4ef2-94d1-1165cd28ce70
{ "language": "Batchfile" }
```batchfile @echo off cls .paket\paket.bootstrapper.exe if errorlevel 1 ( exit /b %errorlevel% ) .paket\paket.exe restore if errorlevel 1 ( exit /b %errorlevel% ) packages\build\FAKE\tools\FAKE.exe build.fsx %* ``` Use prerelease paket for dogfooding
```batchfile @echo off cls .paket\paket.bootstrapper.exe prerelease if errorlevel 1 ( exit /b %errorlevel% ) .paket\paket.exe restore if errorlevel 1 ( exit /b %errorlevel% ) packages\build\FAKE\tools\FAKE.exe build.fsx %* ```
6c7bcce2-2005-45a7-a323-178408e626ab
{ "language": "Batchfile" }
```batchfile ``` Add script for fetching dependencies
```batchfile @echo off py -m pip install --upgrade pip py -m pip install -r %~dp0/requirements.txt echo. if %ERRORLEVEL% EQU 0 ( echo Installation completed successfully. echo You're good to go! Run 'run.pyw' to start the program. ) else ( echo Installation failed! echo Please make sure to read all the info in the README before running this script. echo Otherwise, email the error message above to the current maintainer. ) echo. echo Press any key to continue... pause > nul```
d10d8968-e8c7-48b4-aaf9-f464616c97a4
{ "language": "Batchfile" }
```batchfile ``` Add link generating script for Windows.
```batchfile @echo off setlocal REM --------------------------------------------------------------------------- set ROOT=%~dp0 if not exist "%USERPROFILE%" ( echo [Error] Environment variable %%USERPROFILE%% is not set. goto :CLEANUP ) REM --------------------------------------------------------------------------- pushd "%ROOT%" REM Check access priviledge if exist ".\makelinks.tmp" del ".\makelinks.tmp" (mklink ".\makelinks.tmp" "%~0" 2>&1) > NUL if not %ERRORLEVEL% == 0 ( echo Administrator priviledge needed. goto :CLEANUP ) set DOTVIM=.vim call :MAIN set DOTVIM=_vim call :MAIN :CLEANUP del ".\makelinks.tmp" > NUL popd goto :EOF REM --------------------------------------------------------------------------- :MAIN call :MAKE_SYMLINK "%USERPROFILE%\%DOTVIM%rc" "%ROOT%.vimrc" call :ENSURE_DIR "%USERPROFILE%\%DOTVIM%" call :ENSURE_DIR "%USERPROFILE%\%DOTVIM%\ftplugin" for %%I in (.vim\ftplugin\*.vim) do ( call :MAKE_SYMLINK "%USERPROFILE%\%DOTVIM%\ftplugin\%%~nxI" "%%~fI" ) exit /b 0 :MAKE_SYMLINK del /q "%~1" 2> NUL mklink "%~f1" "%~f2" > NUL echo mklink "%~f1" "%~f2" exit /b 0 :ENSURE_DIR if not exist "%~1" ( mkdir "%~1" echo mkdir "%~f1" ) exit /b 0 ```
8f6b348d-91af-43a1-8c4b-8d6d2fff5f40
{ "language": "Batchfile" }
```batchfile for %%F in ("." "bin") do ( cmake -G "%CMAKE_GENERATOR%" ^ -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^ -DCMAKE_INSTALL_DEBUG_LIBRARIES:BOOL="OFF" ^ -DCMAKE_INSTALL_DEBUG_LIBRARIES_ONLY:BOOL="OFF" ^ -DCMAKE_INSTALL_OPENMP_LIBRARIES:BOOL="ON" ^ -DCMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION:STRING=%%F ^ "%RECIPE_DIR%" if errorlevel 1 exit 1 cmake --build "%SRC_DIR%" ^ --target INSTALL ^ --config Release if errorlevel 1 exit 1 ) ``` Install Visual C++ 2008 SP1 Redistributables
```batchfile powershell -Command "(New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/d/d/9/dd9a82d0-52ef-40db-8dab-795376989c03/vcredist_x86.exe', 'vcredist_x86.exe')" if errorlevel 1 exit 1 powershell -Command "(New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/2/d/6/2d61c766-107b-409d-8fba-c39e61ca08e8/vcredist_x64.exe', 'vcredist_x64.exe')" if errorlevel 1 exit 1 vcredist_x86.exe /qb! if errorlevel 1 exit 1 vcredist_x64.exe /qb! if errorlevel 1 exit 1 for %%F in ("." "bin") do ( cmake -G "%CMAKE_GENERATOR%" ^ -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^ -DCMAKE_INSTALL_DEBUG_LIBRARIES:BOOL="OFF" ^ -DCMAKE_INSTALL_DEBUG_LIBRARIES_ONLY:BOOL="OFF" ^ -DCMAKE_INSTALL_OPENMP_LIBRARIES:BOOL="ON" ^ -DCMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION:STRING=%%F ^ "%RECIPE_DIR%" if errorlevel 1 exit 1 cmake --build "%SRC_DIR%" ^ --target INSTALL ^ --config Release if errorlevel 1 exit 1 ) ```
1ba4842c-36a4-4d66-98ee-22ddb1ef5f54
{ "language": "Batchfile" }
```batchfile ``` Add normalize wav file windows script
```batchfile REM @echo off REM "============== GET PARAMS" SET sox="C:\Program Files (x86)\sox-14-4-2\sox.exe" SET filePath=%1 SET fileNormPath=%filePath%.norm.wav SET gain=%2 echo "============== Normalizing audio: %fileNormPath%" %sox% %filePath% %fileNormPath% norm %gain% echo "============== Deleting original: %filePath%" del %filePath% echo "============== Renaming normalized file back to source: %filePath%" For %%A in ("%filePath%") do ( Set fileName=%%~nxA ) ren %fileNormPath% %fileName% echo "============== Finished normalize" ```
d3140ccb-b423-47d2-9180-9bd28fa5cdda
{ "language": "Batchfile" }
```batchfile set CONDA_PREFIX=%PREFIX% if errorlevel 1 exit 1 cmake -B build -S "%SRC_DIR%" ^ -G Ninja ^ -DCMAKE_BUILD_TYPE=Release ^ -DPython3_FIND_STRATEGY=LOCATION ^ -DPython3_ROOT_DIR=%CONDA_PREFIX% ^ -DCMAKE_LINKER=lld-link.exe ^ -DCMAKE_MODULE_LINKER_FLAGS="/FORCE:MULTIPLE" if errorlevel 1 exit 1 cmake --build build -j %CPU_COUNT% -- -v -k 0 if errorlevel 1 exit 1 if not exist "%SP_DIR%" mkdir "%SP_DIR%" if errorlevel 1 exit 1 copy build/OCP.cp*-*.* "%SP_DIR%" if errorlevel 1 exit 1``` Add /machine:x64, flag which was lost when setting /FORCE:MULTIPLE
```batchfile set CONDA_PREFIX=%PREFIX% if errorlevel 1 exit 1 cmake -B build -S "%SRC_DIR%" ^ -G Ninja ^ -DCMAKE_BUILD_TYPE=Release ^ -DPython3_FIND_STRATEGY=LOCATION ^ -DPython3_ROOT_DIR=%CONDA_PREFIX% ^ -DCMAKE_LINKER=lld-link.exe ^ -DCMAKE_MODULE_LINKER_FLAGS="/machine:x64 /FORCE:MULTIPLE" if errorlevel 1 exit 1 cmake --build build -j %CPU_COUNT% -- -v -k 0 if errorlevel 1 exit 1 if not exist "%SP_DIR%" mkdir "%SP_DIR%" if errorlevel 1 exit 1 copy build/OCP.cp*-*.* "%SP_DIR%" if errorlevel 1 exit 1```
ded80d03-8660-434b-a5dc-1e2f75880caf
{ "language": "Batchfile" }
```batchfile @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" choco install vagrant chefdk virtualbox visualstudiocode 7zip googlechrome notepadplusplus.install firefox git.install tortoisegit -y refreshenv vagrant plugin install vagrant-winrm vagrant box add mwrock/Windows2016 --provider virtualbox vagrant box add mwrock/Windows2012R2 --provider virtualbox vagrant box add jacqinthebox/windowsserver2016core --provider virtualbox code --install-extension ms-vscode.powershell code --install-extension msazurermtools.azurerm-vscode-tools code --install-extension HookyQR.beautify code --install-extension Pendrica.chef code --install-extension ms-vscode.PeterJausovec.vscode-docker code --install-extension alefragnani.project-manager code --install-extension Borke.puppet code --install-extension mauve.terraform code --install-extension bbenoist.vagrant code --list-extensions mkdir c:\github cd c:\github git clone https://github.com/iaingblack/Automation.git chef gem install kitchen-all ``` Install smaller things first, like chrome so can be used immediately
```batchfile @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" choco install googlechrome 7zip notepadplusplus.install firefox git.install tortoisegit vagrant chefdk virtualbox visualstudiocode -y refreshenv vagrant plugin install vagrant-winrm vagrant box add mwrock/Windows2016 --provider virtualbox vagrant box add mwrock/Windows2012R2 --provider virtualbox vagrant box add jacqinthebox/windowsserver2016core --provider virtualbox code --install-extension ms-vscode.powershell code --install-extension msazurermtools.azurerm-vscode-tools code --install-extension HookyQR.beautify code --install-extension Pendrica.chef code --install-extension ms-vscode.PeterJausovec.vscode-docker code --install-extension alefragnani.project-manager code --install-extension Borke.puppet code --install-extension mauve.terraform code --install-extension bbenoist.vagrant code --list-extensions mkdir c:\github cd c:\github git clone https://github.com/iaingblack/Automation.git chef gem install kitchen-all ```
720e0b95-f1da-4ee3-b421-52d465fbff4f
{ "language": "Batchfile" }
```batchfile @echo off setlocal call "%VS120COMNTOOLS%\VsDevCmd.bat" msbuild .\PSScriptAnalyzer.sln if NOT [%ERRORLEVEL%]==[0] pause endlocal``` Check for VS Build tools
```batchfile @echo off setlocal if "%VS120COMNTOOLS%"=="" GOTO NOTOOLS call "%VS120COMNTOOLS%\VsDevCmd.bat" msbuild .\PSScriptAnalyzer.sln if NOT [%ERRORLEVEL%]==[0] pause GOTO END :NOTOOLS echo The Visual Studio 2012 tools are not installed pause :END endlocal```
185afbaf-c32d-442f-8d69-81862f21774a
{ "language": "Batchfile" }
```batchfile @echo Off set config=%1 if "%config%" == "" ( set config=Release ) set version= if not "%PackageVersion%" == "" ( set version=-Version %PackageVersion% ) REM Build %WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild AW.Model.RWX.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false REM Package mkdir Build cmd /c %nuget% pack "Bloyteg.AW.Model.RWX\Bloyteg.AW.Model.RWX.fsproj" -symbols -o Build -p Configuration=%config% %version% -IncludeReferencedProjects``` Add nuget package restore step.
```batchfile @echo Off set config=%1 if "%config%" == "" ( set config=Release ) set version= if not "%PackageVersion%" == "" ( set version=-Version %PackageVersion% ) cmd /c %nuget% restore REM Build %WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild AW.Model.RWX.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false REM Package mkdir Build cmd /c %nuget% pack "Bloyteg.AW.Model.RWX\Bloyteg.AW.Model.RWX.fsproj" -symbols -o Build -p Configuration=%config% %version% -IncludeReferencedProjects```
0ff4b041-b417-48ac-95aa-42cd286ea85e
{ "language": "Batchfile" }
```batchfile @echo off @setlocal rem ------------------------------------------------------ rem Check environment variables if not "%JAVA_HOME%" == "" goto java_home_ok echo Environment variable JAVA_HOME must be set. set ERROR=true :java_home_ok if not "%DEBUG_ENABLED%" == "" goto debug_enabled_ok set DEBUG_ENABLED=false :debug_enabled_ok if not "%WEBLOGIC_HOME%" == "" goto weblogic_home_ok set WEBLOGIC_HOME=C:\bea\weblogic700\server :weblogic_home_ok if "%ERROR%" == "true" goto end rem ------------------------------------------------------ rem Run Ant for %%I in (.) do set BUILD_ROOT=%%~fI set CLASSPATH=.\lib\junit.jar set PATH=%JAVA_HOME%\bin;%PATH% set ANT_HOME=tools\ant "%ANT_HOME%\bin\ant.bat" "-Djava.home=%JAVA_HOME%" "-Dant.home=%ANT_HOME%" "-Dbuild.root=%BUILD_ROOT%" "-Ddebug.enabled=%DEBUG_ENABLED%" "-Dweblogic.home=%WEBLOGIC_HOME%" %1 %2 %3 %4 %5 %6 %7 %8 %9 :end ``` Set default target to orbeon-dist-packages
```batchfile @echo off @setlocal rem ------------------------------------------------------ rem Check environment variables if not "%JAVA_HOME%" == "" goto java_home_ok echo Environment variable JAVA_HOME must be set. set ERROR=true :java_home_ok if not "%DEBUG_ENABLED%" == "" goto debug_enabled_ok set DEBUG_ENABLED=false :debug_enabled_ok if not "%WEBLOGIC_HOME%" == "" goto weblogic_home_ok set WEBLOGIC_HOME=C:\bea\weblogic700\server :weblogic_home_ok if "%ERROR%" == "true" goto end rem ------------------------------------------------------ rem Run Ant set target=%1 set default_target=orbeon-dist-packages if not defined target ( set target=%default_target% echo Defaulting to target %default_target% ) for %%I in (.) do set BUILD_ROOT=%%~fI set CLASSPATH=.\lib\junit.jar set PATH=%JAVA_HOME%\bin;%PATH% set ANT_HOME=tools\ant "%ANT_HOME%\bin\ant.bat" "-Djava.home=%JAVA_HOME%" "-Dant.home=%ANT_HOME%" "-Dbuild.root=%BUILD_ROOT%" "-Ddebug.enabled=%DEBUG_ENABLED%" "-Dweblogic.home=%WEBLOGIC_HOME%" %target% %2 %3 %4 %5 %6 %7 %8 %9 :end ```
81986c09-3384-401a-bc3d-5bf9c29df45c
{ "language": "Batchfile" }
```batchfile nuget restore md artifacts\bin MSBuild.exe AzureSiteReplicator\AzureSiteReplicator.csproj /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="..\artifacts";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;SolutionDir="." copy "%ProgramW6432%\IIS\Microsoft Web Deploy V3\Microsoft.Web.Deployment.dll" artifacts\bin copy "%ProgramW6432%\IIS\Microsoft Web Deploy V3\Microsoft.Web.Deployment.Tracing.dll" artifacts\bin copy "%ProgramW6432%\IIS\Microsoft Web Deploy V3\Microsoft.Web.Delegation.dll" artifacts\bin nuget pack ``` Remove package analysis in nuget pack call
```batchfile nuget restore md artifacts\bin MSBuild.exe AzureSiteReplicator\AzureSiteReplicator.csproj /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="..\artifacts";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;SolutionDir="." copy "%ProgramW6432%\IIS\Microsoft Web Deploy V3\Microsoft.Web.Deployment.dll" artifacts\bin copy "%ProgramW6432%\IIS\Microsoft Web Deploy V3\Microsoft.Web.Deployment.Tracing.dll" artifacts\bin copy "%ProgramW6432%\IIS\Microsoft Web Deploy V3\Microsoft.Web.Delegation.dll" artifacts\bin nuget pack -NoPackageAnalysis ```
cde0707d-de03-4536-b444-5e7987216aaf
{ "language": "Batchfile" }
```batchfile ``` Add a script to automate HPC checking
```batchfile mkdir .hpc ghc --make -isrc -i. src\Main.hs -w -fhpc -odir .hpc -hidir .hpc -threaded -o .hpc\hlint-test del hlint-test.tix .hpc\hlint-test --help .hpc\hlint-test --test .hpc\hlint-test src --report=.hpc\report.html +RTS -N2 hpc.exe markup hlint-test.tix --destdir=.hpc hpc.exe report hlint-test.tix del hlint-test.tix start .hpc\hpc_index_fun.html ```
abb216d7-f67d-4137-b4d6-1672bc0d6c49
{ "language": "Batchfile" }
```batchfile @ECHO OFF ECHO ----------------------------------------- ECHO Welcome to the microbit-vagrants control. ECHO ----------------------------------------- ECHO 1 - Espruino ECHO 2 - MicroPython ECHO 3 - RIOT-OS Environment ECHO 4 - PXT ECHO 5 - Exit SET /P C=Type the number you want from above then press enter: IF %C%==1 GOTO ESPRUINO IF %C%==2 GOTO MICROPYTHON IF %C%==3 GOTO RIOT IF %C%==4 GOTO PXT IF %C%==5 EXIT :ESPRUINO @ECHO ON cd Espruino vagrant up :MICROPYTHON @ECHO ON cd micropython vagrant up :RIOT @ECHO ON cd RIOT vagrant up :PXT @ECHO ON cd PXT vagrant up ``` Add very simple vagrant plugin install for the autonetwork
```batchfile @ECHO ON vagrant plugin install vagrant-auto_network @ECHO OFF ECHO ----------------------------------------- ECHO Welcome to the microbit-vagrants control. ECHO ----------------------------------------- ECHO 1 - Espruino ECHO 2 - MicroPython ECHO 3 - RIOT-OS Environment ECHO 4 - PXT ECHO 5 - Exit SET /P C=Type the number you want from above then press enter: IF %C%==1 GOTO ESPRUINO IF %C%==2 GOTO MICROPYTHON IF %C%==3 GOTO RIOT IF %C%==4 GOTO PXT IF %C%==5 EXIT :ESPRUINO @ECHO ON cd Espruino vagrant up :MICROPYTHON @ECHO ON cd micropython vagrant up :RIOT @ECHO ON cd RIOT vagrant up :PXT @ECHO ON cd PXT vagrant up ```
862be8fe-16a5-4a42-87bd-dbba5fa9f2e7
{ "language": "Batchfile" }
```batchfile @ECHO OFF REM $Id$ REM Bat script to build Sundials dependency automatically REM Author: Robert Braun [email protected] setlocal set basedir=%~dp0 set name=sundials set codedir=%basedir%\%name%-code set builddir=%basedir%\%name%-build set installdir=%basedir%\%name% REM Setup paths call setHopsanBuildPaths.bat set PATH=%PATH_WITH_MSYS% REM Build mkdir %builddir% cd %builddir% sundials_cmake_args="-Wno-dev -DBUILD_STATIC_LIBS=OFF -DBUILD_ARKODE=OFF -DBUILD_IDAS=OFF -DBUILD_IDA=OFF -DBUILD_CVODE=OFF -DBUILD_CVODES=OFF -DBUILD_KINSOL=ON -DBUILD_EXAMPLES_C=OFF -DEXAMPLES_INSTALL=OFF -DCMAKE_INSTALL_LIBDIR=lib" REM Configure cmake ${sundials_cmake_args} -DCMAKE_INSTALL_PREFIX=${installdir} ${codedir} REM Build and install mingw32-make -j8 mingw32-make install REM Return to basedir cd %basedir%echo. echo setSundials.bat Done if "%HOPSAN_BUILD_SCRIPT_NOPAUSE%" == "" ( pause ) endlocal ``` Fix error in Sundials bat script
```batchfile @ECHO OFF REM $Id$ REM Bat script to build Sundials dependency automatically REM Author: Robert Braun [email protected] setlocal set basedir=%~dp0 set name=sundials set codedir=%basedir%\%name%-code set builddir=%basedir%\%name%-build set installdir=%basedir%\%name% REM Setup paths call setHopsanBuildPaths.bat set PATH=%PATH_WITH_MSYS% REM build if exist %builddir% ( echo Removing existing build directory %builddir% rmdir /S /Q %builddir% ) mkdir %builddir% cd %builddir% set sundials_cmake_args="-Wno-dev -DBUILD_STATIC_LIBS=OFF -DBUILD_ARKODE=OFF -DBUILD_IDAS=OFF -DBUILD_IDA=OFF -DBUILD_CVODE=OFF -DBUILD_CVODES=OFF -DBUILD_KINSOL=ON -DBUILD_EXAMPLES_C=OFF -DEXAMPLES_INSTALL=OFF -DCMAKE_INSTALL_LIBDIR=lib" REM Configure cmake ${sundials_cmake_args} -DCMAKE_INSTALL_PREFIX=%installdir% %codedir% cmake --build . --parallel 8 cmake --build . --target install REM Return to basedir cd %basedir% echo. echo setSundials.bat Done if "%HOPSAN_BUILD_SCRIPT_NOPAUSE%" == "" ( pause ) endlocal ```
77e4d442-e776-408c-aa11-1e5ba308e6e2
{ "language": "Batchfile" }
```batchfile ``` Debug build added for exp-env
```batchfile rem Define VISUAL_STUDIO_PATH_DEVENV env. variable in your system, example: rem SET VISUAL_STUDIO_PATH_DEVENV=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe "%VISUAL_STUDIO_PATH_DEVENV%" HeuristicSearchMax.sln /rebuild Debug rmdir /S /Q ExperimentEnv mkdir ExperimentEnv copy Grid\bin\Debug\*.exe ExperimentEnv copy Grid\bin\Debug\*.config ExperimentEnv copy Grid\bin\Debug\*.dll ExperimentEnv copy ExperimentRunner\bin\Debug\*.exe ExperimentEnv copy ExperimentRunner\bin\Debug\*.config ExperimentEnv copy ExperimentRunner\profile.txt ExperimentEnv copy LogUtils\ExperimentSummarizer\bin\Debug\*.exe ExperimentEnv copy LogUtils\DrawSolution\bin\Debug\*.exe ExperimentEnv copy FoldersExp.bat ExperimentEnv ```
8ca0481e-ba0d-4666-82a0-f2e8605c4705
{ "language": "Batchfile" }
```batchfile @echo off rem Licensed to the Apache Software Foundation (ASF) under one or more rem contributor license agreements. See the NOTICE file distributed with rem this work for additional information regarding copyright ownership. rem The ASF licenses this file to You under the Apache License, Version 2.0 rem (the "License"); you may not use this file except in compliance with rem the License. You may obtain a copy of the License at rem rem http://www.apache.org/licenses/LICENSE-2.0 rem rem Unless required by applicable law or agreed to in writing, software rem distributed under the License is distributed on an "AS IS" BASIS, rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. rem keytool -genkey -keyalg RSA -alias rmi -keystore rmi_keystore.jks -storepass changeit -validity 7 -keysize 2048 echo "Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'" ``` Set svn:eol-style for new unix and windows shell scripts
```batchfile @echo off rem Licensed to the Apache Software Foundation (ASF) under one or more rem contributor license agreements. See the NOTICE file distributed with rem this work for additional information regarding copyright ownership. rem The ASF licenses this file to You under the Apache License, Version 2.0 rem (the "License"); you may not use this file except in compliance with rem the License. You may obtain a copy of the License at rem rem http://www.apache.org/licenses/LICENSE-2.0 rem rem Unless required by applicable law or agreed to in writing, software rem distributed under the License is distributed on an "AS IS" BASIS, rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. rem keytool -genkey -keyalg RSA -alias rmi -keystore rmi_keystore.jks -storepass changeit -validity 7 -keysize 2048 echo "Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'" ```
23773ab0-a820-4ded-b5a6-23e18834fbc3
{ "language": "Batchfile" }
```batchfile ``` Add a simple script to update and build WebApp
```batchfile @echo off SET originalDir=%cd% SET baseDir=%~dp0 CD %baseDir% CD src RD build /S /Q call yarn SET NODE_ENV=%1 call gulp build CD %originalDir% ```
2c0b4058-397c-434e-864f-4bac71ec53b7
{ "language": "Batchfile" }
```batchfile echo Running Windows build and testscript %cd%/matlab/CIBuildAndTest.m call "C:\Program Files\MATLAB\R2015b\bin\matlab.exe" -wait -nodisplay -nosplash -nodesktop -r "try, run('%cd%\matlab\CIBuildAndTest.m'), catch ex, disp(['Exception during CIBuildAndTest.m: ' ex.message]), exit(1), end, exit(0);" if not "%ERRORLEVEL%" == "0" ( echo Exit Code = %ERRORLEVEL% exit /b 1 )``` Update windows CI script to point to catch file calling directory
```batchfile echo Running Windows build and testscript %cd%\matlab\CIBuildAndTest.m call "C:\Program Files\MATLAB\R2015b\bin\matlab.exe" -wait -nodisplay -nosplash -nodesktop -r "try, run('%~dp0%\matlab\CIBuildAndTest.m'), catch ex, disp(['Exception during CIBuildAndTest.m: ' ex.message]), exit(1), end, exit(0);" if not "%ERRORLEVEL%" == "0" ( echo Exit Code = %ERRORLEVEL% exit /b 1 )```
6a6d1e7c-dc4a-454a-9e6a-e7d1f063502e
{ "language": "Batchfile" }
```batchfile @echo off REM initial cleanup rd .\build\Release /s /q rd .\build\Output /s /q mkdir .\build\Release mkdir .\build\Output build\nuget.exe restore REM build solution build\msbuild.bat . /p:Configuration=Release /p:Platform=x86 REM copy web overlays robocopy .\webOverlay .\build\Release\Files\Web /E pause``` Adjust local build script to use AnyCPU builds
```batchfile @echo off REM initial cleanup rd .\build\Release /s /q rd .\build\Output /s /q mkdir .\build\Release mkdir .\build\Output build\nuget.exe restore REM build solution build\msbuild.bat . /p:Configuration=Release /p:Platform="Any CPU" REM copy web overlays robocopy .\webOverlay .\build\Release\Files\Web /E pause```
3870e075-3a50-4b31-add3-89116a70c59d
{ "language": "Batchfile" }
```batchfile :: Set $HOME to the current dir so msys runs here set HOME=%cd% :: Configure, build, test, and install using `nmake`. bash -lc "make" if errorlevel 1 exit 1 bash -lc "make DYNAMIC_ARCH=1 BINARY=$ARCH NO_LAPACK=0 NO_AFFINITY=1 USE_THREAD=1 PREFIX=$LIBRARY_PREFIX install" if errorlevel 1 exit 1 ``` Move args to `make` and run tests.
```batchfile :: Set $HOME to the current dir so msys runs here set HOME=%cd% :: Configure, build, test, and install using `make`. bash -lc "make DYNAMIC_ARCH=1 BINARY=$ARCH NO_LAPACK=0 NO_AFFINITY=1 USE_THREAD=1 PREFIX=$LIBRARY_PREFIX" if errorlevel 1 exit 1 bash -lc "make test" if errorlevel 1 exit 1 bash -lc "make PREFIX=$LIBRARY_PREFIX install" if errorlevel 1 exit 1 ```
a50f7efd-92ba-4752-a4ba-08b40bcbad24
{ "language": "Batchfile" }
```batchfile @echo Running Sonar pre-build script... @set SonarRunnerProperties=%1 @set ProjectKey=%2 @set ConfigFolder=%3 @echo Sonar runner properties location: %SonarRunnerProperties% @echo Sonar project key: %ProjectKey% @echo Sonar config location: %ConfigFolder% @echo Creating the Sonar config folder... @rmdir %ConfigFolder% /S /Q @mkdir %ConfigFolder% @echo Dumping environment variables... (TODO - REMOVE) @~dp0\DumpEnvironmentVars.exe @echo Generating Sonar FxCop file... @%~dp0\Sonar.FxCopRuleset.exe "%SonarRunnerProperties%" "%ProjectKey%" "%ConfigFolder%\SonarAnalysis.ruleset" @echo ...done. @echo Sonar pre-build steps complete. ``` Revert "Updated prebuild script to pass the Sonar project key"
```batchfile @echo Running Sonar pre-build script... @set SonarRunnerProperties=%1 @set ConfigFolder=%2 @echo Sonar runner properties location: %SonarRunnerProperties% @echo Sonar config location: %ConfigFolder% @echo Creating the Sonar config folder... @rmdir %ConfigFolder% /S /Q @mkdir %ConfigFolder% @echo Generating Sonar FxCop file... REM @%~dp0\Sonar.FxCopRuleset.exe %SonarRunnerProperties% "%ConfigFolder%\SonarAnalysis.ruleset" @echo ...done. @echo Copying a dummy ruleset for the time being... copy %~dp0\Example.ruleset %ConfigFolder%\SonarAnalysis.ruleset @echo Sonar pre-build steps complete. ```
14b09e75-c546-4da3-8de8-8ae0f8b446e0
{ "language": "Batchfile" }
```batchfile @echo off setlocal if "%1" == "--help" ( echo Usage: rbenv --version echo. echo Displays the version number of this rbenv release, including the echo current revision from git, if available. echo. echo The format of the git revision is: echo ^<version^>-^<num_commits^>-^<git_sha^> echo where `num_commits` is the number of commits since `version` was echo tagged. echo. EXIT /B ) echo rbenv 0.0.2-03 ``` Change Version number for release
```batchfile @echo off setlocal if "%1" == "--help" ( echo Usage: rbenv --version echo. echo Displays the version number of this rbenv release, including the echo current revision from git, if available. echo. echo The format of the git revision is: echo ^<version^>-^<num_commits^>-^<git_sha^> echo where `num_commits` is the number of commits since `version` was echo tagged. echo. EXIT /B ) echo rbenv 0.0.3-04 ```