Cross-Platform Embeddable Package Manager [gnt.core]. NuGet / Chocolatey Client and the lightweight portable tool for work with packages.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
caller
embedded
minified
.gitattributes
.gitignore
.version
.vssbe
LICENSE
README.md
build.bat
changelog.txt
gnt.sln
logic.targets
netmsb.bat
packages.config

README.md

GetNuTool

Embeddable Package Manager. NuGet / Chocolatey Client. And the lightweight portable tool for work with packages. (via basic MSBuild that does not require any additional extensions, dotnet-cli, powershell, ...)

Build status release-src License

> gnt                                           # Executable version - full logic inside single script
> msbuild gnt.core                              # Full & Compact versions to execute via MSBuild
[NuGet gnt.raw("/t:pack /p:ngin=\"7z.Libs\"")]  # Compiled variant via vssbe

just try this:

gnt /p:ngpackages="Conari;regXwild"             # To get `Conari` & `regXwild` packages
gnt /t:pack /p:ngin="bin\DllExport"             # To create new NuGet package from `bin\DllExport` .nuspec
gnt /p:ngpackages="LunaRoad/1.4.1"              # To get `LunaRoad` package v1.4.1
msbuild gnt.core /p:ngconfig="packages.config"  # Use `packages.config`
gnt /p:ngserver="https://chocolatey.org/api/v2/package/" /p:ngpackages="putty.portable/0.69"

Download: /releases [ latest stable ] - Full version, Minified version, Compiled variant, Executable version

Projects on GetNuTool core

  • hMSBuild - A lightweight tool (compiled batch file ~19 Kb that can be embedded inside any scripts or other batch files) - an easy helper for searching of available MSBuild tools. https://github.com/3F/hMSBuild
  • DllExport Manager - It was based on GetNuTool core that's Cross-Platform Embeddable Package Manager that requires only MSBuild. Finally it just aggregates calling to Wizard that was based on MvsSln.

License

The MIT License (MIT)

Copyright (c) 2015-2018 Denis Kuzmin <entry.reg@gmail.com> :: github.com/3F

Donate

Why GetNuTool ?

Initially this was developed for providing tools to service projects, libraries, the build processes, debugging, etc. As an tool for all projects (solution-level) or for each separately.

But! How about to consider all this like a more lightweight & powerful nuget client for getting packages or for packaging new. No, seriously, we already use it for many projects like:

Because it easy, and works well.

Restoring packages inside Visual Studio IDE

The GetNuTool can't use events from Visual Studio by default. However, it can be combined with other our tool for complex work with lot of events of VS IDE & MSBuild:

So you can use this as you want, for example, automatically getting tool above for complex scripting in MSBuild & Visual Studio as unified engine., etc.

Main features

  • Getting the all selected .nupkg packages from any NuGet server (+Chocolatey) from user list with formats below.
    • Two formats: list from .config files or direct from string.
  • Extracting the all data from .nupkg into path by default or specific for each package.
    • +Custom naming for each package with ignoring for already downloaded packages.
  • Dependencies are not considered! get it manually as other packages above.
  • NuGet events (Init.ps1, Install.ps1, Uninstall.ps1) currently are not considered. Call it manually from /tools.
  • Creating new (packing) NuGet packages as .nupkg by using .nuspec
  • Wrapping of any package in one executable file, for example:
  • With our .packer can be easy embedded inside of any scripts, like hMSBuild
  • A lot of versions for your comfortable work - Full version, Minified version, Compiled variant, Executable version.
  • ...

Commands

get

The get command is used by default. For getting & extracting packages. You can also use it as /t:get

Settings:

Property Description Default values
ngconfig Where to look the packages.config files. v1.6+ packages.config, v1.0 - v1.5: .nuget\packages.config
ngserver NuGet server. v1.0+ https://www.nuget.org/api/v2/package/
ngpackages List of packages. Use it first if defined, otherwise find via ngconfig v1.0+ empty
ngpath Common path for all packages. v1.0+ packages
wpath v1.4+ To define working directory. v1.4+ The absolute path of the directory where the GetNuTool is located.
proxycfg v1.6.2+ To configure connection via proxy. v1.6.2+ empty. Format: [usr[:pwd]@]host[:port]

Samples:

msbuild gnt.core /p:ngpath="special-packages/new"
msbuild gnt.core /p:ngconfig=".nuget/packages.config" /p:ngpath="../packages"
gnt /p:ngpackages="Conari" /p:proxycfg="guest:1234@10.0.2.15:7428"

Format of packages list

Attribute Description
id Identifier of package.
version Version of package.
output Optional path for getting package.

Property:

/p:ngpackages="id[/version][:output]"
/p:ngpackages="id[/version][:output];id2[/version][:output];..."

packages.config:

<packages>
  <package id="ident" version="1.2.0" />
  <package id="ident.second" version="15.0" output="path" />
</packages>

Note: Attributes for v1.2+ are case sensitive now. Use lowercase for id, version, output ...

Format of ngconfig

/p:ngconfig=".nuget/packages.config"

multiple:

  • ; - v1.6+
  • | - v1.0+ (obsolete and can be removed in new versions)
/p:ngconfig="debug.config;release.config;..."
/p:ngconfig=".nuget/packages.config|project1/packages.config|project2/packages.config|..."

pack

The pack command. For creating the new .nupkg packages by .nuspec specification. Use it as /t:pack

Settings:

Property Description
ngin To select path to directory for packing with .nuspec file.
ngout Optional path to output the final .nupkg package.
wpath v1.4+ To define working directory.
> msbuild gnt.core /t:pack /p:ngin="path to .nuspec"
> msbuild gnt.core /t:pack /p:ngin="path to .nuspec" /p:ngout="path for .nupkg"

Properties

Property Values Description
debug false (by default), true v1.3+ To display additional information from selected command.

Examples

note: v1.4+ also provides executable variant of GetNuTool.

> gnt /p:ngpackages="Conari" 
> msbuild gnt.core /p:ngpackages="DllExport" 
> msbuild gnt.core
> msbuild gnt.core /p:ngpackages="7z.Libs/16.04.0;vsSBE.CI.MSBuild/1.6.12010:../packages/CI.MSBuild"
> msbuild gnt.core /t:pack /p:ngin="app\LunaRoad"
> msbuild gnt.core /t:pack /p:ngin="D:\tmp\7z.Libs" /p:ngout="newdir/"

Path to MSBuild Tools

If you need, try hMSBuild and have fun.

Compact & Minified versions

To build this version you can use our compressor from here.

Currently minified version ~4 Kb for get command and ~4 Kb for pack command, i.e. ~8 Kb in total.

> compress
> msbuild .compressor
> msbuild .compressor /p:core="path to core" /p:output="output file"

Compiled variant

The GetNuTool now is part of NuGetComponent (SBE-Scripts)

#[NuGet gnt.raw("/t:pack /p:ngin=\"D:\7z.Libs\"")]
...

Executable version

The gnt.bat is already contains gnt.core logic. It stored inside script.

To build this version you should use our packer from here.

> packing
> msbuild embedded/.packer /p:core="path to minified core" /p:output="output file"

Now, you can use it simply:

> gnt ...
> gnt /p:ngpackages="Conari"

note: you do not need the gnt.core or something else ! the final script provides all of what you need as non-binary tool ~10 Kb.

Additional arguments

key Description Sample
-unpack To generate minified version from executable. v1.6+ gnt -unpack
-msbuild path To use specific msbuild if needed. v1.6+ gnt -msbuild "D:\MSBuild\bin\amd64\msbuild" /p:ngpackages="Conari"