I tried a make a build of my HL application using Holotoolkit. The build is successful if App Name doesn't contain spaces. In player settings if i keep "GoogleCloud" as name it works while "Google Cloud" fails the build.
I'm unsure how this relates to the HoloToolkit. Please raise this question over on the Unity HoloLens forums. Thanks.
Maybe trying to build with the build window from HoloToolkit?
I have a space in my project name and it builds just fine.
@StephenHodgson i was trying to automate build process through Command Line (i use it for building via Jenkins) using HoloToolKit. I called the function below to build. The solution (.sln) is generated successfully but the MSBuild part fails.
public static void PerformReleaseBuild()
{
BuildDeployPrefs.BuildConfig = "Release";
BuildDeployWindow.BuildAndRun(PlayerSettings.productName);
}
Here playersettings.productname is just for referring the sln.
playersettings.productname with and without space seems to make a difference for build results.
Thanks for suggestion. I will post in Unity HL Forum as well.
If you are using cmd and Jenkins shouldn't you be formatting the path correctly. Maybe using a backslash for the space in the product name. Or maybe just reject any release name that has a space.
@mattfedocsg 1. Jenkins isn't creating trouble.Problem is before that. When i try building through CMD using holotoolkit provided functions, there it self the build fails when product name has string separated by space.
That makes a lot more sense now. Haha.
Thanks for the report.
Do you have a sample project and repro steps? I can't seem to get the build to fail using the Build Window.
Are you sure the string you're passing from the cmd line is formatted properly?
Sorry for late reply. PFA the sample project.
Steps to reproduce:
I'm pretty sure this is a issue even when setting in Visual Studio, that the name cannot include white space.
Yeah i think so i tried that but can't remember. Will verify that. Is there a way to separate PlayerSettings.ProductName [Unity] and the name of generated solution.
I guess MSBuild is fails to correctly refer to soln due to spacing in path name.
I found a bug in this line which may or may not be relevant to this specific bug but it does deal with build failures due to spaces in the project name.
The code reads:
nugetPInfo.Arguments = @"restore " + PlayerSettings.productName + "/project.json";
I would change it to:
nugetPInfo.Arguments = "restore \"" + PlayerSettings.productName + "/project.json\"";
Currently nuget displays the command help since it sees too many arguments to restore, instead of restoring the packages as desired.
This solution worked for me.
I have not - yet - found any correlations to other issues.
Most helpful comment
I found a bug in this line which may or may not be relevant to this specific bug but it does deal with build failures due to spaces in the project name.
https://github.com/Microsoft/HoloToolkit-Unity/blob/master/Assets/HoloToolkit/Build/Editor/BuildDeployTools.cs#L96
The code reads:
nugetPInfo.Arguments = @"restore " + PlayerSettings.productName + "/project.json";I would change it to:
nugetPInfo.Arguments = "restore \"" + PlayerSettings.productName + "/project.json\"";Currently nuget displays the command help since it sees too many arguments to restore, instead of restoring the packages as desired.