dotnet-tegun
0.3.2-pre
See the version list below for details.
dotnet add package dotnet-tegun --version 0.3.2-pre
NuGet\Install-Package dotnet-tegun -Version 0.3.2-pre
<PackageReference Include="dotnet-tegun" Version="0.3.2-pre" />
paket add dotnet-tegun --version 0.3.2-pre
#r "nuget: dotnet-tegun, 0.3.2-pre"
// Install dotnet-tegun as a Cake Addin
#addin nuget:?package=dotnet-tegun&version=0.3.2-pre&prerelease
// Install dotnet-tegun as a Cake Tool
#tool nuget:?package=dotnet-tegun&version=0.3.2-pre&prerelease
dotnet-tegun - The KickAss DevOps utility
for creating NuGet-Packages out of ordinary, unpackaged assemblies.
Synopsis
TeGun (NuGet reversed) is a simple, yet handy cross-platform(.netcore) commandline-utility for creating nuget packages (nupkg) from a bunch of ordinary, unpackaged assemblies. The main goal is to provide a fast tooling experience when dealing with third-party assemblies that do not come packaged via e.g. Nuget.org. Such assemblies quick become unhandy when confronted with any CI/CD-Environment, as those often need to be either installed on (a variaty of) build-machines or - most of the time - get their way into version control systems, which unnecessarily bloats the code repository (especially in cloud-hosted build environments, where such dependencies can´t even be installed).
Even though most of the open-source based goodness out there is consumable via NuGet-feeds, various assemblies and whole frameworks exists that are not accessible via this route (maybe because they require a paid subscription and therfore are not in any public feed).
To help out in such on-premise scenarios, this project was born.
How it works
TeGun simply scans a directory for assemblies and analyzes their dependency-hierarchy. This hierarchy-information is then used to generate nuspec-files, which in turn can be used in conjunction with NuGet.exe to generate packages. The nuspec-files can then be used to automate package-creation or be used as a basis for more or finer grained modifications.
Download / Installation
Sorry folks, no pre-built / standalone releases yet.
However, TeGun is available as a dotnet cli extension. Just place an ItemGroup in any project-file that supports .NetCore tooling :
<ItemGroup>
<DotNetCliToolReference Include="dotnet-tegun" Version="0.3.0-pre"/>
</ItemGroup>
and run
dotnet restore
Or just clone the repo and built for your self.
Prerequisits
- .net core 2 SDK installed for building and running
- basic knowledge of nuspec
Sample
Let´s assume we have an app that does some MS Office-automation. Hence it requires certain assemblies from the Office-SDKs. We identify a bunch of available assemblies and copy them to c:\temp\officeSDK. The contents of the directory might look like his:
- Microsoft.Office.Interop.OneNote.dll
- Microsoft.Office.Interop.Outlook.dll
- Microsoft.Office.Interop.OutlookViewCtl.dll
- Microsoft.Office.Interop.PowerPoint.dll
- Microsoft.Office.Interop.Publisher.dll
- ...
In order to invoke TeGun, we utilize the dotnet cli extension point as described above. Therefor, we need a dummy project, which we create with
dotnet new console
Edit the created projcet file and include:
<ItemGroup>
<DotNetCliToolReference Include="dotnet-tegun" Version="0.3.0-pre"/>
</ItemGroup>
after running
dotnet restore
we are now ready to let TeGun do it´s magic 😉
TeGun uses a config file for most of it´s settings atm. Think of it as C#-project file or a meta-nuspec. Let´s initialize a new config:
dotnet tegun init office
This wil create an initial office.config.json pointing to assemblies in the current directory.
Open the config to tweak the package-creation to your needs:
{
"assemblies": {
"sources": [
"." //scan the local directory for assemblies
],
"excludePatterns": [
"System.*" //exclude matching assemblies
],
"bundles": [
{
"searchPattern": "Microsoft.Office.*", //Bundle all matching assemblies
"packageId": "OfficeBundle.Sample", //into a package
"packageVersion": "1.2.3.4" //with this version
}
],
"substitutions": [
{
"replace": "Interop",
"with": "xxx"
},
]
},
//general nuspec-creation settings
"package": {
"authors": "earloc",
"owners": "earloc",
"tags": [ //additional tags
"tags",
"go",
"here"
],
"targetframeworks": [
"net45"
],
"versionFormat": "{Major}.{Minor}.{Build}.{Revision}", //Use full version number from scanned assembly as package version
"title": {
"prefix": "earloc.", //prefix package names
"suffix": ""
},
"nuspecTemplate": null
}
}
If we now invoke the command:
dotnet tegun nuspec office
tegun will create nuspec-files according to the above settings in the subfolder office/nuspecs:
- OfficeBundle.Sample.1.2.3.4.nuspec
- earloc.Microsoft.Office.xxx.OneNote.14.0.0.0.nuspec
- earloc.Microsoft.Office.xxx.Outlook.14.0.0.0.nuspec
- earloc.Microsoft.Office.xxx.OutlookViewCtl.14.0.0.0.nuspec
- earloc.Microsoft.Office.xxx.PowerPoint.14.0.0.0.nuspec
- earloc.Microsoft.Office.xxx.Publisher.14.0.0.0.nuspec
- ...
These nuspecs can now be further tweaked to your needs and be used to produce packages, e.g. with a simple batch file in the office subfolder:
set nuget=nuget.exe
for /R nuspecs %%f in (*.nuspec) do (
%nuget% pack %%f -OutputDirectory packages
)
will produce the following packages at office/packages:
- OfficeBundle.Sample.1.2.3.4.nupkg
- earloc.Microsoft.Office.xxx.OneNote.14.0.0.nupkg
- earloc.Microsoft.Office.xxx.Outlook.14.0.0.nupkg
- earloc.Microsoft.Office.xxx.OutlookViewCtl.14.0.0.nupkg
- earloc.Microsoft.Office.xxx.PowerPoint.14.0.0.nupkg
- earloc.Microsoft.Office.xxx.Publisher.14.0.0.nupkg
- ...
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.0
- CommandLineParser (>= 2.1.1-beta)
- Microsoft.NETCore.App (>= 2.0.0)
- Newtonsoft.Json (>= 10.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.4.46 | 1,084 | 12/5/2017 |
0.4.44-dev | 747 | 12/5/2017 |
0.4.43-dev | 743 | 12/5/2017 |
0.4.42-dev | 764 | 12/5/2017 |
0.4.41 | 948 | 12/5/2017 |
0.4.39-dev | 768 | 12/5/2017 |
0.4.38-dev | 725 | 12/5/2017 |
0.4.37-dev | 741 | 12/5/2017 |
0.4.36-dev | 768 | 12/5/2017 |
0.4.34-dev | 772 | 11/30/2017 |
0.4.33 | 936 | 11/30/2017 |
0.4.25-pre | 805 | 11/24/2017 |
0.3.0 restructuration
0.2.0 optimize logging output
0.1.0 inital release