(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:CURRENT_DIR)
          op: Equal
          rhs: 
            {
              (DQ 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (AndOr
                          children: [
                            (C {(cd)} 
                              {
                                (DQ 
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [
                                          (C {(dirname)} 
                                            {
                                              (DQ 
                                                (BracedVarSub
                                                  token: <VSub_Name BASH_SOURCE>
                                                  bracket_op: 
                                                    (ArrayIndex
                                                      expr: (ArithWord w:{(Lit_Digits 0)})
                                                    )
                                                  spids: [61 66]
                                                )
                                              )
                                            }
                                          )
                                        ]
                                      )
                                    left_token: <Left_CommandSub "$(">
                                    spids: [57 68]
                                  )
                                )
                              }
                            )
                            (C {(pwd)})
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                    )
                  left_token: <Left_CommandSub "$(">
                  spids: [53 74]
                )
              )
            }
          spids: [51]
        )
      ]
      spids: [51]
    )
    (AndOr
      children: [
        (C {(source)} {(DQ (${ VSub_Name CURRENT_DIR) (/../shell_utils.sh))})
        (BraceGroup
          children: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(echo)} {(DQ ("shell_utils.sh not found!"))}]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[98])]
                )
              terminator: <Op_Semi ";">
            )
            (Sentence child:(C {(exit)} {(1)}) terminator:<Op_Semi ";">)
          ]
          spids: [90]
        )
      ]
      op_id: Op_DPipe
    )
    (AndOr
      children: [
        (C {(source)} {(DQ (${ VSub_Name CURRENT_DIR) (/../integration_test_setup.sh))})
        (BraceGroup
          children: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(echo)} {(DQ ("integration_test_setup.sh not found!"))}]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[134])]
                )
              terminator: <Op_Semi ";">
            )
            (Sentence child:(C {(exit)} {(1)}) terminator:<Op_Semi ";">)
          ]
          spids: [126]
        )
      ]
      op_id: Op_DPipe
    )
    (C {(set)} {(-eu)})
    (Assignment
      keyword: Assign_Declare
      flags: ["'-r'"]
      pairs: [
        (assign_pair
          lhs: (LhsName name:runfiles_relative_javabase)
          op: Equal
          rhs: {(DQ ($ VSub_Number "$1"))}
          spids: [155]
        )
      ]
      spids: [151]
    )
    (C {(add_to_bazelrc)} {(DQ ("build --package_path=%workspace%"))})
    (FuncDef
      name: setup_local_jdk
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:dest)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [184]
                )
              ]
              spids: [180]
            )
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:src)
                  op: Equal
                  rhs: 
                    {
                      (DQ (${ VSub_Name BAZEL_RUNFILES) (/) (${ VSub_Name runfiles_relative_javabase))
                    }
                  spids: [194]
                )
              ]
              spids: [190]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$dest"))})
                (C {(fail)} {(DQ ("mkdir -p ") ($ VSub_Name "$dest"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(cp)} {(-LR)} {(DQ (${ VSub_Name src)) (/) (Lit_Other "*")} 
                  {(DQ ($ VSub_Name "$dest"))}
                )
                (C {(fail)} 
                  {
                    (DQ ("cp -LR ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) 
                      (${ VSub_Name src) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ("/* ") 
                      (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ($ VSub_Name "$dest") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">)
                    )
                  }
                )
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(chmod)} {(-R)} {(ug) (Lit_Other "+") (rwX)} {(DQ ($ VSub_Name "$dest"))})
                (C {(fail)} 
                  {
                    (DQ ("chmod -R ug+rwX ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) 
                      ($ VSub_Name "$dest") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">)
                    )
                  }
                )
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [177]
        )
      spids: [171 176]
    )
    (FuncDef
      name: write_hello_world_files
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [296]
                )
              ]
              spids: [294]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/hello)})
                (C {(fail)} {(DQ (mkdir))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/BUILD)}
                  spids: [320]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("java_binary(name = 'hello',\n") ("    srcs = ['Hello.java'],\n") 
                        ("    main_class = 'hello.Hello')\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [324]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/Hello.java)}
                  spids: [334]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package hello;\n") ("public class Hello {\n") 
                        ("  public static void main(String[] args) {\n") ("    System.out.println(") (Right_DoubleQuote "\"") ("Hello, World!") (Right_DoubleQuote "\"") (");\n") 
                        ("  }\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [338]
                )
              ]
            )
          ]
          spids: [291]
        )
      spids: [285 290]
    )
    (FuncDef
      name: write_hello_world_files_for_singlejar
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [367]
                )
              ]
              spids: [363]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/hello)})
                (C {(fail)} {(DQ (mkdir))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/BUILD)}
                  spids: [391]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("java_binary(name = 'hello',\n") ("    srcs = ['Hello.java'],\n") 
                        ("    main_class = 'hello.Hello')\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [395]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/Hello.java)}
                  spids: [405]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package hello;\n") ("import java.util.Properties;\n") 
                        ("public class Hello {\n") ("  private static void printMap(Properties p) {\n") ("    System.err.println(") 
                        (Right_DoubleQuote "\"") ("Available keys and values are:") (Right_DoubleQuote "\"") (");\n") 
                        ("    for (Object key : p.keySet()) {\n") ("      System.err.printf(") (Right_DoubleQuote "\"") ("  '%s': '%s'%n") (Right_DoubleQuote "\"") 
                        (", key, p.get(key));\n") ("    }\n") ("  }\n") ("\n") ("  public static void main(String[] args) throws Exception {\n") 
                        ("    Properties properties = new Properties();\n") ("    properties.load(Hello.class.getResourceAsStream(") (Right_DoubleQuote "\"") 
                        (/build-data.properties) (Right_DoubleQuote "\"") ("));\n") ("    for (String arg : args) {\n") 
                        ("      String[] keyValue = arg.split(") (Right_DoubleQuote "\"") ("=") (Right_DoubleQuote "\"") (", 2);\n") 
                        ("      Object value = properties.get(keyValue[0]);\n") ("      if (value == null) {\n") ("        System.err.println(") (Right_DoubleQuote "\"") ("Key '") 
                        (Right_DoubleQuote "\"") (" + keyValue[0] + ") (Right_DoubleQuote "\"") ("' not found") (Right_DoubleQuote "\"") (");\n") 
                        ("        printMap(properties);\n") ("        return;\n") ("      }\n") 
                        ("      if (keyValue.length > 1 && !keyValue[1].equals(value)) {\n") ("        System.err.println(") (Right_DoubleQuote "\"") ("Value for key '") (Right_DoubleQuote "\"") 
                        (" + keyValue[0] + ") (Right_DoubleQuote "\"") ("' is '") (Right_DoubleQuote "\"") (" + value\n") ("            + ") 
                        (Right_DoubleQuote "\"") ("' while it should be '") (Right_DoubleQuote "\"") (" + keyValue[1] + ") (Right_DoubleQuote "\"") ("'") 
                        (Right_DoubleQuote "\"") (");\n") ("        printMap(properties);\n") ("        return;\n") ("      }\n") ("    }\n") 
                        ("    System.out.println(") (Right_DoubleQuote "\"") ("Hello, World!") (Right_DoubleQuote "\"") (");\n") ("  }\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [409]
                )
              ]
            )
          ]
          spids: [360]
        )
      spids: [354 359]
    )
    (FuncDef
      name: write_hello_library_files
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [503]
                )
              ]
              spids: [499]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/main)})
                (C {(fail)} {(DQ (mkdir))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/main/BUILD)}
                  spids: [527]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("java_binary(\n") ("    name = 'main',\n") ("    deps = ['//") 
                        ($ VSub_Name "$pkg") ("/java/hello_library'],\n") ("    srcs = ['Main.java'],\n") ("    main_class = 'main.Main',\n") 
                        ("    deploy_manifest_lines = ['k1: v1', 'k2: v2'])\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [531]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/main/Main.java)}
                  spids: [546]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package main;\n") ("import hello_library.HelloLibrary;\n") 
                        ("public class Main {\n") ("  public static void main(String[] args) {\n") ("    HelloLibrary.funcHelloLibrary();\n") 
                        ("    System.out.println(") (Right_DoubleQuote "\"") ("Hello, World!") (Right_DoubleQuote "\"") (");\n") ("  }\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [550]
                )
              ]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/hello_library)})
                (C {(fail)} {(DQ (mkdir))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello_library/BUILD)}
                  spids: [585]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package(default_visibility=['//visibility:public'])\n") 
                        ("java_library(name = 'hello_library',\n") ("             srcs = ['HelloLibrary.java']);\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [589]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello_library/HelloLibrary.java)}
                  spids: [599]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package hello_library;\n") ("public class HelloLibrary {\n") 
                        ("  public static void funcHelloLibrary() {\n") ("    System.out.print(") (Right_DoubleQuote "\"") ("Hello, Library!;") (Right_DoubleQuote "\"") (");\n") 
                        ("  }\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [603]
                )
              ]
            )
          ]
          spids: [496]
        )
      spids: [490 495]
    )
    (FuncDef
      name: write_hello_sailor_files
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [632]
                )
              ]
              spids: [628]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/hellosailor)})
                (C {(fail)} {(DQ (mkdir))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hellosailor/BUILD)}
                  spids: [656]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("java_binary(name = 'hellosailor',\n") 
                        ("    srcs = ['HelloSailor.java'],\n") ("    create_executable = 0)\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [660]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hellosailor/HelloSailor.java)}
                  spids: [670]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package hellosailor;\n") ("public class HelloSailor {\n") 
                        ("  public static int addtwoNumbers(int a, int b) {\n") ("    return a + b;\n") ("  }\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [674]
                )
              ]
            )
          ]
          spids: [625]
        )
      spids: [619 624]
    )
    (FuncDef
      name: test_compiles_hello_world
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [709 714]
                        )
                      )
                    }
                  spids: [707]
                )
              ]
              spids: [703]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Name "$pkg"))})
                (C {(fail)} {(DQ ("mkdir ") ($ VSub_Name "$pkg"))})
              ]
              op_id: Op_DPipe
            )
            (C {(write_hello_world_files)} {(DQ ($ VSub_Name "$pkg"))})
            (C {(bazel)} {(clean)})
            (AndOr
              children: [
                (C {(bazel)} {(build)} {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)})
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/hello/hello)})
                    (C {(grep)} {(-q)} {(SQ <"Hello, World!">)})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("comparison failed"))})
              ]
              op_id: Op_DPipe
            )
            (FuncDef
              name: check_deploy_jar_should_not_exist
              body: 
                (BraceGroup
                  children: [
                    (AndOr
                      children: [
                        (C {(DQ ($ VSub_At "$@"))})
                        (C {(fail)} {(DQ ("deploy jar should not exist"))})
                      ]
                      op_id: Op_DAmp
                    )
                    (C {(true)})
                  ]
                  spids: [800]
                )
              spids: [794 799]
            )
            (FuncDef
              name: check_arglists
              body: 
                (BraceGroup
                  children: [
                    (C {(check_deploy_jar_should_not_exist)} {(DQ ($ VSub_At "$@"))} {(--singlejar)})
                    (C {(check_deploy_jar_should_not_exist)} {(DQ ($ VSub_At "$@"))} 
                      {(--wrapper_script_flag) (Lit_Other "=") (--singlejar)}
                    )
                    (C {(check_deploy_jar_should_not_exist)} {(DQ ($ VSub_At "$@"))} {(REGULAR_ARG)} 
                      {(--wrapper_script_flag) (Lit_Other "=") (--singlejar)}
                    )
                  ]
                  spids: [831]
                )
              spids: [825 830]
            )
            (C {(check_arglists)} {(bazel)} {(run)} 
              {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)} {(--)}
            )
            (C {(check_arglists)} 
              {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/hello/hello)}
            )
          ]
          spids: [700]
        )
      spids: [694 699]
    )
    (FuncDef
      name: test_compiles_hello_world_from_deploy_jar
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [914 919]
                        )
                      )
                    }
                  spids: [912]
                )
              ]
              spids: [908]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Name "$pkg"))})
                (C {(fail)} {(DQ ("mkdir ") ($ VSub_Name "$pkg"))})
              ]
              op_id: Op_DPipe
            )
            (C {(write_hello_world_files)} {(DQ ($ VSub_Name "$pkg"))})
            (AndOr
              children: [
                (C {(bazel)} {(build)} 
                  {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello_deploy.jar)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(bazel)} {(run)} 
                      {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)} {(--)} {(--singlejar)}
                    )
                    (C {(grep)} {(-q)} {(SQ <"Hello, World!">)})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("comparison failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/hello/hello)} 
                      {(--)} {(--singlejar)}
                    )
                    (C {(grep)} {(-q)} {(SQ <"Hello, World!">)})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("comparison failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(bazel)} {(run)} 
                      {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)} {(--)} {(--wrapper_script_flag) (Lit_Other "=") (--singlejar)}
                    )
                    (C {(grep)} {(-q)} {(SQ <"Hello, World!">)})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("comparison failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/hello/hello)} 
                      {(--)} {(--wrapper_script_flag) (Lit_Other "=") (--singlejar)}
                    )
                    (C {(grep)} {(-q)} {(SQ <"Hello, World!">)})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("comparison failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(bazel)} {(run)} 
                      {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)} {(--)} {(REGULAR_ARG)} {(--wrapper_script_flag) (Lit_Other "=") (--singlejar)}
                    )
                    (C {(grep)} {(-q)} {(SQ <"Hello, World!">)})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("comparison failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/hello/hello)} 
                      {(--)} {(REGULAR_ARG)} {(--wrapper_script_flag) (Lit_Other "=") (--singlejar)}
                    )
                    (C {(grep)} {(-q)} {(SQ <"Hello, World!">)})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("comparison failed"))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [905]
        )
      spids: [899 904]
    )
    (FuncDef
      name: test_explicit_bogus_wrapper_args_are_rejected
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [1205 1210]
                        )
                      )
                    }
                  spids: [1203]
                )
              ]
              spids: [1199]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Name "$pkg"))})
                (C {(fail)} {(DQ ("mkdir ") ($ VSub_Name "$pkg"))})
              ]
              op_id: Op_DPipe
            )
            (C {(write_hello_world_files)} {(DQ ($ VSub_Name "$pkg"))})
            (AndOr
              children: [
                (C {(bazel)} {(build)} 
                  {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello_deploy.jar)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (FuncDef
              name: check_arg_rejected
              body: 
                (BraceGroup
                  children: [
                    (AndOr
                      children: [
                        (C {(DQ ($ VSub_At "$@"))})
                        (C {(fail)} {(DQ ("bogus arg should be rejected"))})
                      ]
                      op_id: Op_DAmp
                    )
                    (C {(true)})
                  ]
                  spids: [1263]
                )
              spids: [1257 1262]
            )
            (FuncDef
              name: check_arglists
              body: 
                (BraceGroup
                  children: [
                    (C {(check_arg_rejected)} {(DQ ($ VSub_At "$@"))} 
                      {(--wrapper_script_flag) (Lit_Other "=") (--bogus)}
                    )
                    (C {(check_arg_rejected)} {(DQ ($ VSub_At "$@"))} {(REGULAR_ARG)} 
                      {(--wrapper_script_flag) (Lit_Other "=") (--bogus)}
                    )
                  ]
                  spids: [1294]
                )
              spids: [1288 1293]
            )
            (C {(check_arglists)} {(bazel)} {(run)} 
              {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)} {(--)}
            )
            (C {(check_arglists)} 
              {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/hello/hello)}
            )
          ]
          spids: [1196]
        )
      spids: [1190 1195]
    )
    (FuncDef
      name: assert_singlejar_works
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [1364]
                )
              ]
              spids: [1360]
            )
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:copy_jdk)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$2"))}
                  spids: [1374]
                )
              ]
              spids: [1370]
            )
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:stamp_arg)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$3"))}
                  spids: [1384]
                )
              ]
              spids: [1380]
            )
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:embed_label)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$4"))}
                  spids: [1394]
                )
              ]
              spids: [1390]
            )
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:expected_build_data)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$5"))}
                  spids: [1404]
                )
              ]
              spids: [1400]
            )
            (C {(write_hello_world_files_for_singlejar)} {(DQ ($ VSub_Name "$pkg"))})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(DQ ($ VSub_Name "$copy_jdk"))})
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_Local
                      flags: ["'-r'"]
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:local_jdk)
                          op: Equal
                          rhs: {(DQ ($ VSub_Name "$pkg") (/my_jdk))}
                          spids: [1433]
                        )
                      ]
                      spids: [1429]
                    )
                    (C {(setup_local_jdk)} {(DQ ($ VSub_Name "$local_jdk"))})
                    (C {(ln)} {(-s)} {(DQ (my_jdk))} {(DQ ($ VSub_Name "$pkg") (/my_jdk.symlink))})
                    (Assignment
                      keyword: Assign_Local
                      flags: ["'-r'"]
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:javabase)
                          op: Equal
                          rhs: 
                            {
                              (DQ 
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [
                                        (C {(get_real_path)} 
                                          {(DQ ($ VSub_Name "$pkg") (/my_jdk.symlink))}
                                        )
                                      ]
                                    )
                                  left_token: <Left_CommandSub "$(">
                                  spids: [1468 1475]
                                )
                              )
                            }
                          spids: [1466]
                        )
                      ]
                      spids: [1462]
                    )
                  ]
                  spids: [-1 1426]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_Local
                  flags: ["'-r'"]
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:javabase)
                      op: Equal
                      rhs: 
                        {
                          (DQ (${ VSub_Name BAZEL_RUNFILES) (/) 
                            (${ VSub_Name runfiles_relative_javabase)
                          )
                        }
                      spids: [1486]
                    )
                  ]
                  spids: [1482]
                )
              ]
              spids: [1479 1498]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(build)}
                    {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)}
                    {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello_deploy.jar)}
                    {(DQ ($ VSub_Name "$stamp_arg"))}
                    {(--javabase) (Lit_Other "=") (DQ ($ VSub_Name "$javabase"))}
                    {(DQ ($ VSub_Name "$embed_label"))}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {(DQ ($ VSub_Name "$TEST_log"))}
                      spids: [1538]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Build failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(mkdir)} {($ VSub_Name "$pkg") (/ugly/)})
                (C {(fail)} {(DQ ("mkdir failed"))})
              ]
              op_id: Op_DPipe
            )
            (C {(cp)} {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/hello/hello)} 
              {($ VSub_Name "$pkg") (/ugly/)}
            )
            (C {(cp)} 
              {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/hello/hello_deploy.jar)} {($ VSub_Name "$pkg") (/ugly/)}
            )
            (SimpleCommand
              words: [
                {($ VSub_Name "$pkg") (/ugly/hello)}
                {(build.target)}
                {(build.time)}
                {(build.timestamp)}
                {(main.class) (Lit_Other "=") (hello.Hello)}
                {(DQ ($ VSub_Name "$expected_build_data"))}
              ]
              redirects: [
                (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[1619])
                (Redir
                  op_id: Redir_DGreat
                  fd: -1
                  arg_word: {($ VSub_Name "$TEST_log")}
                  spids: [1622]
                )
              ]
            )
            (C {(expect_log)} {(SQ <"Hello, World!">)})
          ]
          spids: [1357]
        )
      spids: [1351 1356]
    )
    (FuncDef
      name: test_singlejar_with_default_jdk_with_stamp
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [1650 1655]
                        )
                      )
                    }
                  spids: [1648]
                )
              ]
              spids: [1644]
            )
            (C {(assert_singlejar_works)} {(DQ ($ VSub_Name "$pkg"))} {(true)} {(DQ (--stamp))} 
              {(DQ ("--embed_label=toto"))} {(DQ ("build.label=toto"))}
            )
          ]
          spids: [1641]
        )
      spids: [1635 1640]
    )
    (FuncDef
      name: test_singlejar_with_default_jdk_without_stamp
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [1705 1710]
                        )
                      )
                    }
                  spids: [1703]
                )
              ]
              spids: [1699]
            )
            (C {(assert_singlejar_works)} {(DQ ($ VSub_Name "$pkg"))} {(true)} {(DQ (--nostamp))} 
              {(DQ ("--embed_label="))} {(DQ ("build.timestamp.as.int=0"))}
            )
          ]
          spids: [1696]
        )
      spids: [1690 1695]
    )
    (FuncDef
      name: test_singlejar_with_custom_jdk_with_stamp
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [1760 1765]
                        )
                      )
                    }
                  spids: [1758]
                )
              ]
              spids: [1754]
            )
            (C {(assert_singlejar_works)} {(DQ ($ VSub_Name "$pkg"))} {(false)} {(DQ (--stamp))} 
              {(DQ ("--embed_label=toto"))} {(DQ ("build.label=toto"))}
            )
          ]
          spids: [1751]
        )
      spids: [1745 1750]
    )
    (FuncDef
      name: test_singlejar_with_custom_jdk_without_stamp
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [1809 1814]
                        )
                      )
                    }
                  spids: [1807]
                )
              ]
              spids: [1803]
            )
            (C {(assert_singlejar_works)} {(DQ ($ VSub_Name "$pkg"))} {(false)} {(DQ (--nostamp))} 
              {(DQ ("--embed_label="))} {(DQ ("build.timestamp.as.int=0"))}
            )
          ]
          spids: [1800]
        )
      spids: [1794 1799]
    )
    (FuncDef
      name: test_deterministic_nostamp_build
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [1864 1869]
                        )
                      )
                    }
                  spids: [1862]
                )
              ]
              spids: [1858]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Name "$pkg"))})
                (C {(fail)} {(DQ ("mkdir ") ($ VSub_Name "$pkg"))})
              ]
              op_id: Op_DPipe
            )
            (C {(write_hello_world_files)} {(DQ ($ VSub_Name "$pkg"))})
            (AndOr
              children: [(C {(bazel)} {(clean)}) (C {(fail)} {(DQ ("Clean failed"))})]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(bazel)} {(build)} {(--nostamp)} 
                  {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello_deploy.jar)}
                )
                (C {(fail)} {(DQ ("Build failed"))})
              ]
              op_id: Op_DPipe
            )
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:first_run)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (C {(md5_file)} 
                                  {
                                    (CommandSubPart
                                      command_list: 
                                        (CommandList
                                          children: [
                                            (Pipeline
                                              children: [
                                                (C {(find)} {(DQ (${ VSub_Name PRODUCT_NAME) (-out/))} 
                                                  {(-type)} {(f)} {(SQ <"!">)} {(-name)} {(build-changelist.txt)} {(-a)} {(SQ <"!">)} {(-name)} {(volatile-status.txt)}
                                                )
                                                (C {(sort)} {(-u)})
                                              ]
                                              negated: False
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub "$(">
                                      spids: [1942 1981]
                                    )
                                  }
                                )
                              ]
                            )
                          left_token: <Left_CommandSub "$(">
                          spids: [1939 1982]
                        )
                      )
                    }
                  spids: [1937]
                )
              ]
              spids: [1933]
            )
            (C {(sleep)} {(1)})
            (AndOr
              children: [(C {(bazel)} {(clean)}) (C {(fail)} {(DQ ("Clean failed"))})]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(bazel)} {(build)} {(--nostamp)} 
                  {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello_deploy.jar)}
                )
                (C {(fail)} {(DQ ("Build failed"))})
              ]
              op_id: Op_DPipe
            )
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:second_run)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (C {(md5_file)} 
                                  {
                                    (CommandSubPart
                                      command_list: 
                                        (CommandList
                                          children: [
                                            (Pipeline
                                              children: [
                                                (C {(find)} {(DQ (${ VSub_Name PRODUCT_NAME) (-out/))} 
                                                  {(-type)} {(f)} {(SQ <"!">)} {(-name)} {(build-changelist.txt)} {(-a)} {(SQ <"!">)} {(-name)} {(volatile-status.txt)}
                                                )
                                                (C {(sort)} {(-u)})
                                              ]
                                              negated: False
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub "$(">
                                      spids: [2041 2080]
                                    )
                                  }
                                )
                              ]
                            )
                          left_token: <Left_CommandSub "$(">
                          spids: [2038 2081]
                        )
                      )
                    }
                  spids: [2036]
                )
              ]
              spids: [2032]
            )
            (C {(assert_equals)} {(DQ ($ VSub_Name "$first_run"))} {(DQ ($ VSub_Name "$second_run"))})
          ]
          spids: [1855]
        )
      spids: [1849 1854]
    )
    (FuncDef
      name: test_compiles_hello_library
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [2114 2119]
                        )
                      )
                    }
                  spids: [2112]
                )
              ]
              spids: [2108]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Name "$pkg"))})
                (C {(fail)} {(DQ ("mkdir ") ($ VSub_Name "$pkg"))})
              ]
              op_id: Op_DPipe
            )
            (C {(write_hello_library_files)} {(DQ ($ VSub_Name "$pkg"))})
            (C {(bazel)} {(clean)})
            (AndOr
              children: [
                (C {(bazel)} {(build)} {(//) ($ VSub_Name "$pkg") (/java/main) (Lit_Other ":") (main)})
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/main/main)})
                    (C {(grep)} {(-q)} {(DQ ("Hello, Library!;Hello, World!"))})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("comparison failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(bazel)} {(run)} {(//) ($ VSub_Name "$pkg") (/java/main) (Lit_Other ":") (main)} 
                  {(--)} {(--singlejar)}
                )
                (C {(fail)} {(DQ ("deploy jar should not exist"))})
              ]
              op_id: Op_DAmp
            )
            (C {(true)})
          ]
          spids: [2105]
        )
      spids: [2099 2104]
    )
    (FuncDef
      name: test_compiles_hello_library_using_ijars
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [2246 2251]
                        )
                      )
                    }
                  spids: [2244]
                )
              ]
              spids: [2240]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Name "$pkg"))})
                (C {(fail)} {(DQ ("mkdir ") ($ VSub_Name "$pkg"))})
              ]
              op_id: Op_DPipe
            )
            (C {(write_hello_library_files)} {(DQ ($ VSub_Name "$pkg"))})
            (C {(bazel)} {(clean)})
            (AndOr
              children: [
                (C {(bazel)} {(build)} {(--use_ijars)} 
                  {(//) ($ VSub_Name "$pkg") (/java/main) (Lit_Other ":") (main)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/main/main)})
                    (C {(grep)} {(-q)} {(DQ ("Hello, Library!;Hello, World!"))})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("comparison failed"))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [2237]
        )
      spids: [2231 2236]
    )
    (FuncDef
      name: test_compiles_hello_library_from_deploy_jar
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [2350 2355]
                        )
                      )
                    }
                  spids: [2348]
                )
              ]
              spids: [2344]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Name "$pkg"))})
                (C {(fail)} {(DQ ("mkdir ") ($ VSub_Name "$pkg"))})
              ]
              op_id: Op_DPipe
            )
            (C {(write_hello_library_files)} {(DQ ($ VSub_Name "$pkg"))})
            (AndOr
              children: [
                (C {(bazel)} {(build)} 
                  {(//) ($ VSub_Name "$pkg") (/java/main) (Lit_Other ":") (main_deploy.jar)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/main/main)} 
                      {(--singlejar)}
                    )
                    (C {(grep)} {(-q)} {(DQ ("Hello, Library!;Hello, World!"))})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("comparison failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(unzip)} {(-p)} 
                      {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                        (/java/main/main_deploy.jar)
                      } {(META-INF/MANIFEST.MF)}
                    )
                    (C {(grep)} {(-q)} {(DQ ("k1: v1"))})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("missing manifest lines"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(unzip)} {(-p)} 
                      {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                        (/java/main/main_deploy.jar)
                      } {(META-INF/MANIFEST.MF)}
                    )
                    (C {(grep)} {(-q)} {(DQ ("k2: v2"))})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("missing manifest lines"))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [2341]
        )
      spids: [2335 2340]
    )
    (FuncDef
      name: test_building_deploy_jar_twice_does_not_rebuild
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [2518 2523]
                        )
                      )
                    }
                  spids: [2516]
                )
              ]
              spids: [2512]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Name "$pkg"))})
                (C {(fail)} {(DQ ("mkdir ") ($ VSub_Name "$pkg"))})
              ]
              op_id: Op_DPipe
            )
            (C {(write_hello_library_files)} {(DQ ($ VSub_Name "$pkg"))})
            (AndOr
              children: [
                (C {(bazel)} {(build)} 
                  {(//) ($ VSub_Name "$pkg") (/java/main) (Lit_Other ":") (main_deploy.jar)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (C {(touch)} {(old)} {(-r)} 
              {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") (/java/main/main_deploy.jar)}
            )
            (AndOr
              children: [
                (C {(bazel)} {(build)} 
                  {(//) ($ VSub_Name "$pkg") (/java/main) (Lit_Other ":") (main_deploy.jar)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(find)} 
                      {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                        (/java/main/main_deploy.jar)
                      } {(-newer)} {(old)}
                    )
                    (C {(grep)} {(-q)} {(.)})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("file was rebuilt"))})
              ]
              op_id: Op_DAmp
            )
            (C {(true)})
          ]
          spids: [2509]
        )
      spids: [2503 2508]
    )
    (FuncDef
      name: test_does_not_create_executable_when_not_asked_for
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [2659 2664]
                        )
                      )
                    }
                  spids: [2657]
                )
              ]
              spids: [2653]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Name "$pkg"))})
                (C {(fail)} {(DQ ("mkdir ") ($ VSub_Name "$pkg"))})
              ]
              op_id: Op_DPipe
            )
            (C {(write_hello_sailor_files)} {(DQ ($ VSub_Name "$pkg"))})
            (AndOr
              children: [
                (C {(bazel)} {(build)} 
                  {(//) ($ VSub_Name "$pkg") (/java/hellosailor) (Lit_Other ":") 
                    (hellosailor_deploy.jar)
                  }
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (LogicalNot
                              child: 
                                (BoolUnary
                                  op_id: BoolUnary_e
                                  child: 
                                    {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                                      (/java/hellosailor/hellosailor.jar)
                                    }
                                )
                            )
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (Sentence
                      child: (C {(fail)} {(DQ ("output jar does not exist"))})
                      terminator: <Op_Semi ";">
                    )
                  ]
                  spids: [-1 2732]
                )
              ]
              spids: [-1 2743]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_e
                              child: 
                                {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                                  (/java/hellosailor/hellosailor)
                                }
                            )
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (Sentence
                      child: (C {(fail)} {(DQ ("output executable should not exist"))})
                      terminator: <Op_Semi ";">
                    )
                  ]
                  spids: [-1 2763]
                )
              ]
              spids: [-1 2774]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (LogicalNot
                              child: 
                                (BoolUnary
                                  op_id: BoolUnary_e
                                  child: 
                                    {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                                      (/java/hellosailor/hellosailor_deploy.jar)
                                    }
                                )
                            )
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (Sentence
                      child: (C {(fail)} {(DQ ("output deploy jar does not exist"))})
                      terminator: <Op_Semi ";">
                    )
                  ]
                  spids: [-1 2796]
                )
              ]
              spids: [-1 2807]
            )
          ]
          spids: [2650]
        )
      spids: [2644 2649]
    )
    (FuncDef
      name: test_building_deploy_jar_dependent_on_deploy_jar
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [2831 2836]
                        )
                      )
                    }
                  spids: [2829]
                )
              ]
              spids: [2825]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/deploy)})
                (C {(fail)} {(DQ (mkdir))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/deploy/BUILD)}
                  spids: [2858]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("java_binary(name = 'Hello',\n") ("            srcs = ['Hello.java'],\n") 
                        ("            deps = ['Other_deploy.jar'],\n") ("            main_class = 'hello.Hello')\n") ("java_binary(name = 'Other',\n") 
                        ("            resources = ['//") ($ VSub_Name "$pkg") ("/hello:Test.txt'],\n") ("            main_class = 'none')\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [2863]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/deploy/Hello.java)}
                  spids: [2879]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package deploy;\n") ("public class Hello {\n") 
                        ("  public static void main(String[] args) {\n") ("    System.out.println(") (Right_DoubleQuote "\"") ("Hello, World!") (Right_DoubleQuote "\"") (");\n") 
                        ("  }\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [2883]
                )
              ]
            )
            (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/hello)})
            (SimpleCommand
              words: [{(echo)} {(DQ ("exports_files(['Test.txt'])"))}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/hello/BUILD)}
                  spids: [2912]
                )
              ]
            )
            (SimpleCommand
              words: [{(echo)} {(DQ ("Some other File"))}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/hello/Test.txt)}
                  spids: [2923]
                )
              ]
            )
            (AndOr
              children: [
                (C {(bazel)} {(build)} 
                  {(//) ($ VSub_Name "$pkg") (/java/deploy) (Lit_Other ":") (Hello_deploy.jar)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(unzip)} {(-p)} 
                      {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                        (/java/deploy/Hello_deploy.jar)
                      } {($ VSub_Name "$pkg") (/hello/Test.txt)}
                    )
                    (C {(grep)} {(-q)} {(DQ ("Some other File"))})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("missing resource"))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [2822]
        )
      spids: [2816 2821]
    )
    (FuncDef
      name: test_wrapper_script_arg_handling
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [3000 3005]
                        )
                      )
                    }
                  spids: [2998]
                )
              ]
              spids: [2994]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/hello/)})
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/Test.java)}
                  spids: [3027]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package hello;\n") ("public class Test {\n") 
                        ("  public static void main(String[] args) {\n") ("    System.out.print(") (Right_DoubleQuote "\"") ("Args:") (Right_DoubleQuote "\"") (");\n") 
                        ("    for (String arg : args) {\n") ("      System.out.print(") (Right_DoubleQuote "\"") (" '") (Right_DoubleQuote "\"") (" + arg + ") 
                        (Right_DoubleQuote "\"") ("'") (Right_DoubleQuote "\"") (");\n") ("    }\n") ("    System.out.println();\n") ("  }\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3032]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/BUILD)}
                  spids: [3061]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ 
                        (
"java_binary(name='hello', srcs=['Test.java'], main_class='hello.Test')\n"
                        )
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3066]
                )
              ]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(run)}
                    {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)}
                    {(--)}
                    {(SQ )}
                    {(foo)}
                    {(SQ )}
                    {(SQ )}
                    {(SQ <"bar quux">)}
                    {(SQ )}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [3104]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Build failed"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log)} {(DQ ("Args: '' 'foo' '' '' 'bar quux' ''"))})
          ]
          spids: [2991]
        )
      spids: [2985 2990]
    )
    (FuncDef
      name: test_srcjar_compilation
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [3140 3145]
                        )
                      )
                    }
                  spids: [3138]
                )
              ]
              spids: [3134]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/hello/)})
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/Test.java)}
                  spids: [3167]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package hello;\n") ("public class Test {\n") 
                        ("  public static void main(String[] args) {\n") ("    System.out.println(") (Right_DoubleQuote "\"") ("Hello World!") (Right_DoubleQuote "\"") (");\n") 
                        ("  }\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3172]
                )
              ]
            )
            (C {(cd)} {($ VSub_Name "$pkg")})
            (AndOr
              children: [
                (C {(zip)} {(-q)} {(java/hello/test.srcjar)} {(java/hello/Test.java)})
                (C {(fail)} {(DQ ("zip failed"))})
              ]
              op_id: Op_DPipe
            )
            (C {(cd)} {(..)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/BUILD)}
                  spids: [3216]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ 
                        (
"java_binary(name='hello', srcs=['test.srcjar'], main_class='hello.Test')\n"
                        )
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3221]
                )
              ]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(build)}
                    {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)}
                    {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello_deploy.jar)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [3244]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [
                {(bazel)}
                {(run)}
                {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)}
                {(--)}
                {(--singlejar)}
              ]
              redirects: [
                (Redir
                  op_id: Redir_GreatAnd
                  fd: -1
                  arg_word: {($ VSub_Name "$TEST_log")}
                  spids: [3270]
                )
              ]
            )
            (C {(expect_log)} {(DQ ("Hello World!"))})
          ]
          spids: [3131]
        )
      spids: [3125 3130]
    )
    (FuncDef
      name: test_private_initializers
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [3298 3303]
                        )
                      )
                    }
                  spids: [3296]
                )
              ]
              spids: [3292]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/hello/)})
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/A.java)}
                  spids: [3326]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("package hello;\n") ("public class A { private B b; }\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3331]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/B.java)}
                  spids: [3340]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("package hello;\n") ("public class B { private C c; }\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3345]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/C.java)}
                  spids: [3354]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("package hello;\n") ("public class C {}\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3359]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/App.java)}
                  spids: [3372]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("package hello;\n") ("public class App { }\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3377]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/BUILD)}
                  spids: [3386]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("java_library(name = 'app',\n") ("             srcs = ['App.java'],\n") 
                        ("             deps = [':a'])\n") ("\n") ("java_library(name = 'a',\n") ("             srcs = ['A.java'],\n") 
                        ("             deps = [':b'])\n") ("\n") ("java_library(name = 'b',\n") ("             srcs = ['B.java'],\n") 
                        ("             deps = [':c'])\n") ("\n") ("java_library(name = 'c',\n") ("             srcs = ['C.java'])\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3391]
                )
              ]
            )
            (AndOr
              children: [
                (C {(bazel)} {(build)} {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (app)})
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [3289]
        )
      spids: [3283 3288]
    )
    (FuncDef
      name: test_java_plugin
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [3446 3451]
                        )
                      )
                    }
                  spids: [3444]
                )
              ]
              spids: [3440]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/test/processor)})
                (C {(fail)} {(DQ (mkdir))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/test/processor/BUILD)}
                  spids: [3474]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package(default_visibility=['//visibility:public'])\n") ("\n") 
                        ("java_library(name = 'annotation',\n") ("  srcs = [ 'TestAnnotation.java' ])\n") ("\n") ("java_library(name = 'processor_dep',\n") 
                        ("  srcs = [ 'ProcessorDep.java' ])\n") ("\n") ("java_plugin(name = 'processor',\n") ("  processor_class = 'test.processor.Processor',\n") 
                        ("  deps = [ ':annotation', ':processor_dep' ],\n") ("  srcs = [ 'Processor.java' ])\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3478]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/test/processor/TestAnnotation.java)}
                  spids: [3497]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package test.processor;\n") ("import java.lang.annotation.*;\n") 
                        ("@Target(value = {ElementType.TYPE})\n") ("\n") ("public @interface TestAnnotation {\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3501]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/test/processor/ProcessorDep.java)}
                  spids: [3514]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package test.processor;\n") ("\n") ("class ProcessorDep {\n") 
                        ("  static String value = ") (Right_DoubleQuote "\"") (DependencyValue) (Right_DoubleQuote "\"") (";\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3518]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/test/processor/Processor.java)}
                  spids: [3534]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package test.processor;\n") ("import java.util.*;\n") 
                        ("import java.io.*;\n") ("import javax.annotation.processing.*;\n") ("import javax.tools.*;\n") 
                        ("import javax.lang.model.*;\n") ("import javax.lang.model.element.*;\n") ("@SupportedAnnotationTypes(value= {") 
                        (Right_DoubleQuote "\"") (test.processor.TestAnnotation) (Right_DoubleQuote "\"") ("})\n") 
                        ("public class Processor extends AbstractProcessor {\n") ("  private static final String OUTFILE_CONTENT = ") (Right_DoubleQuote "\"") ("package test;") 
                        (EscapedLiteralPart token:<Lit_EscapedChar "\\n">) (Right_DoubleQuote "\"") ("\n") ("      + ") (Right_DoubleQuote "\"") ("public class Generated {") 
                        (EscapedLiteralPart token:<Lit_EscapedChar "\\n">) (Right_DoubleQuote "\"") ("\n") ("      + ") (Right_DoubleQuote "\"") ("  public static String value = ") 
                        (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (Right_DoubleQuote "\"") (" + ProcessorDep.value + ") (Right_DoubleQuote "\"") 
                        (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (";") (EscapedLiteralPart token:<Lit_EscapedChar "\\n">) (Right_DoubleQuote "\"") ("\n") ("      + ") 
                        (Right_DoubleQuote "\"") ("}") (Right_DoubleQuote "\"") (";\n") ("  private ProcessingEnvironment mainEnvironment;\n") 
                        ("  public void init(ProcessingEnvironment environment) {\n") ("    mainEnvironment = environment;\n") ("  }\n") 
                        ("  public boolean process(Set<? extends TypeElement> annotations,\n") ("      RoundEnvironment roundEnv) {\n") ("    Filer filer = mainEnvironment.getFiler();\n") 
                        ("    try {\n") ("      FileObject output = filer.createSourceFile(") (Right_DoubleQuote "\"") (test.Generated) 
                        (Right_DoubleQuote "\"") (");\n") ("      Writer writer = output.openWriter();\n") ("      writer.append(OUTFILE_CONTENT);\n") 
                        ("      writer.close();\n") ("    } catch (IOException ex) {\n") ("      return false;\n") ("    }\n") ("    return true;\n") 
                        ("  }\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3538]
                )
              ]
            )
            (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/test/client)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/test/client/BUILD)}
                  spids: [3617]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("java_library(name = 'client',\n") 
                        ("     srcs = [ 'ProcessorClient.java' ],\n") ("     deps = [ '//") ($ VSub_Name "$pkg") ("/java/test/processor:annotation' ],\n") 
                        ("  plugins = [ '//") ($ VSub_Name "$pkg") ("/java/test/processor:processor' ])\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3621]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/test/client/ProcessorClient.java)}
                  spids: [3636]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package test.client;\n") ("import test.processor.TestAnnotation;\n") 
                        ("@TestAnnotation()\n") ("class ProcessorClient { }\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3640]
                )
              ]
            )
            (AndOr
              children: [
                (C {(bazel)} {(build)} 
                  {(//) ($ VSub_Name "$pkg") (/java/test/client) (Lit_Other ":") (client)} {(--use_ijars)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [
                {(unzip)}
                {(-l)}
                {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                  (/java/test/client/libclient.jar)
                }
              ]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$TEST_log")}
                  spids: [3681]
                )
              ]
            )
            (C {(expect_log)} {(DQ (" test/Generated.class"))} 
              {(DQ ("missing class file from annotation processing"))}
            )
            (AndOr
              children: [
                (C {(bazel)} {(build)} 
                  {(//) ($ VSub_Name "$pkg") (/java/test/client) (Lit_Other ":") (libclient-src.jar)} {(--use_ijars)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [
                {(unzip)}
                {(-l)}
                {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                  (/java/test/client/libclient-src.jar)
                }
              ]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$TEST_log")}
                  spids: [3732]
                )
              ]
            )
            (C {(expect_log)} {(DQ (" test/Generated.java"))} 
              {(DQ ("missing source file from annotation processing"))}
            )
          ]
          spids: [3437]
        )
      spids: [3431 3436]
    )
    (FuncDef
      name: test_jvm_flags_are_passed_verbatim
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [3765 3770]
                        )
                      )
                    }
                  spids: [3763]
                )
              ]
              spids: [3759]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/com/google/jvmflags)})
                (C {(fail)} {(DQ (mkdir))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/com/google/jvmflags/BUILD)}
                  spids: [3792]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {("java_binary(\n") ("    name = 'foo',\n") ("    srcs = ['Foo.java'],\n") 
                      ("    main_class = 'com.google.jvmflags.Foo',\n") ("    jvm_flags = [\n") ("        # test quoting\n") ("        '--a=\\'single_single\\'',\n") 
                      ("        '--b=\"single_double\"',\n") ("        \"--c='double_single'\",\n") ("        \"--d=\\\"double_double\\\"\",\n") 
                      ("        '--e=no_quotes',\n") ("        # no escaping expected\n") ("        '--f=stuff$$to\"escape\\\\',\n") 
                      ("        # test make variable expansion\n") ("        '--g=$(JAVABASE)',\n") ("    ],\n") (")\n")
                    }
                  do_expansion: False
                  here_end: EOF
                  was_filled: True
                  spids: [3796]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/com/google/jvmflags/Foo.java)}
                  spids: [3805]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package com.google.jvmflags;\n") 
                        ("public class Foo { public static void main(String[] args) {} }\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [3809]
                )
              ]
            )
            (AndOr
              children: [
                (C {(bazel)} {(build)} 
                  {(//) ($ VSub_Name "$pkg") (/java/com/google/jvmflags) (Lit_Other ":") (foo)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:STUBSCRIPT)
                  op: Equal
                  rhs: 
                    {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                      (/java/com/google/jvmflags/foo)
                    }
                  spids: [3836]
                )
              ]
              spids: [3836]
            )
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(-e)} {($ VSub_Name "$STUBSCRIPT")} {(Lit_Other "]")})
                (C {(fail)} {(DQ ($ VSub_Name "$STUBSCRIPT") (" not found"))})
              ]
              op_id: Op_DPipe
            )
            (ForEach
              iter_name: flag
              iter_words: [
                {(DQ (" --a='single_single' "))}
                {
                  (DQ (" --b=") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (single_double) 
                    (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (" ")
                  )
                }
                {(DQ (" --c='double_single' "))}
                {
                  (DQ (" --d=") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (double_double) 
                    (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (" ")
                  )
                }
                {(SQ <" --e=no_quotes ">)}
                {(SQ <" --f=stuff$to\"escape\\\\ ">)}
                {(DQ (" --g=") (${ VSub_Name runfiles_relative_javabase))}
              ]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (C {(assert_contains)} {($ VSub_Name "$flag")} {($ VSub_Name "$STUBSCRIPT")})
                  ]
                  spids: [3927 3941]
                )
              spids: [3869 3925]
            )
          ]
          spids: [3756]
        )
      spids: [3750 3755]
    )
    (FuncDef
      name: test_classpath_fiddling
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [3961 3966]
                        )
                      )
                    }
                  spids: [3959]
                )
              ]
              spids: [3955]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Name "$pkg"))})
                (C {(fail)} {(DQ ("mkdir ") ($ VSub_Name "$pkg"))})
              ]
              op_id: Op_DPipe
            )
            (C {(write_hello_library_files)} {(DQ ($ VSub_Name "$pkg"))})
            (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/classpath)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/classpath/BUILD)}
                  spids: [4004]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("java_binary(name = 'classpath',\n") ("    deps = ['//") 
                        ($ VSub_Name "$pkg") ("/java/hello_library'],\n") ("    srcs = ['Classpath.java'],\n") 
                        ("    main_class = 'classpath.Classpath')\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [4008]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/classpath/Classpath.java)}
                  spids: [4021]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {("package classpath;\n") ("public class Classpath {\n") 
                      ("  public static void main(String[] args) {\n") ("    String cp = System.getProperty(\"java.class.path\");\n") 
                      (
"    String[] jars = cp.split(\":\");  // TODO(bazel-team): this is \";\" on Windows\n"
                      ) ("    boolean singlejar\n") ("        = (args.length > 1 && args[1].equals(\"SINGLEJAR\"));\n") 
                      ("    System.out.printf(\"CLASSPATH=%s%n\", cp);\n") ("    if (jars.length != 2 && !singlejar) {\n") 
                      ("      throw new Error(\"Unexpected class path length\");\n") ("    }\n") ("    String jarRegex = args[0];\n") ("    for (String jar : jars) {\n") 
                      ("      if (!jar.matches(jarRegex)) {\n") ("        throw new Error(\"No match for regex: \" + jarRegex);\n") ("      }\n") 
                      ("      if (!new java.io.File(jar).exists()) {\n") ("        throw new Error(\"No such file: \" + jar);\n") ("      }\n") ("    }\n") ("  }\n") ("}\n")
                    }
                  do_expansion: False
                  here_end: EOF
                  was_filled: True
                  spids: [4025]
                )
              ]
            )
            (C {(bazel)} {(clean)})
            (AndOr
              children: [
                (C {(bazel)} {(build)} {(//) ($ VSub_Name "$pkg") (/java/classpath)})
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(bazel)} {(run)} {(//) ($ VSub_Name "$pkg") (/java/classpath)} {(--)} 
                  {
                    (DQ ("^") ($ VSub_Name "$pkg") ("/java/(classpath|hello_library)/.*") 
                      (EscapedLiteralPart token:<Lit_EscapedChar "\\.">) (jar) (EscapedLiteralPart token:<Lit_EscapedChar "\\$">)
                    )
                  }
                )
                (C {(fail)} {(DQ ("bazel run"))})
              ]
              op_id: Op_DPipe
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:PROG)
                  op: Equal
                  rhs: 
                    {
                      (DQ (${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                        (/java/classpath/classpath)
                      )
                    }
                  spids: [4087]
                )
              ]
              spids: [4085]
            )
            (FuncDef
              name: check_classpath_invocations
              body: 
                (BraceGroup
                  children: [
                    (AndOr
                      children: [
                        (C {(DQ ($ VSub_Name "$PROG"))} 
                          {
                            (DQ ("^") (${ VSub_Name PRODUCT_NAME) ("-bin/.*") 
                              (EscapedLiteralPart
                                token: <Lit_EscapedChar "\\.">
                              ) (jar) (EscapedLiteralPart token:<Lit_EscapedChar "\\$">)
                            )
                          } {(DQ ($ VSub_At "$@"))}
                        )
                        (C {(fail)} {(DQ ("direct run relative classpath ") ($ VSub_Star "$*"))})
                      ]
                      op_id: Op_DPipe
                    )
                    (AndOr
                      children: [
                        (C {(DQ (./) ($ VSub_Name "$PROG"))} 
                          {
                            (DQ ("^") (EscapedLiteralPart token:<Lit_EscapedChar "\\.">) (/) 
                              (${ VSub_Name PRODUCT_NAME) ("-bin/.*") (EscapedLiteralPart token:<Lit_EscapedChar "\\.">) (jar) 
                              (EscapedLiteralPart
                                token: <Lit_EscapedChar "\\$">
                              )
                            )
                          } {(DQ ($ VSub_At "$@"))}
                        )
                        (C {(fail)} {(DQ ("direct run '.'-relative classpath ") ($ VSub_Star "$*"))})
                      ]
                      op_id: Op_DPipe
                    )
                    (AndOr
                      children: [
                        (C {(DQ ($ VSub_Name "$PWD") (/) ($ VSub_Name "$PROG"))} 
                          {
                            (DQ ("^") (${ VSub_Name PRODUCT_NAME) ("-bin/.*") 
                              (EscapedLiteralPart
                                token: <Lit_EscapedChar "\\.">
                              ) (jar) (EscapedLiteralPart token:<Lit_EscapedChar "\\$">)
                            )
                          } {(DQ ($ VSub_At "$@"))}
                        )
                        (C {(fail)} {(DQ ("direct run absolute classpath ") ($ VSub_Star "$*"))})
                      ]
                      op_id: Op_DPipe
                    )
                    (AndOr
                      children: [
                        (Subshell
                          child: 
                            (CommandList
                              children: [
                                (Sentence
                                  child: 
                                    (Assignment
                                      keyword: Assign_None
                                      pairs: [
                                        (assign_pair
                                          lhs: (LhsName name:PROG)
                                          op: Equal
                                          rhs: {(DQ ($ VSub_Name "$PWD") (/) ($ VSub_Name "$PROG"))}
                                          spids: [4207]
                                        )
                                      ]
                                      spids: [4207]
                                    )
                                  terminator: <Op_Semi ";">
                                )
                                (AndOr
                                  children: [
                                    (C {(cd)} {(/)})
                                    (C {(exec)} {(DQ ($ VSub_Name "$PROG"))} {(SQ <"^/.*\\.jar$">)} 
                                      {(DQ ($ VSub_At "$@"))}
                                    )
                                  ]
                                  op_id: Op_DAmp
                                )
                              ]
                            )
                          spids: [4206 4234]
                        )
                        (C {(fail)} {(DQ ("direct run from / absolute classpath ") ($ VSub_Star "$*"))})
                      ]
                      op_id: Op_DPipe
                    )
                  ]
                  spids: [4105]
                )
              spids: [4099 4104]
            )
            (C {(check_classpath_invocations)})
            (AndOr
              children: [
                (C {(bazel)} {(build)} 
                  {(//) ($ VSub_Name "$pkg") (/java/classpath) (Lit_Other ":") (classpath_deploy.jar)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (ForEach
              iter_name: prog
              iter_words: [
                {(DQ ($ VSub_Name "$PROG"))}
                {(DQ (./) ($ VSub_Name "$PROG"))}
                {(DQ ($ VSub_Name "$PWD") (/) ($ VSub_Name "$PROG"))}
              ]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (AndOr
                      children: [
                        (C {(DQ ($ VSub_Name "$prog"))} {(--singlejar)} {(SQ <".*_deploy.jar$">)} 
                          {(DQ (SINGLEJAR))}
                        )
                        (C {(fail)} {(DQ ($ VSub_Name "$prog") (" --singlejar"))})
                      ]
                      op_id: Op_DPipe
                    )
                    (AndOr
                      children: [
                        (C {(DQ ($ VSub_Name "$prog"))} {(SQ <".*_deploy.jar$">)} {(DQ (SINGLEJAR))} 
                          {(--wrapper_script_flag) (Lit_Other "=") (--singlejar)}
                        )
                        (C {(fail)} {(DQ ($ VSub_Name "$prog") (" --wrapper_script_flag=--singlejar"))})
                      ]
                      op_id: Op_DPipe
                    )
                  ]
                  spids: [4301 4358]
                )
              spids: [4284 4299]
            )
          ]
          spids: [3952]
        )
      spids: [3946 3951]
    )
    (FuncDef
      name: test_java7
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [4378 4383]
                        )
                      )
                    }
                  spids: [4376]
                )
              ]
              spids: [4372]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/foo/)})
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/foo/Foo.java)}
                  spids: [4405]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package foo;\n") 
                        (
"import java.lang.invoke.MethodHandle;   // In Java 7 class library only\n"
                        ) ("import java.util.ArrayList;\n") ("public class Foo {\n") 
                        ("  public static void main(String[] args) {\n") ("    ArrayList<Object> list = new ArrayList<>(); // In Java 7 language only\n") 
                        ("    System.out.println(") (Right_DoubleQuote "\"") ("Success!") (Right_DoubleQuote "\"") (");\n") ("  }\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [4410]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/foo/BUILD)}
                  spids: [4430]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("java_binary(name = 'foo',\n") ("    srcs = ['Foo.java'],\n") 
                        ("    main_class = 'foo.Foo')\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [4435]
                )
              ]
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(bazel)} {(run)} {(//) ($ VSub_Name "$pkg") (/java/foo) (Lit_Other ":") (foo)})
                    (C {(grep)} {(-q)} {(DQ ("Success!"))})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [4369]
        )
      spids: [4363 4368]
    )
    (FuncDef
      name: test_header_compilation
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [4489 4494]
                        )
                      )
                    }
                  spids: [4487]
                )
              ]
              spids: [4483]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(DQ ($ VSub_Name "$pkg"))})
                (C {(fail)} {(DQ ("mkdir ") ($ VSub_Name "$pkg"))})
              ]
              op_id: Op_DPipe
            )
            (C {(write_hello_library_files)} {(DQ ($ VSub_Name "$pkg"))})
            (AndOr
              children: [
                (C {(bazel)} {(build)} {(-s)} {(--java_header_compilation) (Lit_Other "=") (true)} 
                  {(//) ($ VSub_Name "$pkg") (/java/main) (Lit_Other ":") (main)}
                )
                (C {(fail)} {(DQ ("build failed"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ("DEBUG[") 
                    (BracedVarSub
                      token: <VSub_Name FUNCNAME>
                      bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                      spids: [4556 4561]
                    ) ("]: start")
                  )
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[4551])]
            )
            (SimpleCommand
              words: [
                {(unzip)}
                {(-l)}
                {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                  (/java/hello_library/libhello_library-hjar.jar)
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[4577])]
            )
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ("DEBUG[") 
                    (BracedVarSub
                      token: <VSub_Name FUNCNAME>
                      bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                      spids: [4588 4593]
                    ) ("]: end")
                  )
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[4583])]
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(unzip)} {(-l)} 
                      {(${ VSub_Name PRODUCT_NAME) (-bin/) ($ VSub_Name "$pkg") 
                        (/java/hello_library/libhello_library-hjar.jar)
                      }
                    )
                    (C {(grep)} {(-q)} {(DQ (" hello_library/HelloLibrary.class"))})
                  ]
                  negated: False
                )
                (C {(fail)} {(DQ ("missing class file from header compilation"))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [4480]
        )
      spids: [4474 4479]
    )
    (FuncDef
      name: test_header_compilation_errors
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [4649 4654]
                        )
                      )
                    }
                  spids: [4647]
                )
              ]
              spids: [4643]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/test/)})
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/test/A.java)}
                  spids: [4676]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("package test;\n") ("public class A {}\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [4681]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/test/B.java)}
                  spids: [4689]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package test;\n") ("import missing.NoSuch;\n") ("@NoSuch\n") 
                        ("public class B {}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [4694]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/test/BUILD)}
                  spids: [4704]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("java_library(\n") ("    name='a',\n") ("    srcs=['A.java'],\n") 
                        ("    deps=[':b'],\n") (")\n") ("java_library(\n") ("    name='b',\n") ("    srcs=['B.java'],\n") (")\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [4709]
                )
              ]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(build)}
                    {(--java_header_compilation) (Lit_Other "=") (true)}
                    {(//) ($ VSub_Name "$pkg") (/java/test) (Lit_Other ":") (a)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {(DQ ($ VSub_Name "$TEST_log"))}
                      spids: [4738]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Unexpected success"))})
              ]
              op_id: Op_DAmp
            )
            (C {(expect_log)} {(DQ ("package missing does not exist"))})
          ]
          spids: [4640]
        )
      spids: [4634 4639]
    )
    (FuncDef
      name: test_java_import_with_empty_jars_attribute
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pkg)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name FUNCNAME>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                          spids: [4777 4782]
                        )
                      )
                    }
                  spids: [4775]
                )
              ]
              spids: [4771]
            )
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name "$pkg") (/java/hello/)})
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/Hello.java)}
                  spids: [4804]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("package hello;\n") ("public class Hello {\n") 
                        ("  public static void main(String[] args) {\n") ("    System.out.println(") (Right_DoubleQuote "\"") ("Hello World!") (Right_DoubleQuote "\"") (");\n") 
                        ("  }\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [4809]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$pkg") (/java/hello/BUILD)}
                  spids: [4825]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("java_import(\n") ("    name='empty_java_import',\n") ("    jars=[]\n") 
                        (")\n") ("java_binary(\n") ("    name='hello',\n") ("    srcs=['Hello.java'],\n") 
                        ("    deps=[':empty_java_import'],\n") ("    main_class = 'hello.Hello'\n") (")\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [4830]
                )
              ]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(build)}
                    {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)}
                    {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello_deploy.jar)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {(DQ ($ VSub_Name "$TEST_log"))}
                      spids: [4860]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [
                {(bazel)}
                {(run)}
                {(//) ($ VSub_Name "$pkg") (/java/hello) (Lit_Other ":") (hello)}
                {(--)}
                {(--singlejar)}
              ]
              redirects: [
                (Redir
                  op_id: Redir_GreatAnd
                  fd: -1
                  arg_word: {(DQ ($ VSub_Name "$TEST_log"))}
                  spids: [4891]
                )
              ]
            )
            (C {(expect_log)} {(DQ ("Hello World!"))})
          ]
          spids: [4768]
        )
      spids: [4762 4767]
    )
    (C {(run_suite)} {(DQ ("Java integration tests"))})
  ]
)