diff --git a/.gitignore b/.gitignore index dc3068a..ce96482 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ obj .vs /packages /minified/gnt-min.core -/minified/gnt.core +/minified/gnt.core* .nupkg -/embedded/gnt.bat \ No newline at end of file +/embedded/gnt.bat +/embedded/gnt.core* diff --git a/.vssbe b/.vssbe index 0a0f30c..23d4ae2 100644 --- a/.vssbe +++ b/.vssbe @@ -43,7 +43,7 @@ "$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent", "Type": "Script", "Command__": [ - "#[File scall(\"packing.bat\", \"\", 400)]" + "#[IO writeLine(STDOUT):#[File sout(\"packing.bat\", \"\", 400)]]" ] } } @@ -69,7 +69,7 @@ " \"minified/gnt.core\", ", " \"caller/gnt.bat\"", " }, ", - " \"$(odir)versions/02. caller/\", true)]", + " \"$(odir)versions/02. wrapper/\", true)]", "", "#[IO copy.file({ \"README.md\", \"changelog.txt\" }, \"$(odir)doc/\", true)]", " ", @@ -80,6 +80,23 @@ " \"$(odir)\", true)]" ] } + }, + { + "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", + "Command__": [ + "#[7z pack.directory(\"$(dbin)raw\", \"$(dbin)GetNuTool.zip\")]" + ] + } } ] } \ No newline at end of file diff --git a/README.md b/README.md index e314e96..03e3bc0 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ -# GetNuTool +# [GetNuTool](https://github.com/3F/GetNuTool) The lightweight non-binary NuGet Client as a portable & embeddable tool for work with NuGet packages via basic MSBuild (it does not require any additional extensions). -[![Build status](https://ci.appveyor.com/api/projects/status/rv65lbks5frc4k52/branch/master?svg=true)](https://ci.appveyor.com/project/3Fs/getnutool/branch/master) -[![release-src](https://img.shields.io/github/release/3F/GetNuTool.svg)](https://github.com/3F/GetNuTool/releases/latest) -[![License](https://img.shields.io/badge/License-MIT-74A5C2.svg)](https://github.com/3F/GetNuTool/blob/master/LICENSE) +[![Build status](https://ci.appveyor.com/api/projects/status/rv65lbks5frc4k52/branch/master?svg=true)](https://ci.appveyor.com/project/3Fs/getnutool/branch/master) [![release-src](https://img.shields.io/github/release/3F/GetNuTool.svg)](https://github.com/3F/GetNuTool/releases/latest) [![License](https://img.shields.io/badge/License-MIT-74A5C2.svg)](https://github.com/3F/GetNuTool/blob/master/LICENSE) ```bash > gnt # Executable version - full logic inside single script @@ -176,7 +174,7 @@ debug | false (by default), true | `v1.3+` To display additional information ```bash > msbuild gnt.core -> msbuild gnt.core /p:ngpackages="7z.Libs/15.12.0;vsSBE.CI.MSBuild/1.5.1:../packages/CI.MSBuild" +> msbuild gnt.core /p:ngpackages="7z.Libs/16.04.0;vsSBE.CI.MSBuild/1.6.12010:../packages/CI.MSBuild" ``` ```bash @@ -186,7 +184,7 @@ debug | false (by default), true | `v1.3+` To display additional information #### Paths to MSBuild Tools -*Use our msbuild-searcher and have fun. But just a note where to find the MSBuild tools by default:* +*Use our [msbuild-helper](https://github.com/3F/GetNuTool/blob/master/msbuild.bat) and have fun. But just a note where to find the MSBuild tools by default:* * All available versions on your machine: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions` diff --git a/build.bat b/build.bat index 98a15e5..670effb 100644 --- a/build.bat +++ b/build.bat @@ -3,6 +3,13 @@ set msbuild=msbuild.bat -call %msbuild% gnt.core /p:ngconfig="packages.config" /nologo /v:m /m:4 -call "packages\vsSBE.CI.MSBuild\bin\CI.MSBuild" "gnt.sln" /v:m /m:4 +call %msbuild% gnt.core /p:ngconfig="packages.config" /nologo /v:m /m:4 || goto err +call %msbuild% -notamd64 "gnt.sln" /l:"packages\vsSBE.CI.MSBuild\bin\CI.MSBuild.dll" /v:m /m:4 +goto exit + +:err + +echo. Build failed. 1>&2 + +:exit \ No newline at end of file diff --git a/caller/gnt.bat b/caller/gnt.bat index 26e04cf..1959b9b 100644 --- a/caller/gnt.bat +++ b/caller/gnt.bat @@ -6,12 +6,12 @@ for %%v in (14.0, 12.0, 15.0, 4.0, 3.5, 2.0) do ( for /F "usebackq tokens=2* skip=2" %%a in ( `reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\%%v" /v MSBuildToolsPath 2^> nul` ) do if exist %%b ( - set msbuild="%%bmsbuild.exe" + set msbuild="%%b\msbuild.exe" goto found ) ) -echo MSBuild Tools was not found. Please use it manually like: ` "full_path_to_msbuild.exe" %gntcore% arguments` 1>&2 +echo MSBuild was not found, try: ` "full_path_to_msbuild.exe" %gntcore% arguments` 1>&2 goto exit @@ -19,7 +19,7 @@ goto exit echo MSBuild Tools: %msbuild% -%msbuild% gnt.core /nologo /v:m /m:4 %* +%msbuild% %gntcore% /nologo /v:m /m:4 %* REM /noconlog :exit \ No newline at end of file diff --git a/compress.bat b/compress.bat index fc580f0..a3df4f8 100644 --- a/compress.bat +++ b/compress.bat @@ -1,3 +1,13 @@ @echo off -msbuild minified/.compressor /p:core="../gnt.core" /p:output="gnt.core" /nologo /v:m /m:4 %* \ No newline at end of file +set msbuild=msbuild.bat + +call %msbuild% minified/.compressor /p:core="../gnt.core" /p:output="gnt.core" /nologo /v:m /m:4 %* || goto err + +goto exit + +:err + +echo. Build failed. 1>&2 + +:exit \ No newline at end of file diff --git a/embedded/.packer b/embedded/.packer index b0bea7f..6d593af 100644 --- a/embedded/.packer +++ b/embedded/.packer @@ -28,8 +28,7 @@ $(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll $(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll - - + %$tpl.corevar$% $gnt.core.logic$ -:exit \ No newline at end of file +:exit +exit /B 0 \ No newline at end of file diff --git a/msbuild.bat b/msbuild.bat index 5288939..610f7c3 100644 --- a/msbuild.bat +++ b/msbuild.bat @@ -1,23 +1,63 @@ @echo off +setlocal enableDelayedExpansion + +:: The MSBuild-helper. Part of GetNuTool +:: https://github.com/3F/GetNuTool + +:: arguments: +:: +:: msbuild -notamd64 - to select x86 instance instead of x64 if it's possible. +:: msbuild - to select any available instance. +:: + +set args=%* +set notamd64=0 + +set a=%args:~0,30% +set a=%a:"=% + +if "%a:~0,9%"=="-notamd64" ( + call :popa %1 + shift + set notamd64=1 +) for %%v in (14.0, 12.0, 15.0, 4.0, 3.5, 2.0) do ( for /F "usebackq tokens=2* skip=2" %%a in ( `reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\%%v" /v MSBuildToolsPath 2^> nul` ) do if exist %%b ( - set msbuild="%%b\msbuild.exe" + + if NOT "%notamd64%" == "1" ( + set msbuild=%%b\msbuild.exe + goto found + ) + + :: 7z & amd64\msbuild - https://github.com/3F/vsSolutionBuildEvent/issues/38 + set _amd=..\msbuild.exe + if exist "%%b/!_amd!" ( + set msbuild=%%b\!_amd! + ) else ( + set msbuild=%%b\msbuild.exe + ) goto found ) ) -echo MSBuild Tools was not found. Please use it manually like: ` "full_path_to_msbuild.exe" arguments ` 1>&2 - +echo MSBuild was not found, try: ` "full_path_to_msbuild.exe" arguments ` 1>&2 goto exit + :found +set msbuild="%msbuild%" + echo MSBuild Tools: %msbuild% -%msbuild% %* +%msbuild% %args% +:popa +call set args=%%args:%1^=%% +exit /B 0 -:exit \ No newline at end of file +:exit +exit /B 0 \ No newline at end of file diff --git a/packing.bat b/packing.bat index 5d3f685..9f4b0ee 100644 --- a/packing.bat +++ b/packing.bat @@ -1,3 +1,15 @@ @echo off -compress & msbuild embedded/.packer /p:core="../minified/gnt.core" /p:output="gnt.bat" /nologo /v:m /m:4 %* \ No newline at end of file +set msbuild=msbuild.bat + +call compress || goto err +call %msbuild% embedded/.packer /p:core="../minified/gnt.core" /p:output="gnt.bat" /nologo /v:m /m:4 %* || goto err + + +goto exit + +:err + +echo. Build failed. 1>&2 + +:exit \ No newline at end of file