#Build scripts
1 messages · Page 1 of 1 (latest)
I'll need to pull up some of my own build scripts to compare but I believe the string location you pass into the build options needs to end with a file along with the exe extension on Windows. I'll confirm when I'm at my machine.
ah thanks for your insight
Which overload of BuildPlayer are you using?
private static void Build(BuildTarget target, string packageName)
{
var options = new BuildPlayerOptions
{
// Change to scenes from your project
scenes = new[]
{
"Assets/Scenes/Start.unity",
"Assets/Scenes/Tutorial.unity",
"Assets/Scenes/Menus.unity",
"Assets/Scenes/InGame.unity",
"Assets/Scenes/PartyParkInGame.unity",
},
// Change to location the output should go
locationPathName =$"../b/{packageName}",
options = BuildOptions.None,
target = target
};
var report = BuildPipeline.BuildPlayer(options);
if (report.summary.result == BuildResult.Succeeded)
{
Debug.Log($"Build successful - Build written to {options.locationPathName}");
}
else if (report.summary.result == BuildResult.Failed)
{
Debug.LogError($"Build failed");
}
}
and then each vsts agent is calling a method that passes a different value into target
Got it. What is packageName?
"game_linux" or "game_macos"
so it will export the right build assets, unityplayer etc all the shiz to "/game_windows" for instance but the mygame.exe is just 'mygame'
with the build target "BuildTarget.StandaloneWindows64"
Om windows you need to pass it the path that ends with ".exe"
I know this is different than Mac which expects a folder because that is how mac applications are distributed
So for windows builds, your agent needs to send "game.exe" as packageName
locationPathName =$"../b/{packageName}" << in here?
locationPathName =$"../b/{packageName}.exe"
okay cool
i'll try that, thanks!
I would pass it as part of package name variable and not by adding it to the end of the format string, since that would break other platform builds (or at the very least create weird file names)