0

My TFS Build system just call a PowerShell script that do the compilation (through msbuild), package the application, deploy the database, etc...

Unfortunatly, I don't understand why the script won't finish. I try exit 0, call exit 0, but it always end by a timeout :

> Build succeeded.
>     0 Warning(s)
>     0 Error(s) Time Elapsed 00:00:13.48 
>     "MOVING APK IN SHARED FOLDER"
>     1 file(s) copied. 
>     "SUCCESS !" 
>      C:\Build\SmartLingo>exit 0

Then the build keeps running........ forever until one hour (or until I stop it myself).

I finally noticed that the line which is responsible of this non-sense is the following :

call "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /p:Configuration=Debug;Platform=Android;MDAVSIXDIR="%PROGRAMFILES(x86)%\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools";NODEJSDIR="%PROGRAMFILES(x86)%\nodejs";NPMINSTALLDIR="%APPDATA%\npm";LANGNAME="en-us";BUILDVERBOSITY=Normal C:\Build\Test\Test.jsproj

So it seems that this compilation execute a thread or something like that and is never finished...

Any idea how to make it works ? Thanks

Adavo
  • 865
  • 3
  • 11
  • 21
  • [Start-Job](http://stackoverflow.com/questions/9756924/managing-the-running-time-of-background-jobs-timing-out-if-not-completed-after) along with setting a timeout. – lloyd Nov 30 '15 at 12:25
  • Start-Job will launch the script and if the timeout is reached, will fail. this is not what I want. My job take around 1 min, I just want that at the end of my bash script, TFS understand that the script is finished and can be successful. – Adavo Nov 30 '15 at 15:24
  • So your blackbox script is not working. Please see [how to ask](http://stackoverflow.com/help/how-to-ask) – lloyd Nov 30 '15 at 16:03
  • I add some details. Thanks – Adavo Dec 07 '15 at 08:53

1 Answers1

1

If you are using TFS 2015, I strongly recommend you look into switching to the new build system which does not rely on MSBuild. There's a tutorial and even a Visual Studio Team Services extension that you can use now.

However, if you are using TFS 2013 and must rely on MSBuild, there is a problem you can run into for Android specifically that is caused by a daemon process that is started by recent versions of Cordova that can cause the problem you describe.

The tutorial has been updated and there are some improvements with TACO Update 5, but here's the summary on this specific problem:

Create stopGradle.cmd in the hooks\after_compile folder in your project with the following contents:

IF EXIST platforms\android platforms\android\gradlew --stop

You'll also need to specify the DebuggerFlavor to get it to build an apk. Check out the tutorial for details.

Chuck Lantz
  • 1,440
  • 1
  • 8
  • 10