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 = "Build a valid ballerina file with toml")
      public void testBuildBalFileWithToml() throws IOException {
          Path sourceRoot = this.testResources.resolve("single-bal-file-with-toml");
          BuildCommand buildCommand = new BuildCommand(sourceRoot, printStream, printStream, false, true, sourceRoot);
          new CommandLine(buildCommand).parse("hello_world.bal");
          buildCommand.execute();
          
          String buildLog = readOutput(true);
          Assert.assertEquals(buildLog.replaceAll("\r", ""), "Compiling source\n" +
                                        "\thello_world.bal\n" + "" +
                                        "\n" +
                                        "Generating executables\n" + "" +
                                        "\thello_world.jar\n");
          
          Assert.assertTrue(Files.exists(sourceRoot.resolve("hello_world.jar")));
      
          Files.delete(sourceRoot.resolve("hello_world.jar"));
      
          readOutput(true);
      }
test_case.class_method_signature: BuildCommandTest.testBuildBalFileWithToml()
test_case.full_signature: @Test(description = "Build a valid ballerina file with toml") public void testBuildBalFileWithToml()
test_case.identifier: testBuildBalFileWithToml
test_case.invocations: resolve parse execute readOutput assertEquals replaceAll assertTrue exists resolve delete resolve readOutput
test_case.modifiers: @Test(description = "Build a valid ballerina file with toml") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testBuildBalFileWithToml()
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 void execute() {
          if (this.helpFlag) {
              String commandUsageInfo = BLauncherCmd.getCommandUsageInfo(BUILD_COMMAND);
              this.errStream.println(commandUsageInfo);
              return;
          }
  
          String[] args;
          if (this.argList == null) {
              args = new String[0];
          } else if (this.buildAll) {
              args = this.argList.toArray(new String[0]);
          } else {
              args = argList.subList(1, argList.size()).toArray(new String[0]);
          }
  
          // Sets the debug port as a system property, which will be used when setting up debug args before running tests.
          if (!this.skipTests && this.debugPort != null) {
              System.setProperty(SYSTEM_PROP_BAL_DEBUG, this.debugPort);
          }
  
          String[] userArgs = LaunchUtils.getUserArgs(args, new HashMap<>());
          // check if there are too many arguments.
          if (userArgs.length > 0) {
              CommandUtil.printError(this.errStream, "too many arguments.", buildCmd, false);
              CommandUtil.exitError(this.exitWhenFinish);
              return;
          }
  
          // If -a or --all is not given, then it is mandatory to give a module name or a Ballerina file as the arg.
          if (!this.buildAll && (this.argList == null || this.argList.size() == 0)) {
              CommandUtil.printError(this.errStream,
                      "'build' command requires a module name or a Ballerina file to build/compile. Use '-a' or " +
                      "'--all' to build/compile all the modules of the project.",
                      "ballerina build {<ballerina-file> | <module-name> | -a | --all}",
                      false);
              CommandUtil.exitError(this.exitWhenFinish);
              return;
          }
  
          // Validate and decide the source root and the full path of the source.
          this.sourceRootPath = null != this.sourceRoot ?
                  Paths.get(this.sourceRoot).toAbsolutePath() : this.sourceRootPath;
          Path sourcePath = null;
          Path targetPath;
  
          // When -a or --all is provided, check if the command is executed within a Ballerina project. Update source
          // root path if the command is executed inside a project.
          if (this.buildAll) {
              //// Check if the output flag is set when building all the modules.
              if (null != this.output) {
                  CommandUtil.printError(this.errStream,
                                         "'-o' and '--output' are only supported when building a single Ballerina " +
                                                 "file.",
                                         "ballerina build -o <output-file> <ballerina-file> ",
                                         true);
                  CommandUtil.exitError(this.exitWhenFinish);
                  return;
              }
  
              //// Validate and set the path of the source root.
              if (!ProjectDirs.isProject(this.sourceRootPath)) {
                  Path findRoot = ProjectDirs.findProjectRoot(this.sourceRootPath);
                  if (null == findRoot) {
                      CommandUtil.printError(this.errStream,
                                             "you are trying to build/compile a Ballerina project that does not have a " +
                                                     "Ballerina.toml file.",
                                             null,
                                             false);
                      CommandUtil.exitError(this.exitWhenFinish);
                      return;
                  }
  
                  this.sourceRootPath = findRoot;
              }
  
              targetPath = this.sourceRootPath.resolve(ProjectDirConstants.TARGET_DIR_NAME);
  
          } else if (this.argList.get(0).endsWith(BLangConstants.BLANG_SRC_FILE_SUFFIX)) {
              // TODO: remove this once code cov is implemented to support single bal file
              if (coverage) {
                  coverage = false;
                  this.outStream.println("Code coverage is not yet supported with single bal files. Ignoring the flag " +
                          "and continuing the test run...");
              }
              // when a single bal file is provided.
              if (this.compile) {
                  CommandUtil.printError(this.errStream,
                                         "'-c' or '--compile' can only be used with modules.", null, false);
                  CommandUtil.exitError(this.exitWhenFinish);
                  return;
              } else {
                  //// check if path given is an absolute path. update source root accordingly.
                  if (Paths.get(this.argList.get(0)).isAbsolute()) {
                      sourcePath = Paths.get(this.argList.get(0));
                  } else {
                      sourcePath = this.sourceRootPath.resolve(this.argList.get(0));
                  }
                  this.sourceRootPath = sourcePath.getParent();
                  //// check if the given file exists.
                  if (Files.notExists(sourcePath)) {
                      CommandUtil.printError(this.errStream,
                                             "'" + sourcePath + "' Ballerina file does not exist.",
                                             null,
                                             false);
                      CommandUtil.exitError(this.exitWhenFinish);
                      return;
                  }
  
                  //// check if the given file is a regular file and not a symlink.
                  if (!Files.isRegularFile(sourcePath)) {
                      CommandUtil.printError(this.errStream,
                                             "'" + sourcePath +
                                                     "' is not a Ballerina file. Check if it is a symlink or a shortcut.",
                                             null,
                                             false);
                      CommandUtil.exitError(this.exitWhenFinish);
                      return;
                  }
  
                  try {
                      targetPath = Files.createTempDirectory("ballerina-build-" + System.nanoTime());
                  } catch (IOException e) {
                      throw LauncherUtils.createLauncherException("Error occurred when creating the executable.");
                  }
              }
          } else if (Files.exists(
                  this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME).resolve(this.argList.get(0))) &&
                  Files.isDirectory(
                          this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME)
                                  .resolve(this.argList.get(0)))) {
  
              // when building a ballerina module
              //// the output flag cannot be set for projects
              if (null != this.output) {
                  CommandUtil.printError(this.errStream,
                                         "'-o' and '--output' are only supported for building a single Ballerina " +
                                                 "file.",
                                         null,
                                         false);
                  CommandUtil.exitError(this.exitWhenFinish);
                  return;
              }
  
              //// check if command executed from project root.
              if (!RepoUtils.isBallerinaProject(this.sourceRootPath)) {
                  CommandUtil.printError(this.errStream,
                          "you are trying to build/compile a module that is not inside a project.",
                          null,
                          false);
                  CommandUtil.exitError(this.exitWhenFinish);
                  return;
              }
  
              //// check if module name given is not absolute.
              if (Paths.get(argList.get(0)).isAbsolute()) {
                  CommandUtil.printError(this.errStream,
                                         "you are trying to build/compile a module giving the absolute path. You " +
                                                 "only need to give the name of the module.",
                                         "ballerina build [-c] <module-name>",
                                         true);
                  CommandUtil.exitError(this.exitWhenFinish);
                  return;
              }
  
              String moduleName = argList.get(0);
  
              //// remove end forward slash
              if (moduleName.endsWith("/")) {
                  moduleName = moduleName.substring(0, moduleName.length() - 1);
              }
  
              sourcePath = Paths.get(moduleName);
  
              //// check if module exists.
              if (Files.notExists(this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME).resolve(sourcePath))) {
                  CommandUtil.printError(this.errStream,
                          "'" + sourcePath + "' module does not exist.",
                          "ballerina build [-c] <module-name>",
                          true);
                  CommandUtil.exitError(this.exitWhenFinish);
                  return;
              }
  
              targetPath = this.sourceRootPath.resolve(ProjectDirConstants.TARGET_DIR_NAME);
          } else {
              CommandUtil.printError(this.errStream,
                                     "invalid Ballerina source path. It should either be a name of a module in a " +
                                     "Ballerina project or a file with a \'" + BLangConstants.BLANG_SRC_FILE_SUFFIX +
                                     "\' extension. Use -a or --all " +
                                     "to build or compile all modules.",
                                     "ballerina build {<ballerina-file> | <module-name> | -a | --all}",
                                     true);
              CommandUtil.exitError(this.exitWhenFinish);
              return;
          }
  
          // normalize paths
          this.sourceRootPath = this.sourceRootPath.normalize();
          sourcePath = sourcePath == null ? null : sourcePath.normalize();
          targetPath = targetPath.normalize();
  
          // create compiler context
          CompilerContext compilerContext = new CompilerContext();
          CompilerOptions options = CompilerOptions.getInstance(compilerContext);
          options.put(PROJECT_DIR, this.sourceRootPath.toString());
          options.put(DUMP_BIR, Boolean.toString(dumpBIR));
          options.put(DUMP_BIR_FILE, dumpBIRFile);
          options.put(OFFLINE, Boolean.toString(this.offline));
          options.put(COMPILER_PHASE, CompilerPhase.CODE_GEN.toString());
          options.put(LOCK_ENABLED, Boolean.toString(!this.skipLock));
          options.put(SKIP_TESTS, Boolean.toString(this.skipTests));
          options.put(TEST_ENABLED, Boolean.toString(!this.skipTests));
          options.put(EXPERIMENTAL_FEATURES_ENABLED, Boolean.toString(this.experimentalFlag));
          options.put(PRESERVE_WHITESPACE, "true");
  
          // create builder context
          BuildContext buildContext = new BuildContext(this.sourceRootPath, targetPath, sourcePath, compilerContext);
          JarResolver jarResolver = JarResolverImpl.getInstance(buildContext, skipCopyLibsFromDist,
                  observabilityIncluded);
          buildContext.put(BuildContextField.JAR_RESOLVER, jarResolver);
          buildContext.setOut(outStream);
          buildContext.setErr(errStream);
  
          boolean isSingleFileBuild = buildContext.getSourceType().equals(SINGLE_BAL_FILE);
          // output path is the current directory if -o flag is not given.
          Path outputPath = null == this.output ? Paths.get(System.getProperty("user.dir")) : Paths.get(this.output);
  
          TaskExecutor taskExecutor = new TaskExecutor.TaskBuilder()
                  .addTask(new CleanTargetDirTask(), isSingleFileBuild)   // clean the target directory(projects only)
                  .addTask(new CreateTargetDirTask()) // create target directory
                  //.addTask(new ResolveMavenDependenciesTask()) // resolve maven dependencies in Ballerina.toml
                  .addTask(new CompileTask()) // compile the modules
                  .addTask(new CreateBirTask())   // create the bir
                  .addTask(new CreateLockFileTask(), this.skipLock || isSingleFileBuild)  // create a lock file if
                                                              // the given skipLock flag does not exist(projects only)
                  .addTask(new CreateBaloTask(), isSingleFileBuild)   // create the BALOs for modules (projects only)
                  .addTask(new CreateJarTask())   // create the jar
                  .addTask(new CopyResourcesTask(), isSingleFileBuild)
                  .addTask(new CopyObservabilitySymbolsTask(), isSingleFileBuild)
                  .addTask(new RunTestsTask(testReport, coverage, args), this.skipTests || isSingleFileBuild) // run tests
                                                                                                  // (projects only)
                  .addTask(new CreateExecutableTask(), this.compile)  // create the executable.jar
                                                                                          // file
                  .addTask(new CopyExecutableTask(outputPath), !isSingleFileBuild)    // copy executable
                  .addTask(new PrintExecutablePathTask(), this.compile)   // print the location of the executable
                  .addTask(new RunCompilerPluginTask(), this.compile) // run compiler plugins
                  .addTask(new CleanTargetDirTask(), !isSingleFileBuild)  // clean the target dir(single bals only)
                  .build();
  
          taskExecutor.executeTasks(buildContext);
          if (this.exitWhenFinish) {
              Runtime.getRuntime().exit(0);
          }
      }
focal_method.class_method_signature: BuildCommand.execute()
focal_method.full_signature: public void execute()
focal_method.identifier: execute
focal_method.invocations: getCommandUsageInfo println toArray toArray subList size setProperty getUserArgs printError exitError size printError exitError toAbsolutePath get printError exitError isProject findProjectRoot printError exitError resolve endsWith get println printError exitError isAbsolute get get get get resolve get getParent notExists printError exitError isRegularFile printError exitError createTempDirectory nanoTime createLauncherException exists resolve resolve get isDirectory resolve resolve get printError exitError isBallerinaProject printError exitError isAbsolute get get printError exitError get endsWith substring length get notExists resolve resolve printError exitError resolve printError exitError normalize normalize normalize getInstance put toString put toString put put toString put toString put toString put toString put toString put toString put getInstance put setOut setErr equals getSourceType get getProperty get build addTask addTask addTask addTask addTask addTask addTask addTask addTask addTask addTask addTask addTask addTask addTask executeTasks exit getRuntime
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void execute()