@Test
public void invalidLayoutName2() throws Exception {

  // Like testInvalidLayoutName, but with line numbers in the error pattern
  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" +
    ":MyApplication585:preBuild UP-TO-DATE\n" +
    ":MyApplication585:preDebugBuild UP-TO-DATE\n" +
    ":MyApplication585:preReleaseBuild UP-TO-DATE\n" +
    ":MyApplication585:prepareComAndroidSupportAppcompatV71800Library UP-TO-DATE\n" +
    ":MyApplication585:prepareDebugDependencies\n" +
    ":MyApplication585:compileDebugAidl UP-TO-DATE\n" +
    ":MyApplication585:compileDebugRenderscript UP-TO-DATE\n" +
    ":MyApplication585:generateDebugBuildConfig UP-TO-DATE\n" +
    ":MyApplication585:mergeDebugAssets UP-TO-DATE\n" +
    ":MyApplication585:mergeDebugResources\n" +
    sourceFilePath + ":4: Error: Invalid file name: must contain only lowercase letters and digits ([a-z0-9_.])\n" +
    ":MyApplication585:mergeDebugResources FAILED\n" +
    "\n" +
    "FAILURE: Build failed with an exception.\n" +
    "\n" +
    "* What went wrong:\n" +
    "Execution failed for task ':MyApplication585:mergeDebugResources'.\n" +
    "> " + sourceFilePath + ":4: Error: Invalid file name: must contain only lowercase letters and digits ([a-z0-9_.])\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: 8.91 secs";
  assertEquals("0: Simple::MyApplication585:preBuild UP-TO-DATE\n" +
               "1: Simple::MyApplication585:preDebugBuild UP-TO-DATE\n" +
               "2: Simple::MyApplication585:preReleaseBuild UP-TO-DATE\n" +
               "3: Simple::MyApplication585:prepareComAndroidSupportAppcompatV71800Library UP-TO-DATE\n" +
               "4: Simple::MyApplication585:prepareDebugDependencies\n" +
               "5: Simple::MyApplication585:compileDebugAidl UP-TO-DATE\n" +
               "6: Simple::MyApplication585:compileDebugRenderscript UP-TO-DATE\n" +
               "7: Simple::MyApplication585:generateDebugBuildConfig UP-TO-DATE\n" +
               "8: Simple::MyApplication585:mergeDebugAssets UP-TO-DATE\n" +
               "9: Simple::MyApplication585:mergeDebugResources\n" +
               "10: Error:Error: Invalid file name: must contain only lowercase letters and digits ([a-z0-9_.])\n" +
               "\t" + sourceFilePath + ":4:-1\n" +
               "11: Simple::MyApplication585:mergeDebugResources FAILED\n" +
               "12: Error:Execution failed for task ':MyApplication585:mergeDebugResources'.\n" +
               "> " + sourceFilePath + ":4: Error: Invalid file name: must contain only lowercase letters and digits ([a-z0-9_.])\n" +
               "13: Info:BUILD FAILED\n" +
               "14: Info:Total time: 8.91 secs\n",
               toString(parser.parseGradleOutput(output)));
  sourceFile.delete();
}