Skip to content

goatcorp/DalamudPackager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DalamudPackager

This is an MSBuild task that is designed to simplify creating plugins for Dalamud.

Install the NuGet package DalamudPackager. When you build in release mode, a folder will be placed in your output directory containing your plugin manifest and latest.zip.

Table of contents

Configuration

If you need to additionally configure the task, create a file called DalamudPackager.targets in your project and use the template below.

<?xml version="1.0" encoding="utf-8"?>
<Project>
    <Target Name="PackagePlugin" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">
        <DalamudPackager
                ProjectDir="$(ProjectDir)"
                OutputPath="$(OutputPath)"
                AssemblyName="$(AssemblyName)"
                MakeZip="true"/>
    </Target>
</Project>

Manifest generation

DalamudPackager reduces the amount of keys you need to include in your manifest, filling in the rest from sane defaults or your assembly. You can, of course, specify everything manually.

{
    "Name": "Test Plugin",
    "Author": "You",
    "Description": "This is a test plugin",
    "RepoUrl": "https://example.com/"
}

Notice how keys like AssemblyVersion and DalamudApiLevel are missing. You can include these if you’d like, but DalamudPackager will automatically do it for you when you build your project. If you build a project with this manifest in Release mode, you will find the following JSON file in your output directory.

{
  "Author": "You",
  "Name": "Test Plugin",
  // this will be set to your AssemblyName automatically
  "InternalName": "TestPlugin",
  // this will be set to your assembly's version automatically
  "AssemblyVersion": "1.0.0.0",
  "Description": "This is a test plugin - this first line is a summary.\n\nDown here is a more detailed explanation of what the plugin\ndoes, manually wrapped to make sure it stays visible in the\ninstaller.",
  // this will be set to "any" automatically
  "ApplicableVersion": "any",
  "RepoUrl": "https://example.com/",
  // this will be set to 2 automatically
  "DalamudApiLevel": 2,
  // this will be set to 0 automatically
  "LoadPriority": 0
}

YAML manifests

In addition, DalamudPackager allows you to use YAML, a more human-friendly format, for your manifest instead of JSON. YAML uses snake_case for keys instead of PascalCase like JSON. All the features of DalamudPackager work with YAML manifests. Just end your manifest’s file name with .yaml instead of .json to make use of it.

name: Test Plugin
author: You
description: |-
  This is a test plugin - this first line is a summary.

  Down here is a more detailed explanation of what the plugin
  does, manually wrapped to make sure it stays visible in the
  installer.
repo_url: https://example.com/

csproj manifests

If you prefer to keep your configuration in your .csproj file, you can specify almost all manifest fields directly as properties.

<PropertyGroup>
    <Author>You</Author>
    <Name>Sample Plugin</Name>
    <MinimumDalamudVersion>13.0.0</MinimumDalamudVersion>
    <Punchline>A short one-liner that shows up in /xlplugins.</Punchline>
    <Description>A description that shows up in /xlplugins. List any major slash-command(s).</Description>
    <ApplicableVersion>2025.10.30.0000.0000</ApplicableVersion>
    <RepoUrl>https://github.com/goatcorp/SamplePlugin</RepoUrl>
    <Tags>sample;plugin;goats</Tags>
    <CategoryTags>debug;test</CategoryTags>
    <DalamudApiLevel>14</DalamudApiLevel>
    <LoadRequiredState>1</LoadRequiredState>
    <LoadSync>true</LoadSync>
    <CanUnloadAsync>true</CanUnloadAsync>
    <LoadPriority>1</LoadPriority>
    <ImageUrls>https://raw.githubusercontent.com/goatcorp/DalamudPluginsD17/refs/heads/main/stable/SamplePlugin/images/image1.png;https://raw.githubusercontent.com/goatcorp/DalamudPluginsD17/refs/heads/main/stable/SamplePlugin/images/image2.png</ImageUrls>
    <IconUrl>https://raw.githubusercontent.com/goatcorp/DalamudPluginsD17/refs/heads/main/stable/SamplePlugin/images/icon.png</IconUrl>
    <Changelog>CHANGES!</Changelog>
    <AcceptsFeedback>true</AcceptsFeedback>
    <FeedbackMessage>Be nice.</FeedbackMessage>
</PropertyGroup>

.zip file generation

DalamudPackager will also create a folder with latest.zip for you if MakeZip is true. Check your output directory for a folder with the name of your assembly. Inside will be your manifest and latest.zip, ready for distribution or PRs.

Note that the entire contents of your output directory will be zipped by default. Either turn off copy local for Dalamud references, set up a task to clean your output directory, or use Exclude or Include if you want to change this.

Task attributes

If you set ManifestType to csproj, you can specify your manifest fields directly in the task attributes. The following table lists all available attributes:

AttributeDescriptionRequiredDefault
ProjectDirThis is the path where your csproj is located. You must set this to $(ProjectDir).YesNone - set to $(ProjectDir)
OutputPathThis is the path that your assemblies are output to after build. You must set this to $(OutputPath).YesNone - set to $(OutputPath)
AssemblyNameThis is the name of the assembly that Dalamud will be loading. You used to need to specify this in your manifest as InternalName.YesNone - set to $(AssemblyName)
ManifestTypeYou can choose between auto, json, yaml, and csproj for your manifest file. auto will use json first, then fall back on yaml, then fall back on csproj.Noauto
VersionComponentsHow many components of the assembly’s version to include in the generated manifest. If you use semantic versioning, set this to 3.No4
MakeZipIf this is true, a folder will be created in your OutputPath that contains your generated manifest and latest.zip, reading for PRing.Nofalse
ExcludeFiles to exclude from the zip if MakeZip is true. Mutually exclusive with Include. Files should be separated by a semicolon (;) and be relative to OutputPath. Files do not need to exist.NoNone
IncludeFiles to include in the zip if MakeZip is true. Mutually exclusive with Exclude. Files should be separated by a semicolon (;) and be relative to OutputPath. Files must exist.NoNone
AuthorManifest field defined as csproj property for the plugin’s author.NoNone
NameManifest field defined as csproj property for the plugin’s name.NoNone
MinimumDalamudVersionManifest field defined as csproj property for the plugin’s minimum Dalamud version.NoNone
DescriptionManifest field defined as csproj property for the plugin’s description.NoNone
ApplicableVersionManifest field defined as csproj property for the plugin’s applicable version.NoNone
RepoUrlManifest field defined as csproj property for the plugin’s repository URL.NoNone
TagsManifest field defined as csproj property for the plugin’s tags.NoNone
CategoryTagsManifest field defined as csproj property for the plugin’s category tags.NoNone
DalamudApiLevelManifest field defined as csproj property for the plugin’s Dalamud API level.NoNone
LoadRequiredStateManifest field defined as csproj property for the plugin’s load required state.NoNone
LoadSyncManifest field defined as csproj property for if the plugin loads synchronously.NoNone
CanUnloadAsyncManifest field defined as csproj property for if the plugin can unload asynchronously.NoNone
LoadPriorityManifest field defined as csproj property for the plugin’s load priority.NoNone
ImageUrlsManifest field defined as csproj property for the plugin’s image URLs.NoNone
IconUrlManifest field defined as csproj property for the plugin’s icon URL.NoNone
PunchlineManifest field defined as csproj property for the plugin’s punchline.NoNone
ChangelogManifest field defined as csproj property for the plugin’s changelog.NoNone
AcceptsFeedbackManifest field defined as csproj property for if the plugin accepts feedback.NoNone
FeedbackMessageManifest field defined as csproj property for the plugin’s feedback message.NoNone

About

MsBuild step to generate deployment packages for Dalamud plugins

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages