-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Generating Nuget Packages
Contributors to the Mixed Reality Toolkit are in the process of setting up a more robust packaging story for distributing components. Tooling for creating NuGet packages is still under construction. The most recent instructions can be found below.
Note: Building the artifacts is NOT currently a required step in validating new contributions to the Mixed Reality Toolkit. Long term, after this new packaging story is completed, building the artifacts will become a required step in validating changes.
NuGet is the package manager for .Net. You will need to declare the directory containing nuget.exe in your windows PATH variable in order for nuget.exe to resolve correctly in the below PowerShell build script.
After installing NuGet, you can add it to your PATH variable via the following:
- Open 'Edit your system environment variables' from the windows start menu
- In the 'System Properties' Dialogue, select the Advanced tab
- Select the 'Environment Variables...' button
- Find 'Path' under your user variables
- Choose to 'Edit' the 'Path' variable value
- Add a 'New' item to the 'Path' variable that is the directory where nuget.exe is located
- Reopen any PowerShell windows
- Confirm nuget now resolves as a command in your PowerShell window by running 'get-command nuget'
Note 1: Command Window and PowerShell both resolve PATH variables when opened. Any changes to the PATH variable will require closing and reopening Command and PowerShell windows for things to resolve correctly.
Note 2: Further steps will show how to build NuGet packages related to the MRTK. You can also build your own NuGet packages in a command window by running the following:
nuget pack package.nuspec -Symbols
The build process leverages UnitySetup, an OSS PowerShell Module from Microsoft.
Install from PowerShell:
Install-Module UnitySetup -Scope CurrentUser
If you do not specify a version, then Git is used to find relevant tags. In this case it will need to be available in the PATH. See the above instructions for setting up NuGet to understand how to set the PATH variable for Git.exe
Simply execute the build script as such:
.\build.ps1 -Version '1.2.3'
For help and examples simply use the PowerShell help command:
help .\build.ps1 -Detailed
Note: If you don't specify
-Version <version>
the script will try to infer it from tags pointing to the current git commit. An error is produced if you don't have a tag and no version is provided.
Project Management
Contributing