@Test
public void duplicateResources3() throws Exception {

  // Duplicate resource exception: New gradle output format (using MergingException)
  createTempXmlFile();
  String output =
    "Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0\n" +
    ":MyApplication589:preBuild UP-TO-DATE\n" +
    ":MyApplication589:preDebugBuild UP-TO-DATE\n" +
    ":MyApplication589:preReleaseBuild UP-TO-DATE\n" +
    ":MyApplication589:prepareComAndroidSupportAppcompatV71800Library UP-TO-DATE\n" +
    ":MyApplication589:prepareDebugDependencies\n" +
    ":MyApplication589:compileDebugAidl UP-TO-DATE\n" +
    ":MyApplication589:compileDebugRenderscript UP-TO-DATE\n" +
    ":MyApplication589:generateDebugBuildConfig UP-TO-DATE\n" +
    ":MyApplication589:mergeDebugAssets UP-TO-DATE\n" +
    ":MyApplication589:mergeDebugResources\n" +
    sourceFilePath + ": Error: Duplicate resources: " + sourceFilePath + ", /some/other/path/src/main/res/values/strings.xml:string/action_settings\n" +
    ":MyApplication589:mergeDebugResources FAILED\n" +
    "\n" +
    "FAILURE: Build failed with an exception.\n" +
    "\n" +
    "* What went wrong:\n" +
    "Execution failed for task ':MyApplication589:mergeDebugResources'.\n" +
    "> " + sourceFilePath + ": Error: Duplicate resources: " + sourceFilePath + ", /some/other/path/src/main/res/values/strings.xml:string/action_settings\n" +
    "\n" +
    "* Try:\n" +
    "Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\n" +
    "\n" +
    "BUILD FAILED\n" +
    "\n" +
    "Total time: 4.861 secs";
  assertEquals("0: Simple::MyApplication589:preBuild UP-TO-DATE\n" +
               "1: Simple::MyApplication589:preDebugBuild UP-TO-DATE\n" +
               "2: Simple::MyApplication589:preReleaseBuild UP-TO-DATE\n" +
               "3: Simple::MyApplication589:prepareComAndroidSupportAppcompatV71800Library UP-TO-DATE\n" +
               "4: Simple::MyApplication589:prepareDebugDependencies\n" +
               "5: Simple::MyApplication589:compileDebugAidl UP-TO-DATE\n" +
               "6: Simple::MyApplication589:compileDebugRenderscript UP-TO-DATE\n" +
               "7: Simple::MyApplication589:generateDebugBuildConfig UP-TO-DATE\n" +
               "8: Simple::MyApplication589:mergeDebugAssets UP-TO-DATE\n" +
               "9: Simple::MyApplication589:mergeDebugResources\n" +
               "10: Error:Error: Duplicate resources: " + sourceFilePath +", /some/other/path/src/main/res/values/strings.xml:string/action_settings\n" +
               "\t" + sourceFilePath + ":-1:-1\n" +
               "11: Simple::MyApplication589:mergeDebugResources FAILED\n" +
               "12: Error:Execution failed for task ':MyApplication589:mergeDebugResources'.\n" +
               "> " + sourceFilePath + ": Error: Duplicate resources: " + sourceFilePath + ", /some/other/path/src/main/res/values/strings.xml:string/action_settings\n" +
               "13: Info:BUILD FAILED\n" +
               "14: Info:Total time: 4.861 secs\n",
               toString(parser.parseGradleOutput(output)));
  sourceFile.delete();
}