Ciekawostka :) Jest taki plik jak:
Nvidia.AndroidBuild.targets. Fragmenty pliku wyglądają tak:
<Target Name="AntBuild" DependsOnTargets="BuildLibrariesToPackage" Condition="'$(SkipPackaging)' != 'true'">
<PropertyGroup>
<AntBuild_MinimalRebuildFromTracking Condition="'$(BuildType)' != 'Build' or '$(ForceRebuild)' == 'true'">false</AntBuild_MinimalRebuildFromTracking>
<AntBuild_MinimalRebuildFromTracking Condition="'$(AntBuild_MinimalRebuildFromTracking)' == ''">true</AntBuild_MinimalRebuildFromTracking>
<AntBuild_IsNdkBuildProject Condition="'$(ConfigurationType)' == 'Utility'">true</AntBuild_IsNdkBuildProject>
<AntBuild_IsNdkBuildProject Condition="'$(AntBuild_IsNdkBuildProject)' == ''">false</AntBuild_IsNdkBuildProject>
<FilteredAntBuild Condition="'%(AntBuild.Dummy)' != 'true'">@(AntBuild)</FilteredAntBuild>
<AntBuildSkippedExecution>true</AntBuildSkippedExecution>
<IsFastDeployEnabled>false</IsFastDeployEnabled>
<IsFastDeployEnabled Condition="'$(FastDeploy)' == 'true' or '$(FastDeploy)' == 'Default'">true</IsFastDeployEnabled>
</PropertyGroup>
<AntBuild Condition="'%(AntBuild.SkipAntStep)' != 'true' and '$(AndroidBuildSystem)' == 'AntBuild'"
Configuration ="$(Configuration)"
OutputDir ="$(IntermediateDirectoryFullPath)"
(...)
<Target Name="AntClean">
<PropertyGroup>
<AntBuildFullPath>$([System.IO.Path]::Combine($(ProjectDir), %(AntBuild.AntBuildPath)))</AntBuildFullPath>
<AndroidManifestFullPath>$([System.IO.Path]::Combine($(AntBuildFullPath), %(AntBuild.AndroidManifestLocation)))</AndroidManifestFullPath>
<IntermediateDirectoryFullPath>$([System.IO.Path]::Combine($(ProjectDir), $(IntDir)))</IntermediateDirectoryFullPath>
<GradleBuildFullPath>$([System.IO.Path]::Combine($(IntermediateDirectoryFullPath), build))</GradleBuildFullPath>
</PropertyGroup>
<Message Text="Performing clean..." />
<AntClean Condition="'$(AndroidBuildSystem)' == 'AntBuild'"
SdkRootPath ="$(SdkRootPath)"
JdkRootPath ="$(JdkRootPath)"
ToolRootPath ="$(AntRootPath)"
AntBuildPath ="$(AntBuildFullPath)"
AndroidManifestLocation ="$(AndroidManifestFullPath)"
OutputDir ="'$(IntermediateDirectoryFullPath)'">
</AntClean>
Przez to, że ścieżka w OutputDir nie jest ani w apostrofach ani w cudzysłowiu - nie da się kompilować projektów, które mają w ścieżce spację.
Ciekawostka nr 2:
Po dodaniu apostrofów w OutputDir dla AntClean - czyszczenie projektu działa poprawnie.
Ciekawostka nr 3:
Ten sam trick jednak
nie działa przy kompilacji projektów, ponieważ dostajemy błąd:
Error 29 error MSB4018: The "AntBuild" task failed unexpectedly.
System.NotSupportedException: The given path's format is not supported.
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at System.IO.Directory.CreateDirectory(String path)
at Nvidia.PentaK.Build.Tasks.Android.AndroidBuildBase`1.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
at Nvidia.PentaK.Build.Tasks.Android.AntBuild.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
at Nvidia.PentaK.Build.MSBuildInterop.TrackedToolTask.Nvidia.PentaK.Build.MSBuildInterop.ITrackedToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
at Nvidia.PentaK.Build.MSBuildInterop.Impl.TrackedToolTaskWrapper`1.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
at Microsoft.Build.Utilities.ToolTask.Execute()
at Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute()
at Nvidia.PentaK.Build.MSBuildInterop.ToolTaskBase`2.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v110\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets 254 5 pgMobileSFML-vc11
Poczytałem sobie również kilka tematów z forum NVIDIA i... polityką tej firmy jest 'nie wspieramy spacji w ścieżkach' :) Żałosne.
https://devtalk.nvidia.com/default/topic/742458/new-project-help/Dodam jeszcze, że narzędzia odpowiedzialne za kompilację projektu wspierają poprawnie cudzysłowy.
Czyli, ręczne odpalenie poprawnego polecenia zadziała tj.
D:\jakis katalog\_tmp_\vc11-other[android] Debug (x86)\pgMobileSFML-vc11>C:\Android-DevPack\NVPACK\apache-ant-1.8.2\bin\ant.bat debug -f "D:\jakis katalog\solutions\..\_tmp_\vc11-other[android] Debug (x86)\pgMobileSFML-vc11\nsight_tegra_build.xml" -listener org.apache.tools.ant.XmlLogger
Natomiast polecenie generowane nie zadziała, ponieważ będzie wyglądało tak:
D:\jakis katalog\_tmp_\vc11-other[android] Debug (x86)\pgMobileSFML-vc11>C:\Android-DevPack\NVPACK\apache-ant-1.8.2\bin\ant.bat debug -f D:\jakis katalog\solutions\..\_tmp_\vc11-other[android] Debug (x86)\pgMobileSFML-vc11\nsight_tegra_build.xml -listener org.apache.tools.ant.XmlLogger
Żal :)