GDK Unity plugin custom build pipeline support
The GDK Unity plugin provides the GDKBuild class as an interface to the plugin build functions. The GDKBuild class allows you to call build methods from your custom Unity build pipeline instead of using the GDK->PC->Build and Run->Build command in the Unity GUI.
The GDKBuild class can be found in Assets\GDK-Tools\Source\Editor\GdkBuild.cs.
The GDKBuild class provides the following three static methods to do the three stages of a GDK build:
- PreBuild
- BuildWin32
- PostBuild
To integrate the GDK build process into your custom Unity build pipeline you can call the three GDKBuild methods directly.
Example usage
The GDKBuild.Build method is called by the GDK->PC->Build and Run->Build command in the Unity GUI and illustrates the usage of the PreBuild, BuildWin32, and PostBuild methods:
static bool Build(bool buildOnly, bool createPackageForStoreUpload)
{
bool succeeded = false;
succeeded = ChooseOutputFolder();
if (succeeded)
{
succeeded = PreBuild(buildWin32OutputFolderPath);
}
if (succeeded)
{
succeeded = BuildWin32();
}
if (succeeded)
{
succeeded = PostBuild(buildWin32OutputFolderPath, buildMsixvcOutputFolderPath, createPackageForStoreUpload);
}
if (succeeded && buildOnly)
{
succeeded = OpenBuildOutputFolder();
}
return succeeded;
}