@echo off

if not defined _MACHINE set _MACHINE="ultra3d"
if not defined _EXTRUDER set _EXTRUDER="left"
if not defined _MATERIAL set _MATERIAL="inland_pla"

set _INFILE=%1
set _OUTFILE=%_INFILE:.stl=_s.gcode%

shift
set params=%1
:loop
shift
if [%1]==[] goto afterloop
set params=%params% %1
goto loop
:afterloop

shiv.exe -c configs\global -c "configs\\%_MACHINE%\\%_MACHINE%" -c "configs\\%_MACHINE%\\%_EXTRUDER%" -c "configs\\%_MACHINE%\\%_MATERIAL%" -o "%_OUTFILE%" %params% "%_INFILE%"

@echo off

if not defined _MACHINE set _MACHINE=ultra3d
if not defined _EXTRUDER set _EXTRUDER=left
if not defined _MATERIAL set _MATERIAL=inland_pla

set _INFILE=%1
set _OUTFILE=%_INFILE:.stl=_s.gcode%

shift
set params=%1
:loop
shift
if [%1]==[] goto afterloop
set params=%params% %1
goto loop
:afterloop

shiv.exe -c configs\global -c configs\\%_MACHINE%\\%_MACHINE% -c configs\\%_MACHINE%\\%_EXTRUDER% -c configs\\%_MACHINE%\\%_MATERIAL% -o %_OUTFILE% %params% %_INFILE%

Fix quoting.

shiv_export.bat: Fix quoting.


echo Current build setup MSVS="%MSVS%" PLATFORM="%PLATFORM%" TARGET="%TARGET%"

if %MSVS% == 2015 call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM%
if %MSVS% == 2017 call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%
if %MSVS% == 2019 call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%

rem check compiler version
cl

git clone --depth 1 https://github.com/randombit/botan-ci-tools

set PATH=C:\Qt\Tools\QtCreator\bin;%PATH%;botan-ci-tools

echo Current build setup MSVS="%MSVS%" PLATFORM="%PLATFORM%" TARGET="%TARGET%"

if %MSVS% == 2015 call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM%
if %MSVS% == 2017 call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%
if %MSVS% == 2019 call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%

rem check compiler version
cl

git clone --depth 1 https://github.com/randombit/botan-ci-tools

rem include QtCreator bin dir to get jom
set PATH=C:\Qt\Tools\QtCreator\bin;%PATH%;botan-ci-tools

Add a comment explaining why this path is set


:: A one-shot, first-time Windows configuration script that disables some
:: Windows misfeatures and sets paths to my usual preferences. I wish this
:: script could do more, especially to disable Windows' built-in adware and
:: spyware, but following Microsoft's usual mediocrity, Windows remains a
:: toy operating system with most configuration inaccessible to scripts.

:: Annoyances
set key="HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"
reg add "%key%" /f /v AltTabSettings            /t REG_DWORD /d 1
set key="HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
reg add "%key%" /f /v TaskbarGlomLevel          /t REG_DWORD /d 2
reg add "%key%" /f /v HideFileExt               /t REG_DWORD /d 0
reg add "%key%" /f /v ShowCortanaButton         /t REG_DWORD /d 0
reg add "%key%" /f /v ShowTaskViewButton        /t REG_DWORD /d 0
reg add "%key%" /f /v StoreAppsOnTaskbar        /t REG_DWORD /d 0
reg add "%key%" /f /v MultiTaskingAltTabFilter  /t REG_DWORD /d 3
reg add "%key%" /f /v JointResize               /t REG_DWORD /d 0
reg add "%key%" /f /v SnapFill                  /t REG_DWORD /d 0
reg add "%key%" /f /v SnapAssist                /t REG_DWORD /d 0
set key="HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds"
reg add "%key%" /f /v ShellFeedsTaskbarViewMode /t REG_DWORD /d 2
set key="HKCU\Software\Microsoft\Windows\CurrentVersion\Search"
reg add "%key%" /f /v SearchboxTaskbarMode      /t REG_DWORD /d 0
set key="HKCU\Control Panel\Desktop"
reg add "%key%" /f /v CursorBlinkRate           /t REG_SZ    /d -1
set key="HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband"
reg delete "%key%" /f /v Favorites

:: Paths
setx GOBIN "%USERPROFILE%\bin"
setx GOPATH "%TEMP%\go"
setx PATH "%PATH%;%USERPROFILE%\bin;%USERPROFILE%\go\bin"

:: Reload
taskkill /f /im explorer.exe
start explorer.exe

:: A one-shot, first-time Windows configuration script that disables some
:: Windows misfeatures and sets paths to my usual preferences. I wish this
:: script could do more, especially to disable Windows' built-in adware and
:: spyware, but following Microsoft's usual mediocrity, Windows remains a
:: toy operating system with most configuration inaccessible to scripts.

:: Annoyances
set key=HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
reg add "%key%" /f /v AltTabSettings            /t REG_DWORD /d 1
set key=HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced
reg add "%key%" /f /v TaskbarGlomLevel          /t REG_DWORD /d 2
reg add "%key%" /f /v HideFileExt               /t REG_DWORD /d 0
reg add "%key%" /f /v ShowCortanaButton         /t REG_DWORD /d 0
reg add "%key%" /f /v ShowTaskViewButton        /t REG_DWORD /d 0
reg add "%key%" /f /v StoreAppsOnTaskbar        /t REG_DWORD /d 0
reg add "%key%" /f /v MultiTaskingAltTabFilter  /t REG_DWORD /d 3
reg add "%key%" /f /v JointResize               /t REG_DWORD /d 0
reg add "%key%" /f /v SnapFill                  /t REG_DWORD /d 0
reg add "%key%" /f /v SnapAssist                /t REG_DWORD /d 0
set key=HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds
reg add "%key%" /f /v ShellFeedsTaskbarViewMode /t REG_DWORD /d 2
set key=HKCU\Software\Microsoft\Windows\CurrentVersion\Search
reg add "%key%" /f /v SearchboxTaskbarMode      /t REG_DWORD /d 0
set key=HKCU\Control Panel\Desktop
reg add "%key%" /f /v CursorBlinkRate           /t REG_SZ    /d -1
set key=HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband
reg delete "%key%" /f /v Favorites

:: Paths
setx GOBIN "%USERPROFILE%\bin"
setx GOPATH "%TEMP%\go"
setx PATH "%PATH%;%USERPROFILE%\bin;%USERPROFILE%\go\bin"

:: Reload
taskkill /f /im explorer.exe
start explorer.exe

Remove quotes from keys

init.bat: Remove quotes from keys

This results in unwanted double-quoting, which breaks when keys have
spaces in them. (Putting spaces in registry keys is such a Microsoft
move, and only they'd be boneheaded enough to do it.)


# Starts a dev console to compile and run lichess.
# To edit this file, copy it to bin\dev.bat: it's not indexed by Git.

@echo off

# Yes it needs tons of memory. Go for 2048M if you have them.
set JAVA_OPTS=-Xms1536M -Xmx1536M -XX:ReservedCodeCacheSize=64m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:+ExitOnOutOfMemoryError -Dkamon.auto-start=true

sbt %*

@echo off

REM Starts a dev console to compile and run lichess.
REM To edit this file, copy it to bin\dev.bat: it's not indexed by Git.

REM Yes it needs tons of memory. Go for 2048M if you have them.
set JAVA_OPTS=-Xms1536M -Xmx1536M -XX:ReservedCodeCacheSize=64m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:+ExitOnOutOfMemoryError -Dkamon.auto-start=true

sbt %*

Fix comments on dev.default.windows.bat

Fix comments on dev.default.windows.bat

'#' doesn't actually comment something out


@set args=%*
@powershell "iex((@('')*3+(cat '%~f0'|select -skip 3))-join[char]10)"
@exit /b %ERRORLEVEL%

$args = @( ([regex]'"([^"]*)"').Replace($env:args,{
        $args[0].Groups[1] -replace " ",[char]1
    }) -split " " | ForEach-Object{ $_ -replace [char]1," " })

Set-PSDebug -strict
$VerbosePreference = "Continue"
$env:GO111MODULE="on"
Write-Verbose "$ set GO111MODULE=$env:GO111MODULE"

function Do-Copy($src,$dst){
    Write-Verbose "$ copy '$src' '$dst'"
    Copy-Item $src $dst
}

function Do-Rename($old,$new){
    Write-Verbose "$ ren $old $new"
    Rename-Item -path $old -newname $new
}

function Do-Remove($file){
    if( Test-Path $file ){
        Write-Verbose "$ del '$file'"
        Remove-Item $file
    }
}

function Make-Dir($folder){
    if( -not (Test-Path $folder) ){
        Write-Verbose "$ mkdir '$folder'"
        New-Item $folder -type directory | Out-Null
    }
}

function Ask-Copy($src,$dst){
    $fname = (Join-Path $dst (Split-Path $src -Leaf))
    if( Test-Path $fname ){
        Write-Verbose "$fname already exists. Cancel to copy"
    }else{
        Do-Copy $src $dst
    }
}

function ForEach-GoDir{
    Get-ChildItem . -Recurse |
    Where-Object{ $_.Extension -eq '.go' } |
    ForEach-Object{ Split-Path $_.FullName -Parent } |
    Sort-Object |
    Get-Unique
}

function Go-Fmt{
    $status = $true
    git status -s | %{
        $fname = $_.Substring(3)
        $arrow = $fname.IndexOf(" -> ")
        if( $arrow -ge 0 ){
            $fname = $fname.Substring($arrow+4)
        }
        if( $fname -like "*.go" -and (Test-Path($fname)) ){
            $prop = Get-ItemProperty($fname)
            if( $prop.Mode -like "?a*" ){
                Write-Verbose "$ go fmt $fname"
                go fmt $fname
                if( $LastExitCode -ne 0 ){
                    $status = $false
                }else{
                    attrib -a $fname
                }
            }
        }
    }
    if( -not $status ){
        Write-Warning "Some of 'go fmt' failed."
    }
    return $status
}

function Make-SysO($version) {
    Download-Exe "github.com/josephspurrier/goversioninfo/cmd/goversioninfo" "goversioninfo.exe"
    if( $version -match "^\d+[\._]\d+[\._]\d+[\._]\d+$" ){
        $v = $version.Split("[\._]")
    }else{
        $v = @(0,0,0,0)
        if( $version -eq $null -or $version -eq "" ){
            $version = "0.0.0_0"
        }
    }
    Write-Verbose "version=$version"

    .\goversioninfo.exe `
        "-file-version=$version" `
        "-product-version=$version" `
        "-icon=Etc\nyagos.ico" `
        ("-ver-major=" + $v[0]) `
        ("-ver-minor=" + $v[1]) `
        ("-ver-patch=" + $v[2]) `
        ("-ver-build=" + $v[3]) `
        ("-product-ver-major=" + $v[0]) `
        ("-product-ver-minor=" + $v[1]) `
        ("-product-ver-patch=" + $v[2]) `
        ("-product-ver-build=" + $v[3]) `
        "-o" nyagos.syso `
        Etc\versioninfo.json
}

function Download-Exe($url,$exename){
    if( Test-Path $exename ){
        Write-Verbose "Found $exename"
        return
    }
    Write-Verbose "$exename not found."
    $private:GO111MODULE = $env:GO111MODULE
    $env:GO111MODULE = "off"
    Write-Verbose "$ go get -d $url"
    go get -d $url
    $workdir = (Join-Path (Join-Path (go env GOPATH).Split(";")[0] "src") $url)
    $cwd = (Get-Location)
    Set-Location $workdir
    Write-Verbose "$ go build $exename on $workdir"
    go build
    Do-Copy $exename $cwd
    Set-Location $cwd
    $env:GO111MODULE = $private:GO111MODULE
}

function Build([string]$version="",[string]$tags="",[string]$target="") {
    if( $version -eq "" ){
        $version = (git describe --tags)
    }

    Write-Verbose "Build as version='$version' tags='$tags'"

    if( $tags -ne "" ){
        $tags = "-tags=$tags"
    }

    if( -not (Go-Fmt) ){
        return
    }
    $saveGOARCH = $env:GOARCH
    $env:GOARCH = (go env GOARCH)

    Make-Dir "cmd"
    $binDir = (Join-Path "cmd" $env:GOARCH)
    Make-Dir $binDir
    if ($target -eq "") {
        $target = (Join-Path $binDir "nyagos.exe")
    }

    Make-SysO $version

    Write-Verbose "$ go build -o '$target'"
    go build "-o" $target -ldflags "-s -w -X main.version=$version" $tags
    if( $LastExitCode -eq 0 ){
        Do-Copy $target (Join-Path "." ([System.IO.Path]::GetFileName($target)))
    }
    $env:GOARCH = $saveGOARCH
}

function Make-Package($arch){
    $zipname = ("nyagos-{0}.zip" -f (& "cmd\$arch\nyagos.exe" --show-version-only))
    Write-Verbose "$ zip -9 $zipname ...."
    if( Test-Path $zipname ){
        Do-Remove $zipname
    }
    zip -9j $zipname `
        "cmd\$arch\nyagos.exe" `
        .nyagos `
        _nyagos `
        makeicon.cmd `
        LICENSE `
        readme_ja.md `
        readme.md

    zip -9 $zipname `
        nyagos.d\*.lua `
        nyagos.d\catalog\*.lua `
        Doc\*.md
}

switch( $args[0] ){
    "" {
        Build
    }
    "386"{
        $private:save = $env:GOARCH
        $env:GOARCH = "386"
        Build
        $env:GOARCH = $save
    }
    "debug" {
        $private:save = $env:GOARCH
        if( $args[1] ){
            $env:GOARCH = $args[1]
        }
        Build -tags "debug"
        $env:GOARCH = $save
    }
    "vanilla" {
        Build -tags "vanilla"
    }
    "release" {
        $private:save = $env:GOARCH
        if( $args[1] ){
            $env:GOARCH = $args[1]
        }
        Build -version (Get-Content Etc\version.txt)
        $env:GOARCH = $save
    }
    "linux" {
        $private:os = $env:GOOS
        $private:arch = $env:GOARCH
        $env:GOOS="linux"
        $env:GOARCH="amd64"
        Build -target "Cmd\linux\nyagos" -version (Get-Content Etc\version.txt)
        $env:GOOS = $os
        $env:GOARCH=$arch
    }
    "clean" {
        foreach( $p in @(`
            "cmd\amd64\nyagos.exe",`
            "cmd\386\nyagos.exe",`
            "nyagos.exe",`
            "nyagos.syso",`
            "version.now",`
            "goversioninfo.exe") )
        {
            Do-Remove $p
        }
        ForEach-GoDir | %{
            Write-Verbose "$ go clean on $_"
            pushd $_
            go clean
            popd
        }
    }
    "package" {
        $private:ARCH = (go env GOARCH)
        $private:VER = (Get-Content Etc\version.txt)
        if( $args[1] -eq "linux" ){
            pushd ..
            tar -zcvf "nyagos/nyagos-$VER-linux-$ARCH.tar.gz" `
                nyagos/nyagos `
                nyagos/.nyagos `
                nyagos/_nyagos `
                nyagos/readme.md `
                nyagos/readme_ja.md `
                nyagos/nyagos.d `
                nyagos/Doc/*.md
            popd
        }else{
            Make-Package $ARCH
        }
    }
    "install" {
        $installDir = $args[1]
        if( $installDir -eq $null -or $installDir -eq "" ){
            $installDir = (
                Select-String 'INSTALLDIR=([^\)"]+)' Etc\version.cmd |
                ForEach-Object{ $_.Matches[0].Groups[1].Value }
            )
            if( -not $installDir ){
                Write-Warning "Usage: make.ps1 install INSTALLDIR"
                exit
            }
            if( -not (Test-Path $installDir) ){
                Write-Warning "$installDir not found."
                exit
            }
            Write-Verbose "installDir=$installDir"
        }
        Write-Output "@set `"INSTALLDIR=$installDir`"" |
            Out-File "Etc\version.cmd" -Encoding Default

        robocopy nyagos.d (Join-Path $installDir "nyagos.d") /E
        Write-Verbose "ERRORLEVEL=$LastExitCode"
        if( $LastExitCode -lt 8 ){
            Remove-Item Variable:LastExitCode
        }
        Ask-Copy "_nyagos" $installDir
        try{
            Do-Copy nyagos.exe $installDir
        }catch{
            $now = (Get-Date -Format "yyyyMMddHHmmss")
            try{
                $old = (Join-Path $installDir "nyagos.exe")
                Do-Rename $old ($old + "-" + $now)
                Do-Copy nyagos.exe $installDir
            }catch{
                Write-Host "Could not update installed nyagos.exe"
                Write-Host "Some processes holds nyagos.exe now"
            }
        }
    }
    "get" {
        go get -u
    }
    "fmt" {
        Go-Fmt | Out-Null
    }
    "help" {
        Write-Output @'
make                     build as snapshot
make debug   [386|amd64] build as debug version     (tagged as `debug`)
make release [386|amd64] build as release version
make clean               remove all work files
make package [386|amd64] make `nyagos-(VERSION)-(ARCH).zip`
make install [FOLDER]    copy executables to FOLDER or last folder
make fmt                 `go fmt`
make help                show this
'@
    }
    default {
        Write-Warning ("{0} not supported." -f $args[0])
    }
}
if( Test-Path Variable:LastExitCode ){
    exit $LastExitCode
}

# vim:set ft=ps1:

@set args=%*
@powershell "iex((@('')*3+(cat '%~f0'|select -skip 3))-join[char]10)"
@exit /b %ERRORLEVEL%

$args = @( ([regex]'"([^"]*)"').Replace($env:args,{
        $args[0].Groups[1] -replace " ",[char]1
    }) -split " " | ForEach-Object{ $_ -replace [char]1," " })

Set-PSDebug -strict
$VerbosePreference = "Continue"
$env:GO111MODULE="on"
Write-Verbose "$ set GO111MODULE=$env:GO111MODULE"

function Do-Copy($src,$dst){
    Write-Verbose "$ copy '$src' '$dst'"
    Copy-Item $src $dst
}

function Do-Rename($old,$new){
    Write-Verbose "$ ren $old $new"
    Rename-Item -path $old -newname $new
}

function Do-Remove($file){
    if( Test-Path $file ){
        Write-Verbose "$ del '$file'"
        Remove-Item $file
    }
}

function Make-Dir($folder){
    if( -not (Test-Path $folder) ){
        Write-Verbose "$ mkdir '$folder'"
        New-Item $folder -type directory | Out-Null
    }
}

function Ask-Copy($src,$dst){
    $fname = (Join-Path $dst (Split-Path $src -Leaf))
    if( Test-Path $fname ){
        Write-Verbose "$fname already exists. Cancel to copy"
    }else{
        Do-Copy $src $dst
    }
}

function ForEach-GoDir{
    Get-ChildItem . -Recurse |
    Where-Object{ $_.Extension -eq '.go' } |
    ForEach-Object{ Split-Path $_.FullName -Parent } |
    Sort-Object |
    Get-Unique
}

function Go-Fmt{
    $status = $true
    git status -s | %{
        $fname = $_.Substring(3)
        $arrow = $fname.IndexOf(" -> ")
        if( $arrow -ge 0 ){
            $fname = $fname.Substring($arrow+4)
        }
        if( $fname -like "*.go" -and (Test-Path($fname)) ){
            $prop = Get-ItemProperty($fname)
            if( $prop.Mode -like "?a*" ){
                Write-Verbose "$ go fmt $fname"
                go fmt $fname
                if( $LastExitCode -ne 0 ){
                    $status = $false
                }else{
                    attrib -a $fname
                }
            }
        }
    }
    if( -not $status ){
        Write-Warning "Some of 'go fmt' failed."
    }
    return $status
}

function Make-SysO($version) {
    $exepath = (Download-Exe "github.com/josephspurrier/goversioninfo/cmd/goversioninfo")
    Write-Verbose "Use $exepath"
    if( $version -match "^\d+[\._]\d+[\._]\d+[\._]\d+$" ){
        $v = $version.Split("[\._]")
    }else{
        $v = @(0,0,0,0)
        if( $version -eq $null -or $version -eq "" ){
            $version = "0.0.0_0"
        }
    }
    Write-Verbose "version=$version"

    & $exepath `
        "-file-version=$version" `
        "-product-version=$version" `
        "-icon=Etc\nyagos.ico" `
        ("-ver-major=" + $v[0]) `
        ("-ver-minor=" + $v[1]) `
        ("-ver-patch=" + $v[2]) `
        ("-ver-build=" + $v[3]) `
        ("-product-ver-major=" + $v[0]) `
        ("-product-ver-minor=" + $v[1]) `
        ("-product-ver-patch=" + $v[2]) `
        ("-product-ver-build=" + $v[3]) `
        "-o" nyagos.syso `
        Etc\versioninfo.json
}

function Download-Exe($url){
    $exename = $url.Split("/")[-1] + ".exe"
    $exepath = (Join-Path (Join-Path (go env GOPATH).Split(";")[0] "bin") $exename)

    if( Test-Path $exepath ){
        Write-Verbose "Found $exepath"
        return $exepath
    }
    Write-Verbose "$exename not found."
    $private:GO111MODULE = $env:GO111MODULE
    $env:GO111MODULE = "off"
    Write-Verbose "$ go get $url"
    go get $url
    $env:GO111MODULE = $private:GO111MODULE
    return $exepath
}

function Build([string]$version="",[string]$tags="",[string]$target="") {
    if( $version -eq "" ){
        $version = (git describe --tags)
    }

    Write-Verbose "Build as version='$version' tags='$tags'"

    if( $tags -ne "" ){
        $tags = "-tags=$tags"
    }

    if( -not (Go-Fmt) ){
        return
    }
    $saveGOARCH = $env:GOARCH
    $env:GOARCH = (go env GOARCH)

    Make-Dir "cmd"
    $binDir = (Join-Path "cmd" $env:GOARCH)
    Make-Dir $binDir
    if ($target -eq "") {
        $target = (Join-Path $binDir "nyagos.exe")
    }

    Make-SysO $version

    Write-Verbose "$ go build -o '$target'"
    go build "-o" $target -ldflags "-s -w -X main.version=$version" $tags
    if( $LastExitCode -eq 0 ){
        Do-Copy $target (Join-Path "." ([System.IO.Path]::GetFileName($target)))
    }
    $env:GOARCH = $saveGOARCH
}

function Make-Package($arch){
    $zipname = ("nyagos-{0}.zip" -f (& "cmd\$arch\nyagos.exe" --show-version-only))
    Write-Verbose "$ zip -9 $zipname ...."
    if( Test-Path $zipname ){
        Do-Remove $zipname
    }
    zip -9j $zipname `
        "cmd\$arch\nyagos.exe" `
        .nyagos `
        _nyagos `
        makeicon.cmd `
        LICENSE `
        readme_ja.md `
        readme.md

    zip -9 $zipname `
        nyagos.d\*.lua `
        nyagos.d\catalog\*.lua `
        Doc\*.md
}

switch( $args[0] ){
    "" {
        Build
    }
    "386"{
        $private:save = $env:GOARCH
        $env:GOARCH = "386"
        Build
        $env:GOARCH = $save
    }
    "debug" {
        $private:save = $env:GOARCH
        if( $args[1] ){
            $env:GOARCH = $args[1]
        }
        Build -tags "debug"
        $env:GOARCH = $save
    }
    "vanilla" {
        Build -tags "vanilla"
    }
    "release" {
        $private:save = $env:GOARCH
        if( $args[1] ){
            $env:GOARCH = $args[1]
        }
        Build -version (Get-Content Etc\version.txt)
        $env:GOARCH = $save
    }
    "linux" {
        $private:os = $env:GOOS
        $private:arch = $env:GOARCH
        $env:GOOS="linux"
        $env:GOARCH="amd64"
        Build -target "Cmd\linux\nyagos" -version (Get-Content Etc\version.txt)
        $env:GOOS = $os
        $env:GOARCH=$arch
    }
    "clean" {
        foreach( $p in @(`
            "cmd\amd64\nyagos.exe",`
            "cmd\386\nyagos.exe",`
            "nyagos.exe",`
            "nyagos.syso",`
            "version.now",`
            "goversioninfo.exe") )
        {
            Do-Remove $p
        }
        ForEach-GoDir | %{
            Write-Verbose "$ go clean on $_"
            pushd $_
            go clean
            popd
        }
    }
    "package" {
        $private:ARCH = (go env GOARCH)
        $private:VER = (Get-Content Etc\version.txt)
        if( $args[1] -eq "linux" ){
            pushd ..
            tar -zcvf "nyagos/nyagos-$VER-linux-$ARCH.tar.gz" `
                nyagos/nyagos `
                nyagos/.nyagos `
                nyagos/_nyagos `
                nyagos/readme.md `
                nyagos/readme_ja.md `
                nyagos/nyagos.d `
                nyagos/Doc/*.md
            popd
        }else{
            Make-Package $ARCH
        }
    }
    "install" {
        $installDir = $args[1]
        if( $installDir -eq $null -or $installDir -eq "" ){
            $installDir = (
                Select-String 'INSTALLDIR=([^\)"]+)' Etc\version.cmd |
                ForEach-Object{ $_.Matches[0].Groups[1].Value }
            )
            if( -not $installDir ){
                Write-Warning "Usage: make.ps1 install INSTALLDIR"
                exit
            }
            if( -not (Test-Path $installDir) ){
                Write-Warning "$installDir not found."
                exit
            }
            Write-Verbose "installDir=$installDir"
        }
        Write-Output "@set `"INSTALLDIR=$installDir`"" |
            Out-File "Etc\version.cmd" -Encoding Default

        robocopy nyagos.d (Join-Path $installDir "nyagos.d") /E
        Write-Verbose "ERRORLEVEL=$LastExitCode"
        if( $LastExitCode -lt 8 ){
            Remove-Item Variable:LastExitCode
        }
        Ask-Copy "_nyagos" $installDir
        try{
            Do-Copy nyagos.exe $installDir
        }catch{
            $now = (Get-Date -Format "yyyyMMddHHmmss")
            try{
                $old = (Join-Path $installDir "nyagos.exe")
                Do-Rename $old ($old + "-" + $now)
                Do-Copy nyagos.exe $installDir
            }catch{
                Write-Host "Could not update installed nyagos.exe"
                Write-Host "Some processes holds nyagos.exe now"
            }
        }
    }
    "get" {
        go get -u
    }
    "fmt" {
        Go-Fmt | Out-Null
    }
    "help" {
        Write-Output @'
make                     build as snapshot
make debug   [386|amd64] build as debug version     (tagged as `debug`)
make release [386|amd64] build as release version
make clean               remove all work files
make package [386|amd64] make `nyagos-(VERSION)-(ARCH).zip`
make install [FOLDER]    copy executables to FOLDER or last folder
make fmt                 `go fmt`
make help                show this
'@
    }
    default {
        Write-Warning ("{0} not supported." -f $args[0])
    }
}
if( Test-Path Variable:LastExitCode ){
    exit $LastExitCode
}

# vim:set ft=ps1:

make.cmd: install goversioninfo.exe into %GOBIN% rather than the current folder


REM Check whether the JRE is included
IF EXIST %~dp0\..\jre (

REM for BEAST version that includes JRE
    %~dp0\..\jre\bin\java -cp %~dp0\..\lib\launcher.jar beast.util.PackageManager %*

) ELSE (
REM for version that does not include JRE
    java -cp %~dp0\..\lib\launcher.jar beast.util.PackageManager %*
)

add packagemanager.bat #876

add packagemanager.bat #876


dotnet restore
dotnet pack LanguageExt.Core -c Release -o ../../artifacts/bin
dotnet pack LanguageExt.FSharp -c Release -o ../../artifacts/bin
dotnet pack LanguageExt.Parsec -c Release -o ../../artifacts/bin
dotnet pack LanguageExt.Rx -c Release -o ../../artifacts/bin

Update pack bat to build Rx

Update pack bat to build Rx


@rem Copyright 2018 gRPC authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@6 || goto :error

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

@rem Copyright 2018 gRPC authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@5 || goto :error

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

fix codecov uploading on Kokoro (#86)

build: fix codecov uploading on Kokoro (#86)


echo off
rem call vc.bat
call "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86

cls

cl  /c /Ox /DEBUG /Z7 ring.c  ^
ring_string.c ring_list.c ring_item.c ring_items.c ring_hashtable.c ring_state.c ring_scanner.c ring_parser.c ring_hashlib.c ring_vmgc.c ^
ring_stmt.c ring_expr.c ring_codegen.c ring_vm.c ring_vmexpr.c ring_vmvars.c ^
ring_vmlists.c ring_vmfuncs.c ring_api.c ring_vmoop.c ring_vmcui.c ^
ring_vmtrycatch.c ring_vmstrindex.c ring_vmjump.c ring_vmduprange.c ^
ring_vmperformance.c ring_vmexit.c ring_vmstackvars.c ring_vmstate.c ring_vmmath.c ring_vmfile.c ring_vmos.c ring_vmlistfuncs.c ring_vmrefmeta.c ^
ring_vmodbc.c ring_vmmysql.c ring_vmopenssl.c ring_vmcurl.c ring_ext.c ring_vmdll.c -I"..\include" -I"C:\curlBIN\include" -I"C:\OPENSSLBIN\include" -I"C:\Program Files\MySQL\MySQL Connector.C 6.1\include"

link /DLL /OUT:..\lib\ring.dll /SUBSYSTEM:CONSOLE,"5.01"  ring_string.obj ^
ring_list.obj ring_item.obj ring_items.obj ring_hashtable.obj ring_state.obj ring_scanner.obj ring_parser.obj ring_hashlib.obj ring_vmgc.obj ^
ring_stmt.obj ring_expr.obj ring_codegen.obj ring_vm.obj ring_vmexpr.obj ring_vmvars.obj ^
ring_vmlists.obj ring_vmfuncs.obj ring_api.obj ring_vmoop.obj ring_vmcui.obj ^
ring_vmtrycatch.obj ring_vmstrindex.obj ring_vmjump.obj ring_vmduprange.obj ^
ring_vmperformance.obj ring_vmexit.obj ring_vmstackvars.obj ring_vmstate.obj ring_vmmath.obj ring_vmfile.obj ring_vmos.obj ring_vmlistfuncs.obj ring_vmrefmeta.obj ^
ring_vmodbc.obj ring_vmmysql.obj ring_vmopenssl.obj ring_vmcurl.obj ring_ext.obj ring_vmdll.obj c:\curlbin\lib\libcurl.lib "C:\Program Files\MySQL\MySQL Connector.C 6.1\lib\libmysql.lib" c:\opensslbin\lib\libeay32.lib odbc32.lib

copy ..\lib\ring.dll ..\bin\

cl /DEBUG ring.c ..\lib\ring.lib -I"..\include"  /link /SUBSYSTEM:CONSOLE,"5.01" /OUT:..\bin\ring.exe

del *.obj

Add file buildvc.bat

Add file buildvc.bat


@echo off

:: 32-bit builds not supported as they have not been tested.
set __BuildArch=x64
set __BuildType=Debug

:Arg_Loop
if "%1" == "" goto ArgsDone
if /i "%1" == "/?" goto Usage

if /i "%1" == "Debug"    (set __BuildType=Debug&shift&goto Arg_Loop)
if /i "%1" == "Release"   (set __BuildType=Release&shift&goto Arg_Loop)

echo Invalid commandline argument: %1
goto Usage

:ArgsDone

:BuildCoreCLR
pushd coreclr
call build.cmd %__BuildArch% %__BuildType%
IF ERRORLEVEL 1 goto Error
popd

mkdir ..\Libs\%__BuildType%\%__BuildArch%\
copy bin\obj\Windows_NT.%__BuildArch%.%__BuildType%\src\jit\%__BuildType%\clrjit.lib ..\Libs\%__BuildType%\%__BuildArch%\
copy bin\obj\Windows_NT.%__BuildArch%.%__BuildType%\src\utilcode\dyncrt\%__BuildType%\utilcode.lib ..\Libs\%__BuildType%\%__BuildArch%\
copy bin\obj\Windows_NT.%__BuildArch%.%__BuildType%\src\gcinfo\%__BuildType%\gcinfo.lib ..\Libs\%__BuildType%\%__BuildArch%\

:BuildPython
cd Python\PCBuild

call get_externals.bat
IF ERRORLEVEL 1 goto Error
call .\build.bat -c %__BuildType% -p %__BuildArch__%
IF ERRORLEVEL 1 goto Error

if /i "%__BuildArch%" == "x64" set arch=amd64
set SUFFIX=
if /i "%__BuildType%" == "Debug" set SUFFIX=_d

copy %arch%\python36%SUFFIX%.lib ..\..\Libs\%__BuildType%\%__BuildArch%\

:Done
echo All built...
exit /b 0

:Error
echo something failed to build...
exit /b 1

:Usage
echo.
echo Usage:
echo %0 BuildType where:
echo.
echo BuildType can be: Debug, Release
exit /b 1

@echo off

:: 32-bit builds not supported as they have not been tested.
set __BuildArch=x64
set __BuildType=Debug

:Arg_Loop
if "%1" == "" goto ArgsDone
if /i "%1" == "/?" goto Usage

if /i "%1" == "Debug"    (set __BuildType=Debug&shift&goto Arg_Loop)
if /i "%1" == "Release"   (set __BuildType=Release&shift&goto Arg_Loop)

echo Invalid commandline argument: %1
goto Usage

:ArgsDone

:BuildCoreCLR
pushd coreclr
call build.cmd %__BuildArch% %__BuildType%
IF ERRORLEVEL 1 goto Error
popd

mkdir ..\Libs\%__BuildType%\%__BuildArch%\
copy bin\obj\Windows_NT.%__BuildArch%.%__BuildType%\src\jit\%__BuildType%\clrjit.lib ..\Libs\%__BuildType%\%__BuildArch%\
copy bin\obj\Windows_NT.%__BuildArch%.%__BuildType%\src\utilcode\dyncrt\%__BuildType%\utilcode.lib ..\Libs\%__BuildType%\%__BuildArch%\
copy bin\obj\Windows_NT.%__BuildArch%.%__BuildType%\src\gcinfo\%__BuildType%\gcinfo.lib ..\Libs\%__BuildType%\%__BuildArch%\

:BuildPython
cd Python\PCBuild

call get_externals.bat
IF ERRORLEVEL 1 goto Error
call .\build.bat -c %__BuildType% -p %__BuildArch__%
IF ERRORLEVEL 1 goto Error

if /i "%__BuildArch%" == "x64" set arch=amd64
set SUFFIX=
if /i "%__BuildType%" == "Debug" set SUFFIX=_d

copy %arch%\python36%SUFFIX%.lib ..\..\Libs\%__BuildType%\%__BuildArch%\

:Done
echo All built...
exit /b 0

:Error
echo something failed to build...
exit /b 1

:Usage
echo.
echo Usage:
echo %0 [BuildType] where:
echo.
echo BuildType can be: Debug, Release
exit /b 1

Make it more obvious that you don't have to specify the build type


@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  ============================================
rem
rem  Drop a JMX file on this batch script, and it
rem  will load it in the GUI.
rem
rem  Only the first parameter is used.
rem  Only works for Win2k.
rem
rem  ============================================

if "%OS%"=="Windows_NT" goto WinNT
echo "Sorry, this command file requires Windows NT/ 2000 / XP"
pause
goto END
:WinNT

rem Start in directory with JMX file
pushd %~dp1

rem Prepend the directory in which this script resides in case not on path

call "%~dp0"jmeter -j "%~n1.log" -t "%~nx1"

popd

:END

@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  ============================================
rem
rem  Drop a JMX file on this batch script, and it
rem  will load it in the GUI.
rem
rem  Only the first parameter is used.
rem  Only works for Win2k.
rem
rem  ============================================

if "%OS%"=="Windows_NT" goto WinNT
echo "Sorry, this command file requires Windows NT/ 2000 / XP"
pause
goto END
:WinNT

rem Check file is supplied
if a == a%1 goto winNT2
rem Check it has extension .jmx
if a%~x1 == a.jmx goto winNT3
:winNT2
echo Please supply a script name with the extension .jmx
pause
goto END
:winNT3

rem Start in directory with JMX file
pushd %~dp1

rem Prepend the directory in which this script resides in case not on path

call "%~dp0"jmeter -j "%~n1.log" -t "%~nx1"

popd

:END

Add check for jmx file extension

Add check for jmx file extension

git-svn-id: d3b254b790bfb0dc06e982e64646283fdd6e0f68@571957 13f79535-47bb-0310-9956-ffa450edef68


@echo off
:: Mock windows assembler.
cl /c %1 /Fo"%2"

@echo off
:: Mock windows assembler.
cl /MD /c %1 /Fo"%2"

Fix fake assembler on vs2012

Fix fake assembler on vs2012

(causing tests to fail currently)

TBR=bradnelson@google.com

Review URL: https://codereview.chromium.org/18500016

git-svn-id: e7e1075985beda50ea81ac4472467b4f6e91fc78@1668 78cadc50-ecff-11dd-a971-7dbc132099af


@echo off
REM Purges files from the distributables folder that have outlived
REM their usefulness.

c:\cygwin\bin\find /cygdrive/d/Distributables -daystart -maxdepth 1 -mindepth 1 -type f -mtime +7 -delete
c:\cygwin\bin\find /cygdrive/d/Distributables/APIDocs -daystart -maxdepth 1 -mindepth 1 -type d -mtime +7 -execdir c:\cygwin\bin\rm -rf "{}" ";"
c:\cygwin\bin\find /cygdrive/d/Distributables/LibCheck -daystart -maxdepth 1 -mindepth 1 -type d -mtime +7 -execdir c:\cygwin\bin\rm -rf "{}" ";"
c:\cygwin\bin\find /cygdrive/d/Distributables/GallioBook -daystart -maxdepth 1 -mindepth 1 -type d -mtime +7 -execdir c:\cygwin\bin\rm -rf "{}" ";"

exit /b 0

@echo off
REM Purges files from the distributables folder that have outlived
REM their usefulness.

c:\cygwin\bin\find /cygdrive/d/Distributables -daystart -maxdepth 1 -mindepth 1 -type f -mtime +14 -delete
c:\cygwin\bin\find /cygdrive/d/Distributables/APIDocs -daystart -maxdepth 1 -mindepth 1 -type d -mtime +14 -execdir c:\cygwin\bin\rm -rf "{}" ";"
c:\cygwin\bin\find /cygdrive/d/Distributables/LibCheck -daystart -maxdepth 1 -mindepth 1 -type d -mtime +14 -execdir c:\cygwin\bin\rm -rf "{}" ";"
c:\cygwin\bin\find /cygdrive/d/Distributables/GallioBook -daystart -maxdepth 1 -mindepth 1 -type d -mtime +14 -execdir c:\cygwin\bin\rm -rf "{}" ";"

exit /b 0

Bump max distributables age to 14 days.

Bump max distributables age to 14 days.


::  This file is included by the quickstart script file "..\..\bw.bat" so that
::  we may keep this script under version control in the svn repository.

@ECHO off
SETLOCAL

ECHO.
ECHO.
ECHO   Bedework Calendar System
ECHO   ------------------------
ECHO.

SET PRG=%0
SET saveddir=%CD%
SET QUICKSTART_HOME=%saveddir%

SET ANT_HOME=%QUICKSTART_HOME%\apache-ant-1.7.0

SET CLASSPATH="%ANT_HOME%\lib\ant-launcher.jar"
SET CLASSPATH=%CLASSPATH%;"%QUICKSTART_HOME%\bedework\build\quickstart\antlib"

:: Default some parameters
SET BWCONFIGS=
SET bwc=default
SET BWCONFIG=
SET offline=
SET quickstart=

SET ant_listener=
SET ant_xmllogfile=
SET ant_logger=

SET ant_loglevel="-quiet"
SET bw_loglevel=""

:: Projects we need to update
SET updateProjects="bwxml bedework bedework-carddav bwtzsvr cachedfeeder"

:: Projects we will build
SET pkgdefault=yes
SET bedework=
SET carddav=
SET caldav=
SET client=
SET monitor=
SET naming=
SET tzsvr=
SET webdav=

SET action=

:: check for command-line arguments and branch on them
IF "%1noargs" == "noargs" GOTO usage
GOTO branch

:quickstart
  ECHO     Preparing quickstart build ...
  SET quickstart="yes"
  SHIFT
  GOTO branch

:bwchome
  :: Define location of configs
  SHIFT
  SET BWCONFIGS=%1
  SHIFT
  GOTO branch

:bwc
  SHIFT
  SET bwc=%1
  SHIFT
  GOTO branch

:offline
  ECHO     Setting to offline mode; libraries will not be downloaded ...
  SET offline="-Dorg.bedework.offline.build=yes"
  SHIFT
  GOTO branch

:: ----------------------- Log level

:log-silent
  SET ant_loglevel="-quiet"
  SET bw_loglevel="-Dorg.bedework.build.silent=true"
  SHIFT
  GOTO branch

:log-quiet
  SET ant_loglevel="-quiet"
  SET bw_loglevel=""
  SHIFT
  GOTO branch

:log-inform
  SET ant_loglevel=""
  SET bw_loglevel="-Dorg.bedework.build.inform=true"
  SHIFT
  GOTO branch

:log-verbose
  SET ant_loglevel="-verbose"
  SET bw_loglevel="-Dorg.bedework.build.inform=true -Dorg.bedework.build.noisy=true"
  SHIFT
  GOTO branch

:ant-debug
  SET ant_loglevel="-debug"
  SHIFT
  GOTO branch

:build-debug
  SET bw_loglevel="-Dorg.bedework.build.inform=true -Dorg.bedework.build.noisy=true -Dorg.bedework.build.debug=true "
  SHIFT
  GOTO branch

:: PROJECTS

:carddav
  SET carddav="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:caldav
  SET caldav="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:client
  SET client="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:webdav
  SET webdav="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:monitor
  SET monitor="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:naming
  SET naming="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:tzsvr
  SET tzsvr="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:updateall
  for %%p in ("%updateProjects%") do (
    ECHO *************************************************************
    ECHO Updating project %%p
    ECHO *************************************************************

    svn update %%p
  )

  GOTO:EOF

:reindex
  ECHO     Calling the reindexer
  SET INDEXER=%QUICKSTART_HOME%\bedework\dist\temp\shellscr\indexer

  if exist %INDEXER% goto indexerok
    ECHO The indexer directory %INDEXER% does not exist. You probably need to do a rebuild.
    GOTO:EOF

  :indexerok
  cd %INDEXER%
  bwrun.bat reindex-nostart -user admin -indexlocprefix ..\..\..\..\..\

  GOTO:EOF

:zoneinfo
   ECHO    zoneinfo target is not supported on Windows
   GOTO:EOF

:buildwebcache
   cd %QUICKSTART_HOME%\cachedfeeder
   buildWebCache.bat
   GOTO:EOF

:deploywebcache
  cd %QUICKSTART_HOME%\cachedfeeder
  "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" deploy-webcache
   GOTO:EOF

:deployurlbuilder
  cd %QUICKSTART_HOME%\cachedfeeder
  "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" deploy-urlbuilder
   GOTO:EOF

:jbossNotice
  ECHO *************************************************************
  ECHO The jboss configuration has been removed from the quickstart.
  ECHO It is now the default.  Remove the '-bwc jboss' option.
  ECHO *************************************************************
  GOTO:EOF

:doneWithArgs

IF "%bwc%" == "jboss" GOTO jbossNotice

IF NOT "%quickstart%empty" == "empty" GOTO checkBwConfig
IF NOT "%BWCONFIGS%empty" == "empty" GOTO DoneQB
SET BWCONFIGS=%HOMEPATH%\bwbuild
GOTO doneQB

:checkBwConfig

  SET BWCONFIGS=%QUICKSTART_HOME%\bedework\config\bwbuild

:doneQB
  SET BEDEWORK_CONFIGS_HOME=%BWCONFIGS%
  SET BEDEWORK_CONFIG=%BWCONFIGS%\%bwc%

  IF EXIST "%BEDEWORK_CONFIGS_HOME%\.platform" GOTO foundDotPlatform
  ECHO *******************************************************
  ECHO Error: Configurations directory %BEDEWORK_CONFIGS_HOME%
  ECHO is missing directory '.platform'.
  ECHO *******************************************************
  GOTO:EOF
:foundDotPlatform

  IF EXIST "%BEDEWORK_CONFIG%\build.properties" GOTO foundBuildProperties
  ECHO *******************************************************
  ECHO Error: Configuration %BEDEWORK_CONFIG%
  ECHO does not exist or is not a Bedework configuration.
  ECHO *******************************************************
  GOTO:EOF
:foundBuildProperties

  IF NOT "%JAVA_HOME%empty"=="empty" GOTO javaOk
  ECHO *******************************************************
  ECHO Error: JAVA_HOME is not defined correctly for Bedework.
  ECHO *******************************************************
  GOTO:EOF
:javaOk

:runBedework
  :: Make available for ant
  SET BWCONFIG=-Dorg.bedework.user.build.properties=%BEDEWORK_CONFIG%\build.properties

  ECHO.
  ECHO     BWCONFIGS = %BWCONFIGS%
  ECHO     BWCONFIG = %BWCONFIG%

  IF NOT "%caldav%empty" == "empty"  cd %QUICKSTART_HOME%\bedework\projects\caldav
  IF NOT "%carddav%empty" == "empty" cd %QUICKSTART_HOME%\bedework-carddav
  IF NOT "%client%empty" == "empty"  cd %QUICKSTART_HOME%\bwclient
  IF NOT "%monitor%empty" == "empty" cd %QUICKSTART_HOME%\MonitorApp
  IF NOT "%naming%empty" == "empty"  cd %QUICKSTART_HOME%\bwnaming
  IF NOT "%tzsvr%empty" == "empty"   cd %QUICKSTART_HOME%\bwtzsvr
  IF NOT "%webdav%empty" == "empty"  cd %QUICKSTART_HOME%\bedework\projects\webdav

  ECHO     WORKING DIRECTORY = %cd%
  ECHO     COMMAND =  "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% %offline% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" %ant_listener% %ant_logger% %ant_loglevel% %bw_loglevel% %1
  ECHO.
  ECHO.
  "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% %offline% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" %ant_listener% %ant_logger% %ant_loglevel% %bw_loglevel% %1

  GOTO:EOF

:: Iterate over the command line arguments;
:: DOS Batch labels can't contain hyphens, so convert them
:: (otherwise, we could just "GOTO %1")
:branch
IF "%1" == "-quickstart" GOTO quickstart
IF "%1" == "-bwchome" GOTO bwchome
IF "%1" == "-bwc" GOTO bwc
IF "%1" == "-offline" GOTO offline
IF "%1" == "-updateall" GOTO updateall
IF "%1" == "-reindex" GOTO reindex
IF "%1" == "-zoneinfo" GOTO zoneinfo
IF "%1" == "-buildwebcache" GOTO buildwebcache
IF "%1" == "-deploywebcache" GOTO deploywebcache
IF "%1" == "-deployurlbuilder" GOTO deployurlbuilder

IF "%1" == "-log-silent" GOTO log-silent
IF "%1" == "-log-quiet" GOTO log-quiet
IF "%1" == "-log-inform" GOTO log-inform
IF "%1" == "-log-verbose" GOTO log-verbose
IF "%1" == "-ant-debug" GOTO ant-debug
IF "%1" == "-build-debug" GOTO build-debug

IF "%1" == "-carddav" GOTO carddav
IF "%1" == "-caldav" GOTO caldav
IF "%1" == "-client" GOTO client
IF "%1" == "-webdav" GOTO webdav
IF "%1" == "-monitor" GOTO monitor
IF "%1" == "-naming" GOTO naming
IF "%1" == "-tzsvr" GOTO tzsvr
GOTO doneWithArgs

:usage
  ECHO    Usage:
  ECHO.
  ECHO    bw ACTION
  ECHO    bw [CONFIG-SOURCE] [CONFIG] [PROJECT] [ -offline ] [ target ]
  ECHO.
  ECHO    Where:
  ECHO.
  ECHO   ACTION defines an action to take usually in the context of the quickstart.
  ECHO    In a deployed system many of these actions are handled directly by a
  ECHO    deployed application. ACTION may be one of
  ECHO      -updateall  Does an svn update of all projects"
  ECHO      -reindex    runs the indexer directly out of the quickstart bedework
  ECHO                  dist directory to rebuild the lucene indexes
REM   Don't support zoneinfo command on Windows for now
REM   ECHO      -zoneinfo - builds zoneinfo data for the timezones server
REM   ECHO                  requires -version and -tzdata parameters
  ECHO      -buildwebcache    builds webcache
  ECHO      -deploywebcache   deploys webcache
  ECHO      -deployurlbuilder deploys url/widget builder
  ECHO.
  ECHO    CONFIG-SOURCE optionally defines the location of configurations and is one or none of
  ECHO     -quickstart      to use the configurations within the quickstart
  ECHO                      e.g. "bw -quickstart start"
  ECHO     -bwchome path    to specify the location of the bwbuild directory
  ECHO.
  ECHO     The default is to look in the user home for the "bwbuild" directory.
  ECHO.
  ECHO    CONFIG optionally defines the configuration to build
  ECHO      -bwc configname      e.g. "-bwc mysql"
  ECHO.
  ECHO    -offline     Build without attempting to retrieve library jars
  ECHO    target       Ant target to execute (e.g. "start")
  ECHO.
  ECHO.
  ECHO.
  ECHO    PROJECT optionally defines the package to build and is none or more of
  ECHO     -carddav     Target is for the CardDAV build
  ECHO     -monitor     Target is for the bedework monitor application
  ECHO     -naming      Target is for the abstract naming api
  ECHO     The default is a calendar build
  ECHO.
  ECHO    Invokes ant to build or deploy the Bedework system. Uses a configuration
  ECHO    directory which contains one directory per configuration.
  ECHO.
  ECHO    Within each configuration directory we expect a file called
  ECHO    build.properties which should point to the property and options file
  ECHO    needed for the deploy process.
  ECHO.
  ECHO    In general these files will be in the same directory as build.properties.
  ECHO    The environment variable BEDEWORK_CONFIG contains the path to the current
  ECHO    configuration directory and can be used to build a path to the other files.
  ECHO.
  ECHO.
  ECHO.

::  This file is included by the quickstart script file "..\..\bw.bat" so that
::  we may keep this script under version control in the svn repository.

@ECHO off
SETLOCAL

ECHO.
ECHO.
ECHO   Bedework Calendar System
ECHO   ------------------------
ECHO.

SET PRG=%0
SET saveddir=%CD%
SET QUICKSTART_HOME=%saveddir%

SET ANT_HOME=%QUICKSTART_HOME%\apache-ant-1.7.0

SET CLASSPATH="%ANT_HOME%\lib\ant-launcher.jar"
SET CLASSPATH=%CLASSPATH%;"%QUICKSTART_HOME%\bedework\build\quickstart\antlib"

:: Default some parameters
SET BWCONFIGS=
SET bwc=default
SET BWCONFIG=
SET offline=
SET quickstart=

SET ant_listener=
SET ant_xmllogfile=
SET ant_logger=

SET ant_loglevel="-quiet"
SET bw_loglevel=""

:: Projects we need to update
SET updateProjects="bwxml bedework bedework-carddav bwtzsvr cachedfeeder"

:: Projects we will build
SET pkgdefault=yes
SET bedework=
SET bwxml=
SET carddav=
SET caldav=
SET client=
SET monitor=
SET naming=
SET tzsvr=
SET webdav=

SET action=

:: check for command-line arguments and branch on them
IF "%1noargs" == "noargs" GOTO usage
GOTO branch

:quickstart
  ECHO     Preparing quickstart build ...
  SET quickstart="yes"
  SHIFT
  GOTO branch

:bwchome
  :: Define location of configs
  SHIFT
  SET BWCONFIGS=%1
  SHIFT
  GOTO branch

:bwc
  SHIFT
  SET bwc=%1
  SHIFT
  GOTO branch

:offline
  ECHO     Setting to offline mode; libraries will not be downloaded ...
  SET offline="-Dorg.bedework.offline.build=yes"
  SHIFT
  GOTO branch

:: ----------------------- Log level

:log-silent
  SET ant_loglevel="-quiet"
  SET bw_loglevel="-Dorg.bedework.build.silent=true"
  SHIFT
  GOTO branch

:log-quiet
  SET ant_loglevel="-quiet"
  SET bw_loglevel=""
  SHIFT
  GOTO branch

:log-inform
  SET ant_loglevel=""
  SET bw_loglevel="-Dorg.bedework.build.inform=true"
  SHIFT
  GOTO branch

:log-verbose
  SET ant_loglevel="-verbose"
  SET bw_loglevel="-Dorg.bedework.build.inform=true -Dorg.bedework.build.noisy=true"
  SHIFT
  GOTO branch

:ant-debug
  SET ant_loglevel="-debug"
  SHIFT
  GOTO branch

:build-debug
  SET bw_loglevel="-Dorg.bedework.build.inform=true -Dorg.bedework.build.noisy=true -Dorg.bedework.build.debug=true "
  SHIFT
  GOTO branch

:: ----------------------- PROJECTS

:bwxml
  SET bwxml="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:carddav
  SET carddav="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:caldav
  SET caldav="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:client
  SET client="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:webdav
  SET webdav="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:monitor
  SET monitor="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:naming
  SET naming="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:tzsvr
  SET tzsvr="yes"
  SET pkgdefault=
  SHIFT
  GOTO branch

:updateall
  for %%p in ("%updateProjects%") do (
    ECHO *************************************************************
    ECHO Updating project %%p
    ECHO *************************************************************

    svn update %%p
  )

  GOTO:EOF

:reindex
  ECHO     Calling the reindexer
  SET INDEXER=%QUICKSTART_HOME%\bedework\dist\temp\shellscr\indexer

  if exist %INDEXER% goto indexerok
    ECHO The indexer directory %INDEXER% does not exist. You probably need to do a rebuild.
    GOTO:EOF

  :indexerok
  cd %INDEXER%
  bwrun.bat reindex-nostart -user admin -indexlocprefix ..\..\..\..\..\

  GOTO:EOF

:zoneinfo
   ECHO    zoneinfo target is not supported on Windows
   GOTO:EOF

:buildwebcache
   cd %QUICKSTART_HOME%\cachedfeeder
   buildWebCache.bat
   GOTO:EOF

:deploywebcache
  cd %QUICKSTART_HOME%\cachedfeeder
  "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" deploy-webcache
   GOTO:EOF

:deployurlbuilder
  cd %QUICKSTART_HOME%\cachedfeeder
  "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" deploy-urlbuilder
   GOTO:EOF

:jbossNotice
  ECHO *************************************************************
  ECHO The jboss configuration has been removed from the quickstart.
  ECHO It is now the default.  Remove the '-bwc jboss' option.
  ECHO *************************************************************
  GOTO:EOF

:doneWithArgs

IF "%bwc%" == "jboss" GOTO jbossNotice

IF NOT "%quickstart%empty" == "empty" GOTO checkBwConfig
IF NOT "%BWCONFIGS%empty" == "empty" GOTO DoneQB
SET BWCONFIGS=%HOMEPATH%\bwbuild
GOTO doneQB

:checkBwConfig

  SET BWCONFIGS=%QUICKSTART_HOME%\bedework\config\bwbuild

:doneQB
  SET BEDEWORK_CONFIGS_HOME=%BWCONFIGS%
  SET BEDEWORK_CONFIG=%BWCONFIGS%\%bwc%

  IF EXIST "%BEDEWORK_CONFIGS_HOME%\.platform" GOTO foundDotPlatform
  ECHO *******************************************************
  ECHO Error: Configurations directory %BEDEWORK_CONFIGS_HOME%
  ECHO is missing directory '.platform'.
  ECHO *******************************************************
  GOTO:EOF
:foundDotPlatform

  IF EXIST "%BEDEWORK_CONFIG%\build.properties" GOTO foundBuildProperties
  ECHO *******************************************************
  ECHO Error: Configuration %BEDEWORK_CONFIG%
  ECHO does not exist or is not a Bedework configuration.
  ECHO *******************************************************
  GOTO:EOF
:foundBuildProperties

  IF NOT "%JAVA_HOME%empty"=="empty" GOTO javaOk
  ECHO *******************************************************
  ECHO Error: JAVA_HOME is not defined correctly for Bedework.
  ECHO *******************************************************
  GOTO:EOF
:javaOk

:runBedework
  :: Make available for ant
  SET BWCONFIG=-Dorg.bedework.user.build.properties=%BEDEWORK_CONFIG%\build.properties

  ECHO.
  ECHO     BWCONFIGS = %BWCONFIGS%
  ECHO     BWCONFIG = %BWCONFIG%

  IF NOT "%bwxml%empty" == "empty"  cd %QUICKSTART_HOME%\bwxml
  IF NOT "%caldav%empty" == "empty"  cd %QUICKSTART_HOME%\bedework\projects\caldav
  IF NOT "%carddav%empty" == "empty" cd %QUICKSTART_HOME%\bedework-carddav
  IF NOT "%client%empty" == "empty"  cd %QUICKSTART_HOME%\bwclient
  IF NOT "%monitor%empty" == "empty" cd %QUICKSTART_HOME%\MonitorApp
  IF NOT "%naming%empty" == "empty"  cd %QUICKSTART_HOME%\bwnaming
  IF NOT "%tzsvr%empty" == "empty"   cd %QUICKSTART_HOME%\bwtzsvr
  IF NOT "%webdav%empty" == "empty"  cd %QUICKSTART_HOME%\bedework\projects\webdav

  ECHO     WORKING DIRECTORY = %cd%
  ECHO     COMMAND =  "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% %offline% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" %ant_listener% %ant_logger% %ant_loglevel% %bw_loglevel% %1
  ECHO.
  ECHO.
  "%JAVA_HOME%\bin\java.exe" -classpath %CLASSPATH% %offline% -Dant.home="%ANT_HOME%" org.apache.tools.ant.launch.Launcher "%BWCONFIG%" %ant_listener% %ant_logger% %ant_loglevel% %bw_loglevel% %1

  GOTO:EOF

:: Iterate over the command line arguments;
:: DOS Batch labels can't contain hyphens, so convert them
:: (otherwise, we could just "GOTO %1")
:branch
IF "%1" == "-quickstart" GOTO quickstart
IF "%1" == "-bwchome" GOTO bwchome
IF "%1" == "-bwc" GOTO bwc
IF "%1" == "-offline" GOTO offline
IF "%1" == "-updateall" GOTO updateall
IF "%1" == "-reindex" GOTO reindex
IF "%1" == "-zoneinfo" GOTO zoneinfo
IF "%1" == "-buildwebcache" GOTO buildwebcache
IF "%1" == "-deploywebcache" GOTO deploywebcache
IF "%1" == "-deployurlbuilder" GOTO deployurlbuilder

IF "%1" == "-log-silent" GOTO log-silent
IF "%1" == "-log-quiet" GOTO log-quiet
IF "%1" == "-log-inform" GOTO log-inform
IF "%1" == "-log-verbose" GOTO log-verbose
IF "%1" == "-ant-debug" GOTO ant-debug
IF "%1" == "-build-debug" GOTO build-debug

IF "%1" == "-bwxml" GOTO bwxml
IF "%1" == "-carddav" GOTO carddav
IF "%1" == "-caldav" GOTO caldav
IF "%1" == "-client" GOTO client
IF "%1" == "-webdav" GOTO webdav
IF "%1" == "-monitor" GOTO monitor
IF "%1" == "-naming" GOTO naming
IF "%1" == "-tzsvr" GOTO tzsvr
GOTO doneWithArgs

:usage
  ECHO    Usage:
  ECHO.
  ECHO    bw ACTION
  ECHO    bw [CONFIG-SOURCE] [CONFIG] [PROJECT] [ -offline ] [ target ]
  ECHO.
  ECHO    Where:
  ECHO.
  ECHO   ACTION defines an action to take usually in the context of the quickstart.
  ECHO    In a deployed system many of these actions are handled directly by a
  ECHO    deployed application. ACTION may be one of
  ECHO      -updateall  Does an svn update of all projects"
  ECHO      -reindex    runs the indexer directly out of the quickstart bedework
  ECHO                  dist directory to rebuild the lucene indexes
REM   Don't support zoneinfo command on Windows for now
REM   ECHO      -zoneinfo - builds zoneinfo data for the timezones server
REM   ECHO                  requires -version and -tzdata parameters
  ECHO      -buildwebcache    builds webcache
  ECHO      -deploywebcache   deploys webcache
  ECHO      -deployurlbuilder deploys url/widget builder
  ECHO.
  ECHO    CONFIG-SOURCE optionally defines the location of configurations and is one or none of
  ECHO     -quickstart      to use the configurations within the quickstart
  ECHO                      e.g. "bw -quickstart start"
  ECHO     -bwchome path    to specify the location of the bwbuild directory
  ECHO.
  ECHO     The default is to look in the user home for the "bwbuild" directory.
  ECHO.
  ECHO    CONFIG optionally defines the configuration to build
  ECHO      -bwc configname      e.g. "-bwc mysql"
  ECHO.
  ECHO    -offline     Build without attempting to retrieve library jars
  ECHO    target       Ant target to execute (e.g. "start")
  ECHO.
  ECHO.
  ECHO.
  ECHO    PROJECT optionally defines the package to build and is none or more of
  ECHO      -bwxml       Target is for the Bedework XML schemas build
  ECHO      -carddav     Target is for the CardDAV build
  ECHO      -exsynch     Target is for the Exchange synch build
  ECHO      -client      Target is for the bedework client application build
  ECHO      -monitor     Target is for the bedework monitor application
  ECHO      -naming      Target is for the abstract naming api
  ECHO      -tzsvr       Target is for the timezones server build
  ECHO     The default is a calendar build
  ECHO.
  ECHO    Invokes ant to build or deploy the Bedework system. Uses a configuration
  ECHO    directory which contains one directory per configuration.
  ECHO.
  ECHO    Within each configuration directory we expect a file called
  ECHO    build.properties which should point to the property and options file
  ECHO    needed for the deploy process.
  ECHO.
  ECHO    In general these files will be in the same directory as build.properties.
  ECHO    The environment variable BEDEWORK_CONFIG contains the path to the current
  ECHO    configuration directory and can be used to build a path to the other files.
  ECHO.
  ECHO.
  ECHO.

bring windows bat file up-to-date with bwxml option


@REM
@REM Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
@REM This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this distribution.  The full text of the license may be found at
@REM http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@REM

@echo off
@if /I "%1"=="-h" goto Usage
@if /I "%1"=="-help" goto Usage
@if /I "%1"=="--help" goto Usage
@if /I "%1"=="/h" goto Usage
@if /I "%1"=="/help" goto Usage
@if /I "%1"=="/?" goto Usage

set IMPORT_TOOL=%~dp0Trim.exe
if NOT exist %IMPORT_TOOL% (
  echo.
  echo !!! Trim.exe was not found. Please make sure that it is in the same directory as this script!
  echo.
  goto End
)

if '%*'=='' (
  set FILE_LIST=*.c
) else (
  set FILE_LIST=%*
)

for /r %%i in (%FILE_LIST%) do (
  echo Converting ... %%i
  %IMPORT_TOOL% -8 -o %%i %%i
)
goto End

:Usage
  echo.
  echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [files]"
  echo.
  echo         files          File list or file pattern with wildcard, like "*.c *.h",
  echo                        seperated by space. If not specified, defaul to *.c.
echo.

:End
set FILE_LIST=
set IMPORT_TOOL=

@echo on

Fix CRLF format

Fix CRLF format

Signed-off-by: Tian, Hot <hot.tian@intel.com>

git-svn-id: 3158a46dfd52e07d1fda3e32e1ab2e353a00b20f@15189 6f19259b-4bc3-4df7-8a09-765794883524


@echo off

SET BIN=..\Binaries
SET BUILD=Debug

DEL /q *.nupkg > nul 2> nul

IF not exist lib     mkdir lib     > nul 2> nul

CALL :BUILD AM.Core            core sl droid uap win81 pcl core2
CALL :BUILD ManagedIrbis       core sl droid uap win81 pcl core2
CALL :BUILD AM.Drawing         no   no no    no  no    no  no
CALL :BUILD AM.Rfid            no   no no    no  no    no  no
CALL :BUILD AM.Windows.Forms   no   no no    no  no    no  no
CALL :BUILD AM.Win32           no   no no    no  no    no  no
CALL :BUILD IrbisUI            no   no no    no  no    no  no
CALL :BUILD AM.Suggestions     no   no no    no  no    no  no
CALL :BUILD AM.AOT             core no droid uap no    pcl no
CALL :BUILD AM.Ocr             no   no no    no  no    no  no
CALL :BUILD RestfulIrbis       core no droid uap no    pcl no
CALL :BUILD IrbisInterop       no   no no    no  no    no  no
CALL :BUILD ManagedIrbis.Isis  no   no no    no  no    no  no

IF exist content (
cd content
del /s /q *.* > nul 2> nul
cd ..
rmdir content > nul 2> nul
)

GOTO :END

:BUILD
ECHO BUILD %1

cd lib

del /s /q *.*   > nul 2> nul
rmdir /s /q *.* > nul 2> nul

IF not exist net35 mkdir net35 > nul 2> nul
IF not exist net40 mkdir net40 > nul 2> nul
IF not exist net45 mkdir net45 > nul 2> nul

IF %4==droid mkdir MonoAndroid           > nul 2> nul
IF %4==no    rmdir MonoAndroid           > nul 2> nul

IF %5==uap   mkdir uap                   > nul 2> nul
IF %5==no    rmdir uap                   > nul 2> nul

IF %8==core2 mkdir netstandard2.0        > nul 2> nul
IF %8==no    rmdir netstandard2.0        > nul 2> nul

IF exist content (
cd content
del /s /q *.* > nul 2> nul
cd ..
rmdir content > nul 2> nul
)

cd ..

copy %BIN%\%BUILD%35\%1.* lib\net35\  > nul
copy %BIN%\%BUILD%40\%1.* lib\net40\  > nul
copy %BIN%\%BUILD%45\%1.* lib\net45\  > nul

RMDIR lib\net35\ru > nul 2> nul
RMDIR lib\net40\ru > nul 2> nul
RMDIR lib\net45\ru > nul 2> nul

IF EXIST %BIN%\%BUILD%35\ru\%1.resources.dll (
MKDIR lib\net35\ru > nul 2> nul
copy %BIN%\%BUILD%35\ru\%1.resources.dll lib\net35\ru > nul 2> nul
)
IF EXIST %BIN%\%BUILD%40\ru\%1.resources.dll (
MKDIR lib\net40\ru > nul 2> nul
copy %BIN%\%BUILD%40\ru\%1.resources.dll lib\net40\ru > nul 2> nul
)
IF EXIST %BIN%\%BUILD%45\ru\%1.resources.dll (
MKDIR lib\net45\ru > nul 2> nul
copy %BIN%\%BUILD%45\ru\%1.resources.dll lib\net45\ru > nul 2> nul
)

copy %BIN%\%BUILD%35\System.Threading.* lib\net35\ > nul

IF %4==droid copy %BIN%\%BUILD%Droid\%1.*                              lib\MonoAndroid           > nul
IF %5==uap   copy %BIN%\%BUILD%Universal\%1.*                          lib\uap                   > nul
IF %8==core2 copy %BIN%\%BUILD%Core2\%1.*                              lib\netstandard2.0        > nul

IF %1==AM.Rfid (
copy %BIN%\%BUILD%35\FeCom.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\FedmIscCoreVC80.dll      lib\net35 > nul
copy %BIN%\%BUILD%35\FedmIscMyAxxessVC80.dll  lib\net35 > nul
copy %BIN%\%BUILD%35\fefu.dll                 lib\net35 > nul
copy %BIN%\%BUILD%35\FeIsc.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\fetcl.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\fetcp.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\feusb.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\OBIDISC4NET.dll          lib\net35 > nul
copy %BIN%\%BUILD%35\OBIDISC4NETnative.dll    lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.dll           lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.pdb           lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.xml           lib\net35 > nul

copy %BIN%\%BUILD%40\FeCom.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\FedmIscCoreVC100.dll     lib\net40 > nul
copy %BIN%\%BUILD%40\FedmIscMyAxxessVC100.dll lib\net40 > nul
copy %BIN%\%BUILD%40\fefu.dll                 lib\net40 > nul
copy %BIN%\%BUILD%40\FeIsc.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\fetcl.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\fetcp.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\feusb.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\OBIDISC4NET.dll          lib\net40 > nul
copy %BIN%\%BUILD%40\OBIDISC4NETnative.dll    lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.dll           lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.pdb           lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.xml           lib\net40 > nul

copy %BIN%\%BUILD%45\FeCom.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\FedmIscCoreVC100.dll     lib\net45 > nul
copy %BIN%\%BUILD%45\FedmIscMyAxxessVC100.dll lib\net45 > nul
copy %BIN%\%BUILD%45\fefu.dll                 lib\net45 > nul
copy %BIN%\%BUILD%45\FeIsc.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\fetcl.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\fetcp.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\feusb.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\OBIDISC4NET.dll          lib\net45 > nul
copy %BIN%\%BUILD%45\OBIDISC4NETnative.dll    lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.dll           lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.pdb           lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.xml           lib\net45 > nul
)

IF %1==IrbisInterop (
copy ..\Source\Delphi\Irbis65\Irbis65.dll     lib\net35 > nul
copy ..\Source\Delphi\Irbis65\Irbis65.dll     lib\net40 > nul
copy ..\Source\Delphi\Irbis65\Irbis65.dll     lib\net45 > nul
)

IF %1==ManagedIrbis.Isis (
mkdir content
copy %BIN%\%BUILD%35\ISIS32.DLL               content   > nul
)

PatchNugetVersion.exe %BIN%\%BUILD%40\AM.Core.dll %1.nuspec

nuget.exe pack %1.nuspec

echo.

GOTO :END

:END

@echo off

SET BIN=..\Binaries
SET BUILD=Debug

DEL /q *.nupkg > nul 2> nul

IF not exist lib     mkdir lib     > nul 2> nul

CALL :BUILD AM.Core            core sl droid uap win81 pcl core2
CALL :BUILD ManagedIrbis       core sl droid uap win81 pcl core2
CALL :BUILD AM.Drawing         no   no no    no  no    no  no
CALL :BUILD AM.Rfid            no   no no    no  no    no  no
CALL :BUILD AM.Windows.Forms   no   no no    no  no    no  no
CALL :BUILD AM.Win32           no   no no    no  no    no  no
CALL :BUILD IrbisUI            no   no no    no  no    no  no
CALL :BUILD AM.Suggestions     no   no no    no  no    no  no
CALL :BUILD AM.AOT             core no droid uap no    pcl no
CALL :BUILD AM.Ocr             no   no no    no  no    no  no
CALL :BUILD RestfulIrbis       core no droid uap no    pcl no
CALL :BUILD IrbisInterop       no   no no    no  no    no  no
CALL :BUILD ManagedIrbis.Isis  no   no no    no  no    no  no

IF exist content (
cd content
del /s /q *.* > nul 2> nul
cd ..
rmdir content > nul 2> nul
)

GOTO :END

:BUILD
ECHO BUILD %1

cd lib

del /s /q *.*   > nul 2> nul
rmdir /s /q *.* > nul 2> nul

IF not exist net35 mkdir net35 > nul 2> nul
IF not exist net40 mkdir net40 > nul 2> nul
IF not exist net45 mkdir net45 > nul 2> nul

IF %4==droid mkdir MonoAndroid           > nul 2> nul
IF %4==no    rmdir MonoAndroid           > nul 2> nul

IF %5==uap   mkdir uap                   > nul 2> nul
IF %5==no    rmdir uap                   > nul 2> nul

IF %8==core2 mkdir netstandard2.0        > nul 2> nul
IF %8==no    rmdir netstandard2.0        > nul 2> nul

IF exist content (
cd content
del /s /q *.* > nul 2> nul
cd ..
rmdir content > nul 2> nul
)

cd ..

copy %BIN%\%BUILD%35\%1.* lib\net35\  > nul
copy %BIN%\%BUILD%40\%1.* lib\net40\  > nul
copy %BIN%\%BUILD%45\%1.* lib\net45\  > nul

RMDIR lib\net35\ru > nul 2> nul
RMDIR lib\net40\ru > nul 2> nul
RMDIR lib\net45\ru > nul 2> nul

IF EXIST %BIN%\%BUILD%35\ru\%1.resources.dll (
MKDIR lib\net35\ru > nul 2> nul
copy %BIN%\%BUILD%35\ru\%1.resources.dll lib\net35\ru > nul 2> nul
)
IF EXIST %BIN%\%BUILD%40\ru\%1.resources.dll (
MKDIR lib\net40\ru > nul 2> nul
copy %BIN%\%BUILD%40\ru\%1.resources.dll lib\net40\ru > nul 2> nul
)
IF EXIST %BIN%\%BUILD%45\ru\%1.resources.dll (
MKDIR lib\net45\ru > nul 2> nul
copy %BIN%\%BUILD%45\ru\%1.resources.dll lib\net45\ru > nul 2> nul
)

copy %BIN%\%BUILD%35\System.Threading.* lib\net35\ > nul

IF %4==droid copy %BIN%\%BUILD%Droid\%1.*                              lib\MonoAndroid           > nul
IF %5==uap   copy %BIN%\%BUILD%Universal\%1.*                          lib\uap                   > nul
IF %8==core2 copy %BIN%\%BUILD%Core2\%1.*                              lib\netstandard2.0        > nul

IF %1==ManagedIrbis (
mkdir content
del lib\net40\*.dll.config
del lib\net35\ManagedIrbis.Isis.*
del lib\net40\ManagedIrbis.Isis.*
del lib\net45\ManagedIrbis.Isis.*
)

IF %1==AM.Rfid (
copy %BIN%\%BUILD%35\FeCom.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\FedmIscCoreVC80.dll      lib\net35 > nul
copy %BIN%\%BUILD%35\FedmIscMyAxxessVC80.dll  lib\net35 > nul
copy %BIN%\%BUILD%35\fefu.dll                 lib\net35 > nul
copy %BIN%\%BUILD%35\FeIsc.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\fetcl.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\fetcp.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\feusb.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\OBIDISC4NET.dll          lib\net35 > nul
copy %BIN%\%BUILD%35\OBIDISC4NETnative.dll    lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.dll           lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.pdb           lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.xml           lib\net35 > nul

copy %BIN%\%BUILD%40\FeCom.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\FedmIscCoreVC100.dll     lib\net40 > nul
copy %BIN%\%BUILD%40\FedmIscMyAxxessVC100.dll lib\net40 > nul
copy %BIN%\%BUILD%40\fefu.dll                 lib\net40 > nul
copy %BIN%\%BUILD%40\FeIsc.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\fetcl.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\fetcp.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\feusb.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\OBIDISC4NET.dll          lib\net40 > nul
copy %BIN%\%BUILD%40\OBIDISC4NETnative.dll    lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.dll           lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.pdb           lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.xml           lib\net40 > nul

copy %BIN%\%BUILD%45\FeCom.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\FedmIscCoreVC100.dll     lib\net45 > nul
copy %BIN%\%BUILD%45\FedmIscMyAxxessVC100.dll lib\net45 > nul
copy %BIN%\%BUILD%45\fefu.dll                 lib\net45 > nul
copy %BIN%\%BUILD%45\FeIsc.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\fetcl.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\fetcp.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\feusb.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\OBIDISC4NET.dll          lib\net45 > nul
copy %BIN%\%BUILD%45\OBIDISC4NETnative.dll    lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.dll           lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.pdb           lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.xml           lib\net45 > nul
)

IF %1==IrbisInterop (
copy ..\Source\Delphi\Irbis65\Irbis65.dll     lib\net35 > nul
copy ..\Source\Delphi\Irbis65\Irbis65.dll     lib\net40 > nul
copy ..\Source\Delphi\Irbis65\Irbis65.dll     lib\net45 > nul
)

IF %1==ManagedIrbis.Isis (
mkdir content
copy %BIN%\%BUILD%35\ISIS32.DLL               content   > nul
)

PatchNugetVersion.exe %BIN%\%BUILD%40\AM.Core.dll %1.nuspec

nuget.exe pack %1.nuspec

echo.

GOTO :END

:END

Fix Nuget/packit.cmd

Fix Nuget/packit.cmd


set MAJOR_PREVIOUS=1
set MINOR_PREVIOUS=5
set PATCH_PREVIOUS=12
set PRERELEASE_PREVIOUS=-developer

set MAJOR=1
set MINOR=5
set PATCH=13
set PRERELEASE=-developer

set MAJOR_PREVIOUS=1
set MINOR_PREVIOUS=5
set PATCH_PREVIOUS=12
set PRERELEASE_PREVIOUS=-beta

set MAJOR=1
set MINOR=5
set PATCH=13
set PRERELEASE=-developer

Fix error in version file

Fix error in version file


"C:\Program Files (x86)\Java\jre7\bin\java.exe" -jar compiler.jar ^
--js=translate.js ^
--js=jquery/jquery-1.11.1.min.js ^
--js=jquery/jquery-migrate-core.js ^
--js=jquery/jquery-ui-1.10.3.min.js ^
--js=jquery/jquery.qtip.js ^
--js=jquery/jquery.blockUI.js ^
--js=jquery/jquery.color.js ^
--js=jquery/jquery.autocomplete.js ^
--js=jquery/jquery.tablesorter.js ^
--js=jquery/jquery.flot.js ^
--js=jquery/jquery.contextMenu.js ^
--js=jquery/jquery.hotkeys.js ^
--js=jquery/jsBezier-0.6-min.js ^
--js=jquery/jquery.jsPlumb-1.5.5-min.js ^
--js=jquery/jquery.placeholder.js ^
--js=dropdown.js ^
--js_output_file=thirdparty.compiled.js
@pause

"C:\Program Files (x86)\Java\jre7\bin\java.exe" -jar compiler.jar ^
--js=translate.js ^
--js=lazyload.js ^
--js=jquery/jquery-1.11.1.min.js ^
--js=jquery/jquery-migrate-core.js ^
--js=jquery/jquery-ui-1.10.3.min.js ^
--js=jquery/jquery.qtip.js ^
--js=jquery/jquery.blockUI.js ^
--js=jquery/jquery.color.js ^
--js=jquery/jquery.autocomplete.js ^
--js=jquery/jquery.tablesorter.js ^
--js=jquery/jquery.flot.js ^
--js=jquery/jquery.contextMenu.js ^
--js=jquery/jquery.hotkeys.js ^
--js=jquery/jsBezier-0.6-min.js ^
--js=jquery/jquery.jsPlumb-1.5.5-min.js ^
--js=jquery/jquery.placeholder.js ^
--js=dropdown.js ^
--js_output_file=thirdparty.compiled.js
@pause

Add lazyload to thirdparty.bat

Add lazyload to thirdparty.bat


TITLE  %cd%
py -3 -m robot.tidy --inplace -p -f robot **/**/*.robot
py -3 -m robot.tidy --inplace -p -f robot **/*.robot

add tidy script to check code before commit


@echo off

echo.
echo == Download
echo.

echo.
echo === Downloading Build Artifacts using Aria2c
echo.

build-tools\aria2\aria2c.exe -i download-list.txt --conditional-get=true --allow-overwrite=false --auto-file-renaming=false

@echo off

echo.
echo == Download
echo.

echo.
echo === Downloading Build Artifacts using Aria2c
echo.

build-tools\aria2\aria2c.exe -i build-scripts\download-list.txt --conditional-get=true --allow-overwrite=false --auto-file-renaming=false

fix path to download-list.txt

fix path to download-list.txt


@echo OFF

REM ##############################################################################
REM ##
REM ##  Continuuity Reactor start up script for WINDOWS
REM ##  Copyright 2012-2014 Continuuity,Inc. All Rights Reserved.
REM ##
REM ##############################################################################

SET ORIGPATH=%cd%
SET CONTINUUITY_HOME=%~dp0
SET CONTINUUITY_HOME=%CONTINUUITY_HOME:~0,-5%
SET JAVACMD=%JAVA_HOME%\bin\java.exe

REM %CONTINUUITY_HOME%
SET CLASSPATH=%CONTINUUITY_HOME%\lib\*;%CONTINUUITY_HOME%\conf\
SET PATH=%PATH%;%CONTINUUITY_HOME%\libexec\bin

cd %CONTINUUITY_HOME%

REM Check for 64-bit version of OS. Currently not supporting 32-bit Windows
IF NOT EXIST "%PROGRAMFILES(X86)%" (
  echo 32-bit Windows operating system is currently not supported
  GOTO :FINALLY
)

REM Check for correct setting for JAVA_HOME path
if [%JAVA_HOME%] == [] (
  echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
  echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation.
  GOTO :FINALLY
)

REM Check for Java version
setlocal ENABLEDELAYEDEXPANSION
set /a counter=0
for /f "tokens=* delims= " %%f in ('%JAVACMD% -version 2^>^&1') do @(
  if "!counter!"=="0" set line=%%f
  set /a counter+=1
)
set line=%line:java version "1.=!!%
set line=%line:~0,1%
if NOT "%line%" == "6" (
  if NOT "%line%" == "7" (
    echo ERROR: Java version not supported. Please install Java 6 or 7 - other versions of Java are not yet supported.
    GOTO :FINALLY
  )
)
endlocal

mkdir %CONTINUUITY_HOME%\logs > NUL 2>&1

%JAVACMD% -classpath %CLASSPATH% com.continuuity.data2.transaction.TransactionManagerDebuggerMain %*

@echo OFF

REM ##############################################################################
REM ##
REM ##  Continuuity Reactor start up script for WINDOWS
REM ##  Copyright 2012-2014 Continuuity,Inc. All Rights Reserved.
REM ##
REM ##############################################################################

SET ORIGPATH=%cd%
SET CONTINUUITY_HOME=%~dp0
SET CONTINUUITY_HOME=%CONTINUUITY_HOME:~0,-5%
SET JAVACMD=%JAVA_HOME%\bin\java.exe

REM %CONTINUUITY_HOME%
SET CLASSPATH=%CONTINUUITY_HOME%\lib\*;%CONTINUUITY_HOME%\conf\
SET PATH=%PATH%;%CONTINUUITY_HOME%\libexec\bin

REM Check for 64-bit version of OS. Currently not supporting 32-bit Windows
IF NOT EXIST "%PROGRAMFILES(X86)%" (
  echo 32-bit Windows operating system is currently not supported
  GOTO :FINALLY
)

REM Check for correct setting for JAVA_HOME path
if [%JAVA_HOME%] == [] (
  echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
  echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation.
  GOTO :FINALLY
)

REM Check for Java version
setlocal ENABLEDELAYEDEXPANSION
set /a counter=0
for /f "tokens=* delims= " %%f in ('%JAVACMD% -version 2^>^&1') do @(
  if "!counter!"=="0" set line=%%f
  set /a counter+=1
)
set line=%line:java version "1.=!!%
set line=%line:~0,1%
if NOT "%line%" == "6" (
  if NOT "%line%" == "7" (
    echo ERROR: Java version not supported. Please install Java 6 or 7 - other versions of Java are not yet supported.
    GOTO :FINALLY
  )
)
endlocal

mkdir %CONTINUUITY_HOME%\logs > NUL 2>&1

%JAVACMD% -classpath %CLASSPATH% com.continuuity.data2.transaction.TransactionManagerDebuggerMain %*

remove chdir from tx-debugger.bat, it is not needed


@if not defined _echo @echo off
setlocal

:SetupArgs
:: Initialize the args that will be passed to cmake
set __nativeWindowsDir=%~dp0\Windows
set __binDir=%~dp0..\..\bin
set __rootDir=%~dp0..\..
set __CMakeBinDir=""
set __IntermediatesDir=""
set __BuildArch=x64
set __TargetGroup=netcoreapp
set __appContainer=""
set __VCBuildArch=x86_amd64
set CMAKE_BUILD_TYPE=Debug
set "__LinkArgs= "
set "__LinkLibraries= "

call %__rootDir%/run.cmd build-managed -GenerateVersion -project=%__rootDir%/build.proj

:Arg_Loop
:: Since the native build requires some configuration information before msbuild is called, we have to do some manual args parsing
if [%1] == [] goto :ToolsVersion
if /i [%1] == [Release]     ( set CMAKE_BUILD_TYPE=Release&&shift&goto Arg_Loop)
if /i [%1] == [Debug]       ( set CMAKE_BUILD_TYPE=Debug&&shift&goto Arg_Loop)

if /i [%1] == [AnyCPU]      ( set __BuildArch=x64&&set __VCBuildArch=x86_amd64&&shift&goto Arg_Loop)
if /i [%1] == [x86]         ( set __BuildArch=x86&&set __VCBuildArch=x86&&shift&goto Arg_Loop)
if /i [%1] == [arm]         ( set __BuildArch=arm&&set __VCBuildArch=x86_arm&&set __SDKVersion="-DCMAKE_SYSTEM_VERSION=10.0"&&shift&goto Arg_Loop)
if /i [%1] == [x64]         ( set __BuildArch=x64&&set __VCBuildArch=x86_amd64&&shift&goto Arg_Loop)
if /i [%1] == [amd64]       ( set __BuildArch=x64&&set __VCBuildArch=x86_amd64&&shift&goto Arg_Loop)
if /i [%1] == [arm64]       ( set __BuildArch=arm64&&set __VCBuildArch=arm64&&shift&goto Arg_Loop)

if /i [%1] == [toolsetDir]  ( set "__ToolsetDir=%2"&&shift&&shift&goto Arg_Loop)
if /i [%1] == [--TargetGroup]  ( set "__TargetGroup=%2"&&shift&&shift&goto Arg_Loop)

shift
goto :Arg_Loop

:ToolsVersion
:: Default to highest Visual Studio version available
::
:: For VS2015 (and prior), only a single instance is allowed to be installed on a box
:: and VS140COMNTOOLS is set as a global environment variable by the installer. This
:: allows users to locate where the instance of VS2015 is installed.
::
:: For VS2017, multiple instances can be installed on the same box SxS and VS150COMNTOOLS
:: is no longer set as a global environment variable and is instead only set if the user
:: has launched the VS2017 Developer Command Prompt.
::
:: Following this logic, we will default to the VS2017 toolset if VS150COMNTOOLS tools is
:: set, as this indicates the user is running from the VS2017 Developer Command Prompt and
:: is already configured to use that toolset. Otherwise, we will fallback to using the VS2015
:: toolset if it is installed. Finally, we will fail the script if no supported VS instance
:: can be found.
if not defined VisualStudioVersion (
    if defined VS150COMNTOOLS (
        call "%VS150COMNTOOLS%\VsDevCmd.bat"
        goto :VS2017
    ) else if defined VS140COMNTOOLS (
        call "%VS140COMNTOOLS%\VsDevCmd.bat"
        goto :VS2015
    )
    goto :MissingVersion
)

if "%VisualStudioVersion%"=="15.0" (
    goto :VS2017
) else if "%VisualStudioVersion%"=="14.0" (
    goto :VS2015
)

:MissingVersion
:: Can't find VS 2015 or 2017
echo Error: Visual Studio 2015 or 2017 required
echo        Please see https://github.com/dotnet/corefx/tree/master/Documentation for build instructions.
exit /b 1

:VS2017
:: Setup vars for VS2017
set __VSVersion=vs2017
set __PlatformToolset=v141
if NOT "%__BuildArch%" == "arm64" (
    :: Set the environment for the native build
    call "%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build\vcvarsall.bat" %__VCBuildArch%
)
goto :SetupDirs

:VS2015
:: Setup vars for VS2015
set __VSVersion=vs2015
set __PlatformToolset=v140
if NOT "%__BuildArch%" == "arm64" (
    :: Set the environment for the native build
    call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %__VCBuildArch%
)
goto :SetupDirs

:SetupDirs
:: Setup to cmake the native components
echo Commencing build of native components
echo.

if %__CMakeBinDir% == "" (
    set "__CMakeBinDir=%__binDir%\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native"
)
if %__IntermediatesDir% == "" (
    set "__IntermediatesDir=%__binDir%\obj\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native"
)
set "__CMakeBinDir=%__CMakeBinDir:\=/%"
set "__IntermediatesDir=%__IntermediatesDir:\=/%"
set "__RuntimePath=%__binDir%\runtime\%__TargetGroup%-Windows_NT-%CMAKE_BUILD_TYPE%-%__BuildArch%\"
set "__TestSharedFrameworkPath=%__binDir%\testhost\%__TargetGroup%-Windows_NT-%CMAKE_BUILD_TYPE%-%__BuildArch%\shared\Microsoft.NETCore.App\9.9.9\"

:: Check that the intermediate directory exists so we can place our cmake build tree there
if exist "%__IntermediatesDir%" rd /s /q "%__IntermediatesDir%"
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"

if exist "%VSINSTALLDIR%DIA SDK" goto GenVSSolution
echo Error: DIA SDK is missing at "%VSINSTALLDIR%DIA SDK". ^
This is due to a bug in the Visual Studio installer. It does not install DIA SDK at "%VSINSTALLDIR%" but rather ^
at VS install location of previous version. Workaround is to copy DIA SDK folder from VS install location ^
of previous version to "%VSINSTALLDIR%" and then resume build.
:: DIA SDK not included in Express editions
echo Visual Studio Express does not include the DIA SDK. ^
You need Visual Studio 2015 or 2017 (Community is free).
echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
exit /b 1

:GenVSSolution
:: Regenerate the VS solution

if /i "%__BuildArch%" == "arm64" (
    REM arm64 builds currently use private toolset which has not been released yet
    REM TODO, remove once the toolset is open.
    call :PrivateToolSet
)

pushd "%__IntermediatesDir%"
call "%__nativeWindowsDir%\gen-buildsys-win.bat" %__nativeWindowsDir% %__VSVersion% %__BuildArch%
popd

:CheckForProj
:: Check that the project created by Cmake exists
if exist "%__IntermediatesDir%\install.vcxproj" goto BuildNativeProj
goto :Failure

:BuildNativeProj
:: Build the project created by Cmake
if "%__BuildArch%" == "arm64" (
    set __msbuildArgs=/p:UseEnv=true
) else (
    set __msbuildArgs=/p:Platform=%__BuildArch% /p:PlatformToolset="%__PlatformToolset%"
)

call %__rootDir%/run.cmd build-managed -project="%__IntermediatesDir%\install.vcxproj" -- /t:rebuild /p:Configuration=%CMAKE_BUILD_TYPE% %__msbuildArgs%
IF ERRORLEVEL 1 (
    goto :Failure
)

:: Copy to vertical runtime directory
xcopy /yqs "%__binDir%\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native\*" "%__RuntimePath%"
xcopy /yqs "%__binDir%\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native\*" "%__TestSharedFrameworkPath%"

echo Done building Native components

:BuildNativeAOT
set "__CMakeBinDir=%__binDir%\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native_aot"
set "__IntermediatesDir=%__binDir%\obj\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native_aot"
set "__CMakeBinDir=%__CMakeBinDir:\=/%"
set "__IntermediatesDir=%__IntermediatesDir:\=/%"
if exist "%__IntermediatesDir%" rd /s /q "%__IntermediatesDir%"
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"
set "__LinkArgs=%__LinkArgs% /APPCONTAINER"
set "__appContainer=true"

pushd "%__IntermediatesDir%"
call "%__nativeWindowsDir%\gen-buildsys-win.bat" %__nativeWindowsDir% %__VSVersion% %__BuildArch%
popd

if not exist "%__IntermediatesDir%\install.vcxproj" goto :Failure

call %__rootDir%/run.cmd build-managed -project="%__IntermediatesDir%\install.vcxproj" -- /t:rebuild /p:Configuration=%CMAKE_BUILD_TYPE% %__msbuildArgs%
IF ERRORLEVEL 1 (
    goto :Failure
)
echo Done building Native AOT components
exit /B 0

:Failure
:: Build failed
echo Failed to generate native component build project!
exit /b 1

:PrivateToolSet
echo %__MsgPrefix% Setting Up the usage of __ToolsetDir:%__ToolsetDir%

if /i "%__ToolsetDir%" == "" (
    echo %__MsgPrefix%Error: A toolset directory is required for the Arm64 Windows build. Use the toolsetDir argument.
    exit /b 1
)

set PATH=%__ToolsetDir%\VC_sdk\bin;%PATH%
set LIB=%__ToolsetDir%\VC_sdk\lib\arm64;%__ToolsetDir%\sdpublic\sdk\lib\arm64
set INCLUDE=^
%__ToolsetDir%\VC_sdk\inc;^
%__ToolsetDir%\sdpublic\sdk\inc;^
%__ToolsetDir%\sdpublic\shared\inc;^
%__ToolsetDir%\sdpublic\shared\inc\minwin;^
%__ToolsetDir%\sdpublic\sdk\inc\ucrt;^
%__ToolsetDir%\sdpublic\sdk\inc\minwin;^
%__ToolsetDir%\sdpublic\sdk\inc\mincore;^
%__ToolsetDir%\sdpublic\sdk\inc\abi;^
%__ToolsetDir%\sdpublic\sdk\inc\clientcore;^
%__ToolsetDir%\diasdk\include
exit /b 0

@if not defined _echo @echo off
setlocal

:SetupArgs
:: Initialize the args that will be passed to cmake
set __nativeWindowsDir=%~dp0\Windows
set __binDir=%~dp0..\..\bin
set __rootDir=%~dp0..\..
set __CMakeBinDir=""
set __IntermediatesDir=""
set __BuildArch=x64
set __TargetGroup=netcoreapp
set __appContainer=""
set __VCBuildArch=x86_amd64
set CMAKE_BUILD_TYPE=Debug
set "__LinkArgs= "
set "__LinkLibraries= "

call %__rootDir%/run.cmd build-managed -GenerateVersion -project=%__rootDir%/build.proj

:Arg_Loop
:: Since the native build requires some configuration information before msbuild is called, we have to do some manual args parsing
if [%1] == [] goto :ToolsVersion
if /i [%1] == [Release]     ( set CMAKE_BUILD_TYPE=Release&&shift&goto Arg_Loop)
if /i [%1] == [Debug]       ( set CMAKE_BUILD_TYPE=Debug&&shift&goto Arg_Loop)

if /i [%1] == [AnyCPU]      ( set __BuildArch=x64&&set __VCBuildArch=x86_amd64&&shift&goto Arg_Loop)
if /i [%1] == [x86]         ( set __BuildArch=x86&&set __VCBuildArch=x86&&shift&goto Arg_Loop)
if /i [%1] == [arm]         ( set __BuildArch=arm&&set __VCBuildArch=x86_arm&&set __SDKVersion="-DCMAKE_SYSTEM_VERSION=10.0"&&shift&goto Arg_Loop)
if /i [%1] == [x64]         ( set __BuildArch=x64&&set __VCBuildArch=x86_amd64&&shift&goto Arg_Loop)
if /i [%1] == [amd64]       ( set __BuildArch=x64&&set __VCBuildArch=x86_amd64&&shift&goto Arg_Loop)
if /i [%1] == [arm64]       ( set __BuildArch=arm64&&set __VCBuildArch=arm64&&shift&goto Arg_Loop)

if /i [%1] == [toolsetDir]  ( set "__ToolsetDir=%2"&&shift&&shift&goto Arg_Loop)
if /i [%1] == [--TargetGroup]  ( set "__TargetGroup=%2"&&shift&&shift&goto Arg_Loop)

shift
goto :Arg_Loop

:ToolsVersion
:: Default to highest Visual Studio version available
::
:: For VS2015 (and prior), only a single instance is allowed to be installed on a box
:: and VS140COMNTOOLS is set as a global environment variable by the installer. This
:: allows users to locate where the instance of VS2015 is installed.
::
:: For VS2017, multiple instances can be installed on the same box SxS and VS150COMNTOOLS
:: is no longer set as a global environment variable and is instead only set if the user
:: has launched the VS2017 Developer Command Prompt.
::
:: Following this logic, we will default to the VS2017 toolset if VS150COMNTOOLS tools is
:: set, as this indicates the user is running from the VS2017 Developer Command Prompt and
:: is already configured to use that toolset. Otherwise, we will fallback to using the VS2015
:: toolset if it is installed. Finally, we will fail the script if no supported VS instance
:: can be found.
if not defined VisualStudioVersion (
    if defined VS150COMNTOOLS (
        call "%VS150COMNTOOLS%\VsDevCmd.bat"
        goto :VS2017
    ) else if defined VS140COMNTOOLS (
        call "%VS140COMNTOOLS%\VsDevCmd.bat"
        goto :VS2015
    )
    goto :MissingVersion
)

if "%VisualStudioVersion%"=="15.0" (
    goto :VS2017
) else if "%VisualStudioVersion%"=="14.0" (
    goto :VS2015
)

:MissingVersion
:: Can't find VS 2015 or 2017
echo Error: Visual Studio 2015 or 2017 required
echo        Please see https://github.com/dotnet/corefx/tree/master/Documentation for build instructions.
exit /b 1

:VS2017
:: Setup vars for VS2017
set __VSVersion=vs2017
set __PlatformToolset=v141
if NOT "%__BuildArch%" == "arm64" (
    :: Set the environment for the native build
    call "%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build\vcvarsall.bat" %__VCBuildArch%
)
goto :SetupDirs

:VS2015
:: Setup vars for VS2015
set __VSVersion=vs2015
set __PlatformToolset=v140
if NOT "%__BuildArch%" == "arm64" (
    :: Set the environment for the native build
    call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %__VCBuildArch%
)
goto :SetupDirs

:SetupDirs
:: Setup to cmake the native components
echo Commencing build of native components
echo.

if %__CMakeBinDir% == "" (
    set "__CMakeBinDir=%__binDir%\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native"
)
if %__IntermediatesDir% == "" (
    set "__IntermediatesDir=%__binDir%\obj\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native"
)
set "__CMakeBinDir=%__CMakeBinDir:\=/%"
set "__IntermediatesDir=%__IntermediatesDir:\=/%"
set "__RuntimePath=%__binDir%\runtime\%__TargetGroup%-Windows_NT-%CMAKE_BUILD_TYPE%-%__BuildArch%\"
if "%__TargetGroup%" == "uapaot" (
    set "__TestSharedFrameworkPath=%__binDir%\testhost\ILCInputFolder\"
) else (
    if "%__TargetGroup%" == "uap" (
        set "__TestSharedFrameworkPath=%__binDir%\testhost\UAPLayout\"
    ) else (
        set "__TestSharedFrameworkPath=%__binDir%\testhost\%__TargetGroup%-Windows_NT-%CMAKE_BUILD_TYPE%-%__BuildArch%\shared\Microsoft.NETCore.App\9.9.9\"
    )
)

:: Check that the intermediate directory exists so we can place our cmake build tree there
if exist "%__IntermediatesDir%" rd /s /q "%__IntermediatesDir%"
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"

if exist "%VSINSTALLDIR%DIA SDK" goto GenVSSolution
echo Error: DIA SDK is missing at "%VSINSTALLDIR%DIA SDK". ^
This is due to a bug in the Visual Studio installer. It does not install DIA SDK at "%VSINSTALLDIR%" but rather ^
at VS install location of previous version. Workaround is to copy DIA SDK folder from VS install location ^
of previous version to "%VSINSTALLDIR%" and then resume build.
:: DIA SDK not included in Express editions
echo Visual Studio Express does not include the DIA SDK. ^
You need Visual Studio 2015 or 2017 (Community is free).
echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
exit /b 1

:GenVSSolution
:: Regenerate the VS solution

if /i "%__BuildArch%" == "arm64" (
    REM arm64 builds currently use private toolset which has not been released yet
    REM TODO, remove once the toolset is open.
    call :PrivateToolSet
)

pushd "%__IntermediatesDir%"
call "%__nativeWindowsDir%\gen-buildsys-win.bat" %__nativeWindowsDir% %__VSVersion% %__BuildArch%
popd

:CheckForProj
:: Check that the project created by Cmake exists
if exist "%__IntermediatesDir%\install.vcxproj" goto BuildNativeProj
goto :Failure

:BuildNativeProj
:: Build the project created by Cmake
if "%__BuildArch%" == "arm64" (
    set __msbuildArgs=/p:UseEnv=true
) else (
    set __msbuildArgs=/p:Platform=%__BuildArch% /p:PlatformToolset="%__PlatformToolset%"
)

call %__rootDir%/run.cmd build-managed -project="%__IntermediatesDir%\install.vcxproj" -- /t:rebuild /p:Configuration=%CMAKE_BUILD_TYPE% %__msbuildArgs%
IF ERRORLEVEL 1 (
    goto :Failure
)

:: Copy to vertical runtime directory
xcopy /yqs "%__binDir%\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native\*" "%__RuntimePath%"
xcopy /yqs "%__binDir%\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native\*" "%__TestSharedFrameworkPath%"

echo Done building Native components

:BuildNativeAOT
set "__CMakeBinDir=%__binDir%\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native_aot"
set "__IntermediatesDir=%__binDir%\obj\Windows_NT.%__BuildArch%.%CMAKE_BUILD_TYPE%\native_aot"
set "__CMakeBinDir=%__CMakeBinDir:\=/%"
set "__IntermediatesDir=%__IntermediatesDir:\=/%"
if exist "%__IntermediatesDir%" rd /s /q "%__IntermediatesDir%"
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"
set "__LinkArgs=%__LinkArgs% /APPCONTAINER"
set "__appContainer=true"

pushd "%__IntermediatesDir%"
call "%__nativeWindowsDir%\gen-buildsys-win.bat" %__nativeWindowsDir% %__VSVersion% %__BuildArch%
popd

if not exist "%__IntermediatesDir%\install.vcxproj" goto :Failure

call %__rootDir%/run.cmd build-managed -project="%__IntermediatesDir%\install.vcxproj" -- /t:rebuild /p:Configuration=%CMAKE_BUILD_TYPE% %__msbuildArgs%
IF ERRORLEVEL 1 (
    goto :Failure
)
echo Done building Native AOT components
exit /B 0

:Failure
:: Build failed
echo Failed to generate native component build project!
exit /b 1

:PrivateToolSet
echo %__MsgPrefix% Setting Up the usage of __ToolsetDir:%__ToolsetDir%

if /i "%__ToolsetDir%" == "" (
    echo %__MsgPrefix%Error: A toolset directory is required for the Arm64 Windows build. Use the toolsetDir argument.
    exit /b 1
)

set PATH=%__ToolsetDir%\VC_sdk\bin;%PATH%
set LIB=%__ToolsetDir%\VC_sdk\lib\arm64;%__ToolsetDir%\sdpublic\sdk\lib\arm64
set INCLUDE=^
%__ToolsetDir%\VC_sdk\inc;^
%__ToolsetDir%\sdpublic\sdk\inc;^
%__ToolsetDir%\sdpublic\shared\inc;^
%__ToolsetDir%\sdpublic\shared\inc\minwin;^
%__ToolsetDir%\sdpublic\sdk\inc\ucrt;^
%__ToolsetDir%\sdpublic\sdk\inc\minwin;^
%__ToolsetDir%\sdpublic\sdk\inc\mincore;^
%__ToolsetDir%\sdpublic\sdk\inc\abi;^
%__ToolsetDir%\sdpublic\sdk\inc\clientcore;^
%__ToolsetDir%\diasdk\include
exit /b 0

Fix clrcompression binplacing for tests (#17509)


set FULLBUILD=%~dp0..\bootstrap\FullBuild.exe
set PAKET=%~dp0..\bootstrap\paket.exe

set FULLBUILD=%~dp0..\refbin\fullbuild.exe
set PAKET=%~dp0..\tools\paket.exe

fix tools path

fix tools path


zip -0r samcodes-admob.zip dependencies extension ndll project haxelib.json include.xml README.md CHANGELOG.md LICENSE

Update packaging script

Update packaging script


SET DEPLOY_PATH=C:\src\ServiceStack\release\latest\ServiceStack.Redis

REM SET BUILD=Debug
SET BUILD=Release

SET PROJ_LIBS=
SET PROJ_LIBS=%PROJ_LIBS% ..\lib\ServiceStack.Interfaces.dll
SET PROJ_LIBS=%PROJ_LIBS% ..\lib\ServiceStack.Client.dll
SET PROJ_LIBS=%PROJ_LIBS% ..\lib\ServiceStack.Common.dll
SET PROJ_LIBS=%PROJ_LIBS% ..\lib\ServiceStack.Text.dll
SET PROJ_LIBS=%PROJ_LIBS% ..\lib\ServiceStack.Messaging.dll
SET PROJ_LIBS=%PROJ_LIBS% ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.Redis.dll

ILMerge.exe /ndebug /t:library /out:ServiceStack.Redis.dll %PROJ_LIBS%
COPY *.dll %DEPLOY_PATH%
COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.Redis.dll C:\src\ServiceStack\release\lib
COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.Redis.pdb C:\src\ServiceStack\release\lib

SET DEPLOY_PATH=C:\src\ServiceStack\release\latest\ServiceStack.Redis

REM SET BUILD=Debug
SET BUILD=Release

SET PROJ_LIBS=
SET PROJ_LIBS=%PROJ_LIBS% ..\lib\ServiceStack.Interfaces.dll
SET PROJ_LIBS=%PROJ_LIBS% ..\lib\ServiceStack.Client.dll
SET PROJ_LIBS=%PROJ_LIBS% ..\lib\ServiceStack.Common.dll
SET PROJ_LIBS=%PROJ_LIBS% ..\lib\ServiceStack.Text.dll
SET PROJ_LIBS=%PROJ_LIBS% ..\lib\ServiceStack.Messaging.dll
SET PROJ_LIBS=%PROJ_LIBS% ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.Redis.dll

ILMerge.exe /ndebug /t:library /out:ServiceStack.Redis.dll %PROJ_LIBS%
COPY *.dll %DEPLOY_PATH%
COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.Redis.dll ..\..\ServiceStack\release\lib
COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.Redis.pdb ..\..\ServiceStack\release\lib

COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.Redis.dll ..\..\ServiceStack\lib
COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.Redis.pdb ..\..\ServiceStack\lib

change build scripts to also deploy into ServiceStack\lib ILMERGE foler


@echo off

@setlocal

set BUILD_PATH=%~dp0

if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe

"%PHP_COMMAND%" "%BUILD_PATH%build" %*

@endlocal

Add bat file

Add bat file


@echo Off
set config=%1
if "%config%" == "" (
   set config=Release
)

set version=1.0.0
if not "%PackageVersion%" == "" (
   set version=%PackageVersion%
)

set nuget=
if "%nuget%" == "" (
	set nuget=nuget
)

set nunit="tools\nunit\nunit-console.exe"

%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild src\Frankie.sln /p:Configuration=%config% /v:M

%nunit% /noresult ^
  src\Tests\bin\%config%\RDumont.Frankie.Tests.dll ^
  src\Specs\bin\%config%\RDumont.Frankie.Specs.dll

mkdir Build

%nuget% pack src\Core\Core.csproj -verbosity detailed -o Build -Version %version%
%nuget% pack src\CommandLine\CommandLine.csproj -IncludeReferencedProjects -verbosity detailed -o Build -Version %version%

@echo Off
set config=%1
if "%config%" == "" (
   set config=Release
)

set version=1.0.0
if not "%PackageVersion%" == "" (
   set version=%PackageVersion%
)

set nuget=
if "%nuget%" == "" (
	set nuget=nuget
)

set nunit="tools\nunit\nunit-console.exe"

%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild src\Frankie.sln /p:Configuration=%config% /v:M

%nunit% /noresult ^
  src\Tests\bin\%config%\RDumont.Frankie.Tests.dll ^
  src\Specs\bin\%config%\RDumont.Frankie.Specs.dll

mkdir Build

call %nuget% pack src\Core\Core.csproj -verbosity detailed -o Build -Version %version%
call %nuget% pack src\CommandLine\CommandLine.csproj -IncludeReferencedProjects -verbosity detailed -o Build -Version %version%

Fix for the MyGet packaging

Fix for the MyGet packaging