Thursday, January 6, 2011

Orchard | Generate a NuPack Package

To generate a theme package called "MyCustomTheme" for Orchard starting version 0.9.253, we must work a manifest file and pack it using NuGet.exe

1) first we must place all contents in an output folder (Content, Styles, Views, Shapes, Zones)

2) then we must create out manifest file (.nuspec), which may or may not specify the files in the package (seems ouputting the folder adds each file automatically)

Contents of manifest file, Orchard.Theme.MyCustomTheme.nuspec:

<?xml version="1.0"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Orchard.Theme.MyCustomTheme</id>
<version>0.9.253</version>
<authors>Bind</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is the MyCustomTheme Theme for Orchard</description>
</metadata>
</package>

3) finally, we run the command-line needed to compile the theme in a Orchard.Theme.MyCustomTheme.0.9.253.nupkg uploadable package.

NuGet.exe pack Orchard.Theme.MyCustomTheme.nuspec -b .\output -o .


Final Note:

Optionally this can be done with Orchard installation dependancy, by placing the theme contents (MyCustomTheme folder) in [OrchardInstallFolder]\Themes and then running [OrchardInstallFolder]\bin\Orchard.exe package create MyCustomTheme ..\Themes

(..\Themes makes the output package to be placed in the Themes folder instead of the installation's bin folder)

Documentation on NuGet

1 comment:

  1. Thanks so much, bro. It seems like an obvious feature, but some newbies like me could sure use a good beginners tutorials every now and then :P

    ReplyDelete