Obsidian.MSBuild 2.0.1-nightly.g76d65868a6

This is a prerelease version of Obsidian.MSBuild.
dotnet add package Obsidian.MSBuild --version 2.0.1-nightly.g76d65868a6
                    
NuGet\Install-Package Obsidian.MSBuild -Version 2.0.1-nightly.g76d65868a6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Obsidian.MSBuild" Version="2.0.1-nightly.g76d65868a6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Obsidian.MSBuild" Version="2.0.1-nightly.g76d65868a6" />
                    
Directory.Packages.props
<PackageReference Include="Obsidian.MSBuild" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Obsidian.MSBuild --version 2.0.1-nightly.g76d65868a6
                    
#r "nuget: Obsidian.MSBuild, 2.0.1-nightly.g76d65868a6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Obsidian.MSBuild@2.0.1-nightly.g76d65868a6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Obsidian.MSBuild&version=2.0.1-nightly.g76d65868a6&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Obsidian.MSBuild&version=2.0.1-nightly.g76d65868a6&prerelease
                    
Install as a Cake Tool

Obsidian.MSBuild

An MSBuild package that packs your plugin into a version 2 .obby archive when it is built or published.

Installation

NuGet package: https://www.nuget.org/packages/Obsidian.MSBuild

Install-Package Obsidian.MSBuild

Instructions

Install the package and set the plugin metadata in your csproj:

<PropertyGroup>
    
    <PluginId>ruby</PluginId>

    
    <Version>1.2.0</Version>
    <Title>Ruby</Title>
    <Authors>Tides, Ada</Authors> 
    <Description>Adds rubies.</Description>
    <ProjectUrl>https://example.com/ruby</ProjectUrl>

    
    <PluginApiVersion>1.0.0</PluginApiVersion>

    
    <PluginSide>both</PluginSide>

    
    <PluginPublishDir>$(PublishDir)</PluginPublishDir>

    
    <PluginAssetsDir>Resources/assets</PluginAssetsDir>
    <PluginDataDir>Resources/data</PluginDataDir>
</PropertyGroup>

<ItemGroup>
    
    <PluginDependency Include="gemlib" Version="[1.0,2.0)" Type="required" Ordering="after" Side="both" />
    <PluginDependency Include="prettylib" Required="false" />
</ItemGroup>

Build (or publish) the plugin and <AssemblyName>.obby appears in PluginPublishDir.

Metadata

The task generates obsidian.mod.json from the properties above. If an obsidian.mod.json file exists in the project directory (or wherever PluginMetadataFile points), it is packed as-is instead.

JSON field MSBuild source
modId (required) PluginId
version (required) Version
assembly (required) AssemblyName
displayName Title
apiVersion PluginApiVersion
authors Authors, split on commas
description Description
projectUrl ProjectUrl
side PluginSide: both (default), server or client
dependencies @(PluginDependency) items

PluginDependency item metadata:

Metadata JSON field Values
Include or Id modId the dependency's mod id
Version (or VersionRange) versionRange a NuGet/Maven range such as [1.0,2.0) or a minimum version; any version when omitted
Type type required (default), optional, incompatible or discouraged
Required type true maps to required, false to optional; ignored when Type is set
Ordering ordering none, before or after
Side side both, server or client

Assets and data

The assets and data folders of the project are packed under assets/ and data/, laid out like a resource pack and a data pack: assets/<namespace>/... for client resources and data/<namespace>/... for server data. Set PluginAssetsDir or PluginDataDir in the project to pack other folders (paths relative to the project, or absolute), or set one empty to pack no such folder. A folder that doesn't exist is skipped.

The data folder's JSON files are also given to the compiler, with their path in the folder, so that Obsidian's source generator generates the plugin's blocks from data/<namespace>/blocks/*.json and keys for its tags from data/<namespace>/tags/block and tags/item.

Archive layout

A version 2 .obby is a ZIP file:

Path Contents
obsidian.mod.json Metadata (see above).
<Assembly>.dll, <Assembly>.pdb, <Assembly>.deps.json The plugin assembly and its publish outputs.
*.dll, *.pdb Libraries beside the main assembly, as dotnet publish lays them out.
assets/<namespace>/... Optional client resources.
data/<namespace>/... Optional server data.

Only the top-level files of PluginPublishDir are packed; testhost* files and the archive itself are skipped.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.