Skip to content

Commit

Permalink
added additional info for releases via revBuild & sha1
Browse files Browse the repository at this point in the history
  • Loading branch information
3F committed Aug 18, 2017
1 parent 708da66 commit 3aa4095
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 42 deletions.
1 change: 1 addition & 0 deletions .version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.6
85 changes: 76 additions & 9 deletions .vssbe
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
"Enabled": true,
"Name": "ActDir",
"Caption": "Prepare output directory",
"Caption": "To prepare directories",
"SupportMSBuild": true,
"SupportSBEScripts": true,
"IgnoreIfBuildFailed": false,
Expand All @@ -28,22 +28,87 @@
"$(odir = \"$(dbin)raw/\")",
"",
"#[IO delete.directory(\"$(dbin)\", true)]",
"#[IO copy.directory(\"\", \"$(dbin)\", true)]"
"#[IO copy.directory(\"\", \"$(dbin)\", true)]",
"",
"#[$(dobj = \"obj/\")]",
"#[IO copy.directory(\"\", \"$(dobj)\", true)]"
]
}
},
{
"Enabled": true,
"Name": "ActBuild",
"Caption": "Building",
"Caption": "Build core",
"SupportMSBuild": true,
"SupportSBEScripts": true,
"BuildType": "Common",
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[IO writeLine(STDOUT):#[File sout(\"packing.bat\", \"\", 400)]]"
"#[$(revDeltaBase = \"2017/08/12\")]",
"#[$(revDeltaMin = $([System.Math]::Pow(10, 3)))]",
"#[$(revDeltaMax = 65534)] #[\" limit of AssemblyVersion (2^16 - 2) - i.e. 65534 max allowed \"]",
"",
"#[var pVer = #[File get(\".version\")]]",
"",
"#[\" ",
" Calculate revision",
"\"]",
"#[var tBase = $([System.DateTime]::Parse('$(revDeltaBase)').ToBinary())]",
"#[var tNow = $([System.DateTime]::UtcNow.Ticks)]",
"#[var revBuild = #[$(",
" [System.TimeSpan]::FromTicks('$(",
" [MSBuild]::Subtract($(tNow), $(tBase))",
" )')",
" .TotalMinutes.ToString('0'))]]",
" ",
"#[var revBuild = #[$(",
" [MSBuild]::Add(",
" $(revDeltaMin), ",
" $([MSBuild]::Modulo(",
" $(revBuild), ",
" $([MSBuild]::Subtract(",
" $(revDeltaMax), $(revDeltaMin)",
" ))",
" ))",
" )",
" )]",
"]",
"",
"#[$(pVerPrintFile = \"$(pVer).$(revBuild)\"))]",
"",
"#[\" ",
" Checking of the git folder +tool & define sha1, branch name, etc.",
"\"]",
"#[( #[IO exists.directory(\".git\")] && #[IO exists.file(\"git.exe\", true)] )",
"{",
" #[var bSha1 = #[IO sout(\"git\", \"rev-parse --short HEAD\")]]",
" ",
" #[$(pVerPrintFile = \"$(pVerPrintFile)_$(bSha1)\")]",
"}",
"else {",
" #[$(bSha1 = '-')]",
"}]",
"",
"#[( $(reltype) == \"PublicRelease\" ) {",
" #[$(pVerPrintApp = \"$(pVer).$(revBuild)_$(bSha1)\")]",
"}",
"else {",
" #[$(pVerPrintApp = $(pVer))]",
"}]",
"",
"#[\" obj \"]",
"",
"#[IO copy.file(\"logic.targets\", \"$(dobj)core\", true)]",
"#[IO replace.Regex(\"$(dobj)core\", \"<GetNuTool>.+?</GetNuTool>\", \"<GetNuTool>$(pVerPrintApp)</GetNuTool>\")]",
"",
"#[IO writeLine(STDOUT):#[File sout(\"netmsb.bat\", \"minified/.compressor /p:core=\\\"../$(dobj)core\\\" /p:output=\\\"../$(dobj)gnt.min.core\\\" /nologo /v:m /m:4\", 400)]]",
"",
"#[IO writeLine(STDOUT):#[File sout(\"netmsb.bat\", \"embedded/.packer /p:core=\\\"../$(dobj)gnt.min.core\\\" /p:output=\\\"../$(dobj)gnt.bat\\\" /nologo /v:m /m:4\", 400)]]",
"",
"#[IO copy.file(\"embedded/sha1*\", \"$(dobj)\", true)]",
"#[IO writeLine(STDOUT):#[File sout(\"$(dobj)sha1.cmd\", \"\", 400)]]"
]
}
}
Expand All @@ -61,12 +126,12 @@
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[IO copy.file(\"logic.targets\", \"$(odir)core/gnt.core\", true)]",
"#[IO copy.file(\"minified/gnt.core\", \"$(odir)core-minified/gnt.core\", true)]",
"#[IO copy.file(\"embedded/gnt.bat\", \"$(odir)versions/01. executable/gnt.bat\", true)]",
"#[IO copy.file(\"$(dobj)core\", \"$(odir)core/gnt.core\", true)]",
"#[IO copy.file(\"$(dobj)gnt.min.core\", \"$(odir)core-minified/gnt.core\", true)]",
"#[IO copy.file(\"$(dobj)gnt.bat\", \"$(odir)versions/01. executable/gnt.bat\", true)]",
"",
"#[IO copy.file({",
" \"minified/gnt.core\", ",
" \"$(odir)core-minified/gnt.core\", ",
" \"caller/gnt.bat\"",
" }, ",
" \"$(odir)versions/02. wrapper/\", true)]",
Expand Down Expand Up @@ -106,7 +171,9 @@
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[7z pack.directory(\"$(dbin)raw\", \"$(dbin)GetNuTool.zip\")]"
"#[7z pack.directory(\"$(dbin)raw\", \"$(dbin)GetNuTool_v$(pVerPrintFile).zip\")]",
"",
"#[IO copy.file(\"$(odir)versions/01. executable/gnt.bat\", \"$(dbin)gnt.bat\", true)]"
]
}
}
Expand Down
7 changes: 6 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
@echo off

set reltype=%1
set msbuild=netmsb
set cimdll=packages\vsSBE.CI.MSBuild\bin\CI.MSBuild.dll

if "%reltype%"=="" (
set reltype=Release
)

call %msbuild% logic.targets /p:ngconfig="packages.config" /nologo /v:m /m:4 || goto err
call %msbuild% "gnt.sln" /l:"packages\vsSBE.CI.MSBuild\bin\CI.MSBuild.dll" /v:m /m:4 || goto err
call %msbuild% "gnt.sln" /l:"%cimdll%" /v:m /m:4 || goto err

exit /B 0

Expand Down
12 changes: 0 additions & 12 deletions compress.bat

This file was deleted.

9 changes: 5 additions & 4 deletions embedded/sha1.cmd
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
@echo off

set msbuild="%~dp0\..\netmsb.bat"

if not exist "%~dp0\gnt.bat" goto err
echo SHA-1 test has been started.

set msbuild="%~dp0\..\netmsb.bat"

call "%~dp0\gnt" -unpack || goto err
call %msbuild% "%~dp0\sha1_comparer.targets" /p:core1="%~dp0\../minified/gnt.core" /p:core2="%~dp0\gnt.core" /nologo /v:m /m:4 || goto err
call %msbuild% "%~dp0\sha1_comparer.targets" /p:core1="%~dp0\gnt.min.core" /p:core2="%~dp0\gnt.core" /nologo /v:m /m:4 || goto err

exit /B 0

:err

echo. Build failed. 1>&2
echo Failed. 1>&2
exit /B 1
2 changes: 1 addition & 1 deletion logic.targets
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
<Target Name="Build" DependsOnTargets="get" />

<PropertyGroup>
<GetNuTool>1.6</GetNuTool>
<GetNuTool>1</GetNuTool>
<wpath Condition="'$(wpath)' == ''">$(MSBuildProjectDirectory)</wpath>
</PropertyGroup>
<Target Name="header">
Expand Down
15 changes: 0 additions & 15 deletions packing.bat

This file was deleted.

0 comments on commit 3aa4095

Please sign in to comment.