test_class.declarator: moduleBalo
test_class.modifier: private
test_class.original_string: private Path moduleBalo;
test_class.type: Path
test_class.var_name: moduleBalo
test_class.declarator: tplModuleBalo
test_class.modifier: private
test_class.original_string: private Path tplModuleBalo;
test_class.type: Path
test_class.var_name: tplModuleBalo
test_class.declarator: testResources
test_class.modifier: private
test_class.original_string: private Path testResources;
test_class.type: Path
test_class.var_name: testResources
test_class.file: cli/ballerina-packerina/src/test/java/org/ballerinalang/packerina/cmd/BuildCommandTest.java
test_class.identifier: BuildCommandTest
test_class.superclass: extends CommandTest
test_case.body: @Test(description = "Test Build Command in a Project")
      public void testBuildCommand() throws IOException {
  
          // Create jar files for the test since we cannot commit jar files to git.
          Path libs = this.testResources.resolve("valid-project").resolve("libs");
          Files.createDirectory(libs);
  
          zipFile(libs.resolve("toml4j.jar").toFile(), "toml.class");
          zipFile(libs.resolve("swagger.jar").toFile(), "swagger.class");
          zipFile(libs.resolve("json.jar").toFile(), "json.class");
  
          // Build the project
          String[] compileArgs = {"--all", "--skip-tests"};
          BuildCommand buildCommand = new BuildCommand(this.testResources.resolve("valid-project"), printStream,
                  printStream, false, true);
          new CommandLine(buildCommand).parse(compileArgs);
          buildCommand.execute();
  
          // Validate against the spec
          // - target/         <- directory for compile/build output
          // -- bin/           <- Executables will be created here
          // -- balo/          <- .balo files one per built module
          // --- module1.balo  <- balo object of module1
          // --- module2.balo  <- balo object of module2
          // -- apidocs/
          // --- module1/      <- directory containing the HTML files for API docs
          //                      of module1
          // --- module2/
          // -- kubernetes/    <- output of kubernetes compiler extension if used
          // -- potato/        <- output of potato compiler extension
          // -- cache          <- BIR cache directory
  
          Path target = this.testResources.resolve("valid-project").resolve(ProjectDirConstants.TARGET_DIR_NAME);
          Assert.assertTrue(Files.exists(target), "Check if target directory is created");
  
          Assert.assertTrue(Files.exists(target.resolve(ProjectDirConstants.TARGET_BALO_DIRECTORY)),
                  "Check if balo directory exists");
          // {module}-{lang spec version}-{platform}-{version}.balo
          String baloName = "mymodule-" + ProgramFileConstants.IMPLEMENTATION_VERSION + "-java8-0.1.0.balo";
          this.moduleBalo = target.resolve(ProjectDirConstants.TARGET_BALO_DIRECTORY)
                  .resolve(baloName);
          Assert.assertTrue(Files.exists(this.moduleBalo),
                  "Check if balo file exists");
  
          String tplBaloName = "mytemplate-" + ProgramFileConstants.IMPLEMENTATION_VERSION + "-any-0.1.0.balo";
          this.tplModuleBalo = target.resolve(ProjectDirConstants.TARGET_BALO_DIRECTORY)
                  .resolve(tplBaloName);
          Assert.assertTrue(Files.exists(this.tplModuleBalo),
                  "Check if template balo file exists");
  
          Path lockFile = this.testResources.resolve("valid-project").resolve(ProjectDirConstants.LOCK_FILE_NAME);
          Assert.assertTrue(Files.exists(lockFile), "Check if lock file is created");
  
          readOutput(true);
      }
test_case.class_method_signature: BuildCommandTest.testBuildCommand()
test_case.full_signature: @Test(description = "Test Build Command in a Project") public void testBuildCommand()
test_case.identifier: testBuildCommand
test_case.invocations: resolve resolve createDirectory zipFile toFile resolve zipFile toFile resolve zipFile toFile resolve resolve parse execute resolve resolve assertTrue exists assertTrue exists resolve resolve resolve assertTrue exists resolve resolve assertTrue exists resolve resolve assertTrue exists readOutput
test_case.modifiers: @Test(description = "Test Build Command in a Project") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testBuildCommand()
focal_class.declarator: outStream
focal_class.modifier: private final
focal_class.original_string: private final PrintStream outStream;
focal_class.type: PrintStream
focal_class.var_name: outStream
focal_class.declarator: errStream
focal_class.modifier: private final
focal_class.original_string: private final PrintStream errStream;
focal_class.type: PrintStream
focal_class.var_name: errStream
focal_class.declarator: sourceRootPath
focal_class.modifier: private
focal_class.original_string: private Path sourceRootPath;
focal_class.type: Path
focal_class.var_name: sourceRootPath
focal_class.declarator: exitWhenFinish
focal_class.modifier: private
focal_class.original_string: private boolean exitWhenFinish;
focal_class.type: boolean
focal_class.var_name: exitWhenFinish
focal_class.declarator: skipCopyLibsFromDist
focal_class.modifier: private
focal_class.original_string: private boolean skipCopyLibsFromDist;
focal_class.type: boolean
focal_class.var_name: skipCopyLibsFromDist
focal_class.declarator: sourceRoot
focal_class.modifier: @CommandLine.Option(names = {"--sourceroot"},
                          description = "Path to the directory containing the source files and modules")
      private
focal_class.original_string: @CommandLine.Option(names = {"--sourceroot"},
                          description = "Path to the directory containing the source files and modules")
      private String sourceRoot;
focal_class.type: String
focal_class.var_name: sourceRoot
focal_class.declarator: compile
focal_class.modifier: @CommandLine.Option(names = {"--compile", "-c"}, description = "Compile the source without generating " +
                                                                     "executable(s).")
      private
focal_class.original_string: @CommandLine.Option(names = {"--compile", "-c"}, description = "Compile the source without generating " +
                                                                     "executable(s).")
      private boolean compile;
focal_class.type: boolean
focal_class.var_name: compile
focal_class.declarator: buildAll
focal_class.modifier: @CommandLine.Option(names = {"--all", "-a"}, description = "Build or compile all the modules of the project.")
      private
focal_class.original_string: @CommandLine.Option(names = {"--all", "-a"}, description = "Build or compile all the modules of the project.")
      private boolean buildAll;
focal_class.type: boolean
focal_class.var_name: buildAll
focal_class.declarator: output
focal_class.modifier: @CommandLine.Option(names = {"--output", "-o"}, description = "Write the output to the given file. The provided " +
                                                                    "output file name may or may not contain the " +
                                                                    "'.jar' extension.")
      private
focal_class.original_string: @CommandLine.Option(names = {"--output", "-o"}, description = "Write the output to the given file. The provided " +
                                                                    "output file name may or may not contain the " +
                                                                    "'.jar' extension.")
      private String output;
focal_class.type: String
focal_class.var_name: output
focal_class.declarator: offline
focal_class.modifier: @CommandLine.Option(names = {"--offline"}, description = "Build/Compile offline without downloading " +
                                                                "dependencies.")
      private
focal_class.original_string: @CommandLine.Option(names = {"--offline"}, description = "Build/Compile offline without downloading " +
                                                                "dependencies.")
      private boolean offline;
focal_class.type: boolean
focal_class.var_name: offline
focal_class.declarator: skipLock
focal_class.modifier: @CommandLine.Option(names = {"--skip-lock"}, description = "Skip using the lock file to resolve dependencies.")
      private
focal_class.original_string: @CommandLine.Option(names = {"--skip-lock"}, description = "Skip using the lock file to resolve dependencies.")
      private boolean skipLock;
focal_class.type: boolean
focal_class.var_name: skipLock
focal_class.declarator: skipTests
focal_class.modifier: @CommandLine.Option(names = {"--skip-tests"}, description = "Skip test compilation and execution.")
      private
focal_class.original_string: @CommandLine.Option(names = {"--skip-tests"}, description = "Skip test compilation and execution.")
      private boolean skipTests;
focal_class.type: boolean
focal_class.var_name: skipTests
focal_class.declarator: argList
focal_class.modifier: @CommandLine.Parameters
      private
focal_class.original_string: @CommandLine.Parameters
      private List<String> argList;
focal_class.type: List<String>
focal_class.var_name: argList
focal_class.declarator: nativeBinary
focal_class.modifier: @CommandLine.Option(names = {"--native"}, hidden = true,
                          description = "Compile a Ballerina program to a native binary.")
      private
focal_class.original_string: @CommandLine.Option(names = {"--native"}, hidden = true,
                          description = "Compile a Ballerina program to a native binary.")
      private boolean nativeBinary;
focal_class.type: boolean
focal_class.var_name: nativeBinary
focal_class.declarator: dumpBIR
focal_class.modifier: @CommandLine.Option(names = "--dump-bir", hidden = true)
      private
focal_class.original_string: @CommandLine.Option(names = "--dump-bir", hidden = true)
      private boolean dumpBIR;
focal_class.type: boolean
focal_class.var_name: dumpBIR
focal_class.declarator: dumpBIRFile
focal_class.modifier: @CommandLine.Option(names = "--dump-bir-file", hidden = true)
      private
focal_class.original_string: @CommandLine.Option(names = "--dump-bir-file", hidden = true)
      private String dumpBIRFile;
focal_class.type: String
focal_class.var_name: dumpBIRFile
focal_class.declarator: dumpLLVMIR
focal_class.modifier: @CommandLine.Option(names = "--dump-llvm-ir", hidden = true)
      private
focal_class.original_string: @CommandLine.Option(names = "--dump-llvm-ir", hidden = true)
      private boolean dumpLLVMIR;
focal_class.type: boolean
focal_class.var_name: dumpLLVMIR
focal_class.declarator: noOptimizeLlvm
focal_class.modifier: @CommandLine.Option(names = "--no-optimize-llvm", hidden = true)
      private
focal_class.original_string: @CommandLine.Option(names = "--no-optimize-llvm", hidden = true)
      private boolean noOptimizeLlvm;
focal_class.type: boolean
focal_class.var_name: noOptimizeLlvm
focal_class.declarator: helpFlag
focal_class.modifier: @CommandLine.Option(names = {"--help", "-h"}, hidden = true)
      private
focal_class.original_string: @CommandLine.Option(names = {"--help", "-h"}, hidden = true)
      private boolean helpFlag;
focal_class.type: boolean
focal_class.var_name: helpFlag
focal_class.declarator: experimentalFlag
focal_class.modifier: @CommandLine.Option(names = "--experimental", description = "Enable experimental language features.")
      private
focal_class.original_string: @CommandLine.Option(names = "--experimental", description = "Enable experimental language features.")
      private boolean experimentalFlag;
focal_class.type: boolean
focal_class.var_name: experimentalFlag
focal_class.declarator: debugPort
focal_class.modifier: @CommandLine.Option(names = "--debug", description = "run tests in remote debugging mode")
      private
focal_class.original_string: @CommandLine.Option(names = "--debug", description = "run tests in remote debugging mode")
      private String debugPort;
focal_class.type: String
focal_class.var_name: debugPort
focal_class.declarator: useOldParser
focal_class.modifier: @CommandLine.Option(names = "--old-parser", description = "Enable new parser.", hidden = true)
      private
focal_class.original_string: @CommandLine.Option(names = "--old-parser", description = "Enable new parser.", hidden = true)
      private boolean useOldParser;
focal_class.type: boolean
focal_class.var_name: useOldParser
focal_class.declarator: buildCmd = "ballerina build [-o <output>] [--sourceroot] [--offline] [--skip-tests]\n" +
              "                    [--skip-lock] {<ballerina-file | module-name> | -a | --all} [--] [(--key=value)...]"
focal_class.modifier: private static final
focal_class.original_string: private static final String buildCmd = "ballerina build [-o <output>] [--sourceroot] [--offline] [--skip-tests]\n" +
              "                    [--skip-lock] {<ballerina-file | module-name> | -a | --all} [--] [(--key=value)...]";
focal_class.type: String
focal_class.var_name: buildCmd
focal_class.declarator: testReport
focal_class.modifier: @CommandLine.Option(names = "--test-report", description = "enable test report generation")
      private
focal_class.original_string: @CommandLine.Option(names = "--test-report", description = "enable test report generation")
      private boolean testReport;
focal_class.type: boolean
focal_class.var_name: testReport
focal_class.declarator: coverage
focal_class.modifier: @CommandLine.Option(names = "--code-coverage", description = "enable code coverage")
      private
focal_class.original_string: @CommandLine.Option(names = "--code-coverage", description = "enable code coverage")
      private boolean coverage;
focal_class.type: boolean
focal_class.var_name: coverage
focal_class.declarator: observabilityIncluded
focal_class.modifier: @CommandLine.Option(names = "--observability-included", description = "package observability in the executable " +
              "JAR file(s).")
      private
focal_class.original_string: @CommandLine.Option(names = "--observability-included", description = "package observability in the executable " +
              "JAR file(s).")
      private boolean observabilityIncluded;
focal_class.type: boolean
focal_class.var_name: observabilityIncluded
focal_class.file: cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java
focal_class.identifier: BuildCommand
focal_class.interfaces: implements BLauncherCmd
focal_class.class_method_signature: BuildCommand.BuildCommand()
focal_class.full_signature: public  BuildCommand()
focal_class.identifier: BuildCommand
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  BuildCommand()
focal_class.class_method_signature: BuildCommand.BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                          boolean skipCopyLibsFromDist)
focal_class.full_signature: public  BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                          boolean skipCopyLibsFromDist)
focal_class.identifier: BuildCommand
focal_class.modifiers: public
focal_class.parameters: (Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                          boolean skipCopyLibsFromDist)
focal_class.signature:  BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                          boolean skipCopyLibsFromDist)
focal_class.class_method_signature: BuildCommand.BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                          boolean skipCopyLibsFromDist, Path executableOutputDir)
focal_class.full_signature: public  BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                          boolean skipCopyLibsFromDist, Path executableOutputDir)
focal_class.identifier: BuildCommand
focal_class.modifiers: public
focal_class.parameters: (Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                          boolean skipCopyLibsFromDist, Path executableOutputDir)
focal_class.signature:  BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                          boolean skipCopyLibsFromDist, Path executableOutputDir)
focal_class.class_method_signature: BuildCommand.execute()
focal_class.full_signature: public void execute()
focal_class.identifier: execute
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void execute()
focal_class.class_method_signature: BuildCommand.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: BuildCommand.printLongDesc(StringBuilder out)
focal_class.full_signature: @Override public void printLongDesc(StringBuilder out)
focal_class.identifier: printLongDesc
focal_class.modifiers: @Override public
focal_class.parameters: (StringBuilder out)
focal_class.return: void
focal_class.signature: void printLongDesc(StringBuilder out)
focal_class.class_method_signature: BuildCommand.printUsage(StringBuilder out)
focal_class.full_signature: @Override public void printUsage(StringBuilder out)
focal_class.identifier: printUsage
focal_class.modifiers: @Override public
focal_class.parameters: (StringBuilder out)
focal_class.return: void
focal_class.signature: void printUsage(StringBuilder out)
focal_class.class_method_signature: BuildCommand.setParentCmdParser(CommandLine parentCmdParser)
focal_class.full_signature: @Override public void setParentCmdParser(CommandLine parentCmdParser)
focal_class.identifier: setParentCmdParser
focal_class.modifiers: @Override public
focal_class.parameters: (CommandLine parentCmdParser)
focal_class.return: void
focal_class.signature: void setParentCmdParser(CommandLine parentCmdParser)
focal_method.body: public BuildCommand() {
          this.sourceRootPath = Paths.get(System.getProperty("user.dir"));
          this.outStream = System.out;
          this.errStream = System.err;
          this.exitWhenFinish = true;
          this.skipCopyLibsFromDist = false;
      }
focal_method.class_method_signature: BuildCommand.BuildCommand()
focal_method.full_signature: public  BuildCommand()
focal_method.identifier: BuildCommand
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.signature:  BuildCommand()