npm.io
2.5.2 • Published 1 month ago

com.elestrago.unity.package-tools

Licence
MIT
Version
2.5.2
Deps
1
Size
400 kB
Vulns
0
Weekly
0

Package Tool

Tool for create unity packages

Requirements

  • Unity 2021.3 or newer.
  • Playdarium.PackageTool.Editor — runs on Editor only.

Dependencies

Package Version
com.unity.nuget.newtonsoft-json 3.2.1

Installation

Add the package to Packages/manifest.json:

{
  "scopedRegistries": [
    {
      "name": "Playdarium",
      "url": "https://npm.playdarium.studio",
      "scopes": [
        "com.elestrago"
      ]
    }
  ],
  "dependencies": {
    "com.elestrago.unity.package-tools": "2.5.2"
  }
}

Replace the registry URL above with your scoped registry, or remove the scopedRegistries block when consuming a published package.

Getting Started

  1. Create a PackageManifestConfig asset via Assets > Create > JCMG/PackageTools/PackageManifestConfig.
  2. Fill in packageName, displayName, packageVersion, unityVersion, sourcePath (the folder under Assets/ that holds your package's source), and packageDestinationPath (where the assembled package will be written, e.g. Release).
  3. Optionally add dependencies, samples, and copyEntries rows in the inspector.
  4. Click Export Package Source to assemble the package; Export as Legacy Package to emit a .unitypackage; or Generate VersionConstants.cs to write a versions file at versionConstantsPath.

For CI, invoke PackageTool.CIUtils.Generate in batch mode and pass version=<semver> to override the asset's version on a per-run basis:

// Unity batch-mode CLI:
// unity -batchmode -quit -projectPath . \
//   -executeMethod PackageTool.CIUtils.Generate \
//   version=1.2.3 generateversionconstants=true

using PackageTool;

CIUtils.Generate();

Documentation

  • Manual — concepts and architecture.
  • API Reference — every public type and member.
  • Examples — short usage examples for the public API.

License

See LICENSE.