@Test(description = "Test Build Command in a Project") public void testBuildCommand() throws IOException { 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"); 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(); 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"); 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); }
public BuildCommand() { this.sourceRootPath = Paths.get(System.getProperty("user.dir")); this.outStream = System.out; this.errStream = System.err; this.exitWhenFinish = true; this.skipCopyLibsFromDist = false; }
BuildCommand implements BLauncherCmd { public BuildCommand() { this.sourceRootPath = Paths.get(System.getProperty("user.dir")); this.outStream = System.out; this.errStream = System.err; this.exitWhenFinish = true; this.skipCopyLibsFromDist = false; } }
BuildCommand implements BLauncherCmd { public BuildCommand() { this.sourceRootPath = Paths.get(System.getProperty("user.dir")); this.outStream = System.out; this.errStream = System.err; this.exitWhenFinish = true; this.skipCopyLibsFromDist = false; } BuildCommand();  BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                        boolean skipCopyLibsFromDist);  BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                        boolean skipCopyLibsFromDist, Path executableOutputDir); }
BuildCommand implements BLauncherCmd { public BuildCommand() { this.sourceRootPath = Paths.get(System.getProperty("user.dir")); this.outStream = System.out; this.errStream = System.err; this.exitWhenFinish = true; this.skipCopyLibsFromDist = false; } BuildCommand();  BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                        boolean skipCopyLibsFromDist);  BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                        boolean skipCopyLibsFromDist, Path executableOutputDir); void execute(); @Override String getName(); @Override void printLongDesc(StringBuilder out); @Override void printUsage(StringBuilder out); @Override void setParentCmdParser(CommandLine parentCmdParser); }
BuildCommand implements BLauncherCmd { public BuildCommand() { this.sourceRootPath = Paths.get(System.getProperty("user.dir")); this.outStream = System.out; this.errStream = System.err; this.exitWhenFinish = true; this.skipCopyLibsFromDist = false; } BuildCommand();  BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                        boolean skipCopyLibsFromDist);  BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish,
                        boolean skipCopyLibsFromDist, Path executableOutputDir); void execute(); @Override String getName(); @Override void printLongDesc(StringBuilder out); @Override void printUsage(StringBuilder out); @Override void setParentCmdParser(CommandLine parentCmdParser);  }