Skip to main content

pack command

Package the extension. Extensions can be distributed by the package mechanism in addition to direct distribution by binary. The packaging mechanism simplifies version control and installation when distributing extensions. Package files created with the pack command (files with the extension nupkg) can be deployed to users by placing them in the extension's package source folder or server.

info

You do not need to run this command if you want to binary distribute the extension without using the packaging mechanism.

command

NDExt pack [options]

Option

Usage:
NDExt pack [options]

Options:
-p, --project <project> Specify the directory of the target project. If it is not specified, it will search under the current directory and execute it.
-v, --ndver <ndver> This is the version of Next Design that is the target of the operation. If not specified, it is `2.0.0`.
-c, --config <config> Specify the build configuration. Specify `Debug` or` Release`. If not specified, it is `Debug`.
-o, --output <output> Specify the storage folder of the created package. If not specified, it is `ndpackages`.
-d, --copydir <copydir> Copies the created package to the specified folder.

Project file settings

This section describes the setting items in the project file of Visual Studio. The pack command internally calls the nuget command, which is a .NET packaging feature. NDExt is a package of the pack command and uses the information in the csproj file. If you are using Visual Studio, this information can be set in the "Package" tab of the project properties. The following is the required information.

Setting itemsXML tags on csprojDescription
Package IDPackageIdA unique name that distinguishes packages. Specify something like "MyCompany.SomePackage".
Package descriptionDescriptionUsed to describe the package. It can be any character string.
VersionVersionUsed as a version to identify the package. It will be "1.0.0" and so on.
AuthorsAuthorsPackage author information. Please enter the company name etc.

In addition, information can be set in the package by specifying Copyright and PackageProjectUrl.

Example of extension csproj file
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<PackageId>SampleExt</PackageId>
<Version>1.0.0</Version>
<PackageProjectUrl>https://www.your-web-here.com/</PackageProjectUrl>
<Authors>Me</Authors>
<Company>Me</Company>
<Product>SampleExt</Product>
<Description> Description of SampleExt</Description>
<Copyright>(Copyright Here)</Copyright>
</PropertyGroup>
...

</Project>

After executing the pack command, a nuspec file will be generated as shown below.

generated nuspec file
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>SampleExt</id>
<version>1.0.0</version>
<authors>Me</authors>
<owners>Me</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<projectUrl>https://www.your-web-here.com/</projectUrl>
<description>Description of SampleExt</description>
<releaseNotes></releaseNotes>
<copyright>(Copyright Here)</copyright>
</metadata>
</package>

example

Execute the following to find the project (csproj) of all extensions under the current directory, build and package it.

c:/myproject\src> ndext pack

If the pack command is executed successfully, a nupkg file will be created in the output folder. When I open the nupkg file with NuGet Package Explorer, it looks like this:

From the Settings button in Next Design Extensions, click the Package Source (directory or You can publish it by adding a nuget server) and placing this nupkg file.

  • The numbers under the extension folder are the corresponding Next Design versions. The extension binaries to be distributed are placed in that subfolder.
  • samples and templates are used when registering the samples and template functions of Next Design. If you created a project file with NDExt new, it will be the contents of the samples and templats folders in the pkgContents folder. Below this you can place the Next Design project file.