自定义MSBuild任务无法完成

时间:2017-04-28 01:24:13

标签: android gradle msbuild adb msbuild-task

我们正在调用一个python脚本,然后处理我们的源代码并调用android ndkbuild。

看起来好像重新启动后的第一次构建(我还没有能够在重启后的第一次构建时重现它)我们的主要任务无法完成。这是锁定构建过程,取消它的唯一方法是从任务管理器手动结束MSBuild进程。

我相信我们所做的是非常基本和直接的:

的MSBuild \ Microsoft.Cpp \ V4.0 \ V140 \平台\谷歌:

 <Target Name="Build">
   <ItemGroup Condition="$(UseVerbose)=='true'">
     <v Include="--verbose"/>
   </ItemGroup>
   <ItemGroup Condition="$(ConfigurationType)=='Application'">
     <g  Condition="$(UseGradle)=='true'" Include="--gradle"/>
     <p Include="-p $(PathOrProject)"/>
     <cores Include="--cores 10"/>
   </ItemGroup>
   <ItemGroup Condition="$(ConfigurationType)!='Application'">
     <p Include="--path $(PathOrProject)"/>
     <cores Include="--cores 1"/>
   </ItemGroup>
   <Exec Command="echo Build Task started"/>
   <Exec Command="cmd /C python $(WORK_TOOLS_DIR)\bin\PythonScripts\buildAndroid.py @(p) -c $(Configuration)_$(Platform) --ndk_path $(NDKPath) @(cores) @(g) @(v)" />
   <Exec Command="echo Build Task is Done"/>
 </Target>

BuildAndroid.py的最后一行 print('Exiting successful Error 0') sys.exit(0)

输出:

1>------ Build started: Project: GameCore, Configuration: Debug Google ------
2>------ Build started: Project: Geometry, Configuration: Debug Google ------
3>------ Build started: Project: Graphics, Configuration: Debug Google ------
4>------ Build started: Project: Network, Configuration: Debug Google ------
5>------ Build started: Project: CDPhysics, Configuration: Debug Google ------
6>------ Skipped Build: Project: PCCore, Configuration: Debug Win32 ------
6>Project not selected to build for this solution configuration 
7>------ Build started: Project: UI3d, Configuration: Debug Google ------
8>------ Skipped Build: Project: RendererDX11, Configuration: Debug Win32 ------
8>Project not selected to build for this solution configuration 
9>------ Build started: Project: SoundWWise, Configuration: Debug Google ------
10>------ Build started: Project: Android_Platform, Configuration: Debug Google ------
2>  Build Task started
1>  Build Task started
4>  Build Task started
3>  Build Task started
10>  Build Task started
5>  Build Task started
7>  Build Task started
9>  Build Task started
5>  Exiting successful Error 0
1>  Exiting successful Error 0
4>  Exiting successful Error 0
9>  Exiting successful Error 0
5>  Build Task is Done
2>  Exiting successful Error 0
1>  Build Task is Done
9>  Build Task is Done
4>  Build Task is Done
2>  Build Task is Done
7>  Exiting successful Error 0
7>  Build Task is Done
10>  Exiting successful Error 0
10>  Build Task is Done
3>  Exiting successful Error 0
3>  Build Task is Done
11>------ Build started: Project: MainProject, Configuration: Debug Google ------
11>  Build Task started
... (output for BuildAroid.py)
11>  Exiting successful Error 0 

此时构建会挂起并且只是坐在那里,永远不会返回。

当MSBuild进程被终止并且选择build(以及除了刚刚重启之后的任何其他构建调用)之外,我们得到相同的输出,除非在成功完成后使用以下输出:

11>  Exiting successful Error 0
11>  Build Task is Done
========== Build: 9 succeeded, 0 failed, 0 up-to-date, 2 skipped ==========

我试图将用户环境变量MSBUILDDISABLENODEREUSE设置为1,同时调用&#34; cmd / c python ......&#34;试图解决这个问题。我还禁用了Tools-&gt; Options-&gt; Python Tools-&gt; Deubugging菜单下的所有选项

当命令行在Visual Studio外部运行时(从命令提示符处),没有问题。

我们正在使用Python 3.3.5

这似乎与Gradle以及我们如何调用它有关。没有启用gradle的完全相同的脚本,没有问题。

0 个答案:

没有答案