Skip to content

Commit

Permalink
Fixed build. vsSolutionBuildEvent up to 1.16
Browse files Browse the repository at this point in the history
+netmsb.bat replaced by modern hMSBuild.bat
  • Loading branch information
3F committed Feb 7, 2024
1 parent 856387e commit 4aaa993
Show file tree
Hide file tree
Showing 9 changed files with 547 additions and 64 deletions.
522 changes: 522 additions & 0 deletions .tools/hMSBuild.bat

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages.config → .tools/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="vsSolutionBuildEvent" version="1.14.0" output="vsSolutionBuildEvent" />
<package id="vsSolutionBuildEvent" version="1.16.0" output="vsSolutionBuildEvent" />
</packages>
26 changes: 6 additions & 20 deletions .vssbe
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{
"Header": {
"_": [
"https://github.com/3F/vsSolutionBuildEvent"
" This file for vsSolutionBuildEvent ",
" https://github.com/3F/vsSolutionBuildEvent "
],
"Compatibility": "0.9"
"Compatibility": "0.12.4"
},
"PreBuild": [
{
"Enabled": true,
"Name": "ActDir",
"Caption": "To prepare directories",
"SupportMSBuild": true,
"SupportSBEScripts": true,
"IgnoreIfBuildFailed": false,
"BuildType": "Common",
"Confirmation": false,
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
Expand All @@ -35,9 +31,6 @@
"Enabled": true,
"Name": "ActBuild",
"Caption": "Build core",
"SupportMSBuild": true,
"SupportSBEScripts": true,
"BuildType": "Common",
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
Expand Down Expand Up @@ -100,15 +93,15 @@
"#[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(\".tools\\hMSBuild.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 writeLine(STDOUT):#[File sout(\".tools\\hMSBuild.bat\", \"embedded/.packer /p:core=\\\"../$(dobj)gnt.min.core\\\" /p:output=\\\"../$(dobj)gnt.bat\\\" /p:coreversion=\\\"$(pVer)\\\" /nologo /v:m /m:4\", 400)]]",
"",
"",
"#[\" ",
" .compressor for executable version (batch)",
"\"]",
"#[IO writeLine(STDOUT):#[File sout(\"netmsb.bat\", \"embedded/.compressor /p:core=\\\"../$(dobj)gnt.bat\\\" /p:output=\\\"../$(dobj)gnt.minified.bat\\\" /nologo /v:m /m:4\", 400)]]",
"#[IO writeLine(STDOUT):#[File sout(\".tools\\hMSBuild.bat\", \"embedded/.compressor /p:core=\\\"../$(dobj)gnt.bat\\\" /p:output=\\\"../$(dobj)gnt.minified.bat\\\" /nologo /v:m /m:4\", 400)]]",
"#[IO copy.file(\"$(dobj)gnt.bat\", \"$(dobj)gnt.full.bat\", true)]",
"#[IO copy.file(\"$(dobj)gnt.minified.bat\", \"$(dobj)gnt.bat\", true)]",
"#[IO delete.files({\"$(dobj)gnt.minified.bat\"})]",
Expand All @@ -126,10 +119,7 @@
"Enabled": true,
"Name": "ActBin",
"Caption": "Binaries & tools ...",
"SupportMSBuild": true,
"SupportSBEScripts": true,
"IgnoreIfBuildFailed": true,
"BuildType": "Common",
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
Expand Down Expand Up @@ -164,11 +154,7 @@
"Enabled": true,
"Name": "ActZip",
"Caption": "Create Zip archive",
"SupportMSBuild": true,
"SupportSBEScripts": true,
"IgnoreIfBuildFailed": true,
"BuildType": "Common",
"Confirmation": false,
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
Expand Down
1 change: 1 addition & 0 deletions GUI.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@echo off & build # & packages\vsSolutionBuildEvent\GUI
23 changes: 8 additions & 15 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
@echo off

set reltype=%1
set msbuild=.\netmsb
set cim=packages\vsSolutionBuildEvent\cim.cmd

if "%reltype%"=="" (
set reltype=Release
call .tools\hMSBuild -GetNuTool /p:wpath="%cd%" /p:ngconfig=".tools\packages.config" /nologo /v:m /m:7 & (
if [%~1]==[#] exit /B 0
)

call %msbuild% logic.targets /p:ngconfig="packages.config" /nologo /v:m /m:4 || goto err
call %cim% "gnt.sln" /v:m /m:4 /p:Configuration="%reltype%" /p:Platform="Any CPU" || goto err

exit /B 0

:err

echo. Build failed. 1>&2
exit /B 1
set "reltype=%~1" & if not defined reltype set reltype=Release
call packages\vsSolutionBuildEvent\cim.cmd /v:m /m:7 /p:Configuration=%reltype% || (
echo. Failed 1>&2
exit /B 1
)
exit /B 0
9 changes: 7 additions & 2 deletions embedded/.packer
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<PropertyGroup>
<core Condition="'$(core)' == ''">..\logic.targets</core>
<output Condition="'$(output)' == ''">gnt.bat</output>
<coreversion Condition="'$(coreversion)' == ''">0</coreversion>
<maxline Condition="'$(maxline)' == ''">1820</maxline> <!-- length of line / max 2047 or 8191 characters https://support.microsoft.com/en-us/kb/830473 -->
</PropertyGroup>

Expand Down Expand Up @@ -324,8 +325,12 @@
// Finally, format script to work with gnt.core
using(StreamReader tplreader = new StreamReader("exec.tpl", System.Text.Encoding.UTF8, true)) {
content = tplreader.ReadToEnd().Replace("$gnt.core.logic$", content).Replace("$tpl.corevar$", corevar);
using(StreamReader tplreader = new StreamReader("exec.tpl.bat", System.Text.Encoding.UTF8, true))
{
content = tplreader.ReadToEnd()
.Replace("$gnt.core.logic$", content)
.Replace("$tpl.corevar$", corevar)
.Replace("$core.version$", "$(coreversion)");
}
//
Expand Down
2 changes: 1 addition & 1 deletion embedded/exec.tpl → embedded/exec.tpl.bat
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ set args=%args: #__b_ECL## =!%

:found
call :core
call %msbuildexe% %$tpl.corevar$% /nologo /p:wpath="%cd%/" /v:m /m:4 %args%
call %msbuildexe% %$tpl.corevar$% /nologo /p:wpath="%cd%/" /v:m /m:7 %args%

set "msbuildexe="
set ret=%ERRORLEVEL%
Expand Down
2 changes: 1 addition & 1 deletion embedded/sha1.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if not exist "%~dp0\gnt.bat" goto err
echo SHA-1 test has been started.

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

setlocal
cd "%~dp0"
Expand Down
24 changes: 0 additions & 24 deletions netmsb.bat

This file was deleted.

0 comments on commit 4aaa993

Please sign in to comment.