public static void installPackage(Project project, File unitypackage) { InstallPuppet.install(project); LaunchUnity.launch(project); File dest = project.file(IMPORT_PACKAGE_PATH); try { Files.createParentDirs(dest); Files.copy(unitypackage, dest); File completed = project.file(IMPORT_PACKAGE_PATH + ".completed"); TimeoutTimer timer = new TimeoutTimer(Constants.DEFAULT_TIMEOUT_SECONDS, "Timed out waiting for import of " + completed); while (!completed.exists()) { try { Thread.sleep(100); Log.L.debug("Waiting for {}", completed); timer.throwIfExceeded(); } catch (InterruptedException e) { // Nothing to do here. } } completed.delete(); } catch (IOException e) { throw new RuntimeException(e); } } }
public static void installPackage(Project project, File unitypackage) { InstallPuppet.install(project); LaunchUnity.launch(project); File dest = project.file(IMPORT_PACKAGE_PATH); try { Files.createParentDirs(dest); Files.copy(unitypackage, dest); File completed = project.file(IMPORT_PACKAGE_PATH + ".completed"); TimeoutTimer timer = new TimeoutTimer(Constants.DEFAULT_TIMEOUT_SECONDS, "Timed out waiting for import of " + completed); while (!completed.exists()) { try { Thread.sleep(100); Log.L.debug("Waiting for {}", completed); timer.throwIfExceeded(); } catch (InterruptedException e) { // Nothing to do here. } } completed.delete(); } catch (IOException e) { throw new RuntimeException(e); } } }
@TaskAction public void action() throws IOException, InterruptedException { FileTree tree = gatherForExport(getProject(), pack); Log.L.info("Gathered {} files for export", tree.getFiles().size()); PackageManifest.save(generateManifest(getProject(), tree, pack), manifest); cleanExistingPackage(); exportPackageJob(getProject(), tree); TimeoutTimer timer = new TimeoutTimer(Constants.DEFAULT_TIMEOUT_SECONDS, "Timed out waiting for export of " + unityPackage); while (!unityPackage.exists()) { Thread.sleep(100); Log.L.debug("Waiting for export of {}", unityPackage); timer.throwIfExceeded(); } }
@TaskAction public void action() throws IOException, InterruptedException { FileTree tree = gatherForExport(getProject(), pack); Log.L.info("Gathered {} files for export", tree.getFiles().size()); PackageManifest.save(generateManifest(getProject(), tree, pack), manifest); cleanExistingPackage(); exportPackageJob(getProject(), tree); TimeoutTimer timer = new TimeoutTimer(Constants.DEFAULT_TIMEOUT_SECONDS, "Timed out waiting for export of " + unityPackage); while (!unityPackage.exists()) { Thread.sleep(100); Log.L.debug("Waiting for export of {}", unityPackage); timer.throwIfExceeded(); } }