Skip to content
/ GetNuTool Public

Embeddable Package Manager (+core in .bat); πŸ•Š Lightweight tool to Create or Distribute using basic shell scripts (no powershell no dotnet-cli)

License

Notifications You must be signed in to change notification settings

3F/GetNuTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3aa4095 Β· Aug 18, 2017

History

27 Commits
Dec 4, 2016
Apr 7, 2017
Aug 18, 2017
Apr 5, 2017
May 26, 2017
Dec 8, 2016
Aug 18, 2017
Aug 18, 2017
Apr 5, 2017
May 26, 2017
Aug 18, 2017
May 25, 2017
Apr 5, 2017
Aug 18, 2017
Apr 7, 2017
Dec 4, 2016

Repository files navigation

The lightweight NuGet Client as a portable & embeddable tool for work with NuGet packages via basic MSBuild (it does not require any additional extensions).

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 ] - Full version, Minified version, Compiled variant, Executable version

Projects that based 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

License

The MIT License (MIT)

Copyright (c) 2015-2017 Denis Kuzmin <entry.reg@gmail.com>

Donate

Why GetNuTool ?

Primarily this to providing tools and service of your projects, libraries, the build processes, debugging, etc. For all that should be used as a tool for all projects (solution-level) or for each.

But! How about to consider it like a more lightweight & powerful nuget client for getting packages or for new packaging. 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.

Samples:

> msbuild gnt.core /p:ngpath="special-packages/new"
> msbuild gnt.core /p:ngconfig=".nuget/packages.config" /p:ngpath="../packages"

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"