@TaskAction public void embedSwagger() throws IOException { JsonNode template = inputMapper.readTree(templateFile); JsonNode resources = template.get("Resources"); addApiDefinitionBody(resources); addLambdaCodeURI(resources); ObjectWriter writer = outputMapper.writer(new DefaultPrettyPrinter()); outputTemplateFile.getParentFile().mkdirs(); writer.writeValue(outputTemplateFile, template); }
@TaskAction void clean() throws IOException { Project rootProject = getProject();
@TaskAction public void generateHensonNavigator() { JavaCompile javaCompiler = (JavaCompile) variant.getJavaCompiler();
@TaskAction public void process() throws Throwable { try { // Hack and bind jooby env. String env = getEnv(); this.assetFile = new File(getOutput(), "assets." + env + ".conf"); new JoobyContainer(getProject()) .run(getMainClassName(), (app, conf) -> compile(getLogger(), app.getClass().getClassLoader(), env, getMaxAge(), getOutput(), assetFile, getAssemblyOutput(), conf), env); } catch (CompilationDone ex) { // done } }
@TaskAction public void run() throws Exception { System.setProperty("logLevel", getLogLevel());
@TaskAction void okbuck() {
@TaskAction public void checkFilesForChanges(IncrementalTaskInputs inputs)
@TaskAction public void generateSpec() throws IOException, GenerateException { ClassLoader loader = projectClassLoader(); Set<Class<?>> classes = new HashSet<>(); for (String pkg : apiPackages) { Reflections reflections = new Reflections( new ConfigurationBuilder() .addClassLoaders(loader) .addUrls(ClasspathHelper.forPackage(pkg, loader)) .setExpandSuperTypes(false) .filterInputsBy(new FilterBuilder().includePackage(pkg))); Set<Class<?>> springMVCClasses = reflections.getTypesAnnotatedWith( org.springframework.web.bind.annotation.RestController.class); classes.addAll(springMVCClasses); } SpringMvcApiReader reader = new SpringMvcApiReader(new Swagger(), log); Swagger swagger = reader.read(classes); for (SwaggerFilter filter : filters) { filter.apply(swagger); } Yaml.pretty().writeValue(swaggerFile, swagger); }
@TaskAction public void process() throws Throwable { Project project = getProject(); JoobyProject joobyProject = new JoobyProject(project); String mainClass = getMainClassName(); try (URLClassLoader loader = joobyProject.newClassLoader()) { getLogger().debug("Using classloader " + loader); Path srcdir = project.getProjectDir().toPath(); Path bindir = joobyProject.classes().toPath(); Path output = new ApiParser(srcdir) .with(loader) .export(bindir, mainClass); getLogger().info("API file: " + output); } }
@TaskAction void installWrapper() { new BuckWrapper() .customBuckRepo(repo) .watch(toWatchmanMatchers(watch)) .sourceRoots(toWatchmanMatchers(sourceRoots)) .ignoredDirs(toWatchmanIgnoredDirs(ignoredDirs)) .render(wrapper); wrapper.setExecutable(true); File watchmanConfig = getProject().file(".watchmanconfig"); if (!watchmanConfig.exists()) { FileUtil.copyResourceToProject( "wrapper/WATCHMAN_CONFIG", getProject().file(".watchmanconfig")); } }
@TaskAction public void performAction(IncrementalTaskInputs inputs) throws Exception { if (target == null) {
@TaskAction public void preCompile() { // Create directory for output of annotation processor. FileUtils.mkdirs(annotationProcessorOutputFolder); }
@TaskAction public void perform() { exportQuery.set("?encassAsPolicyDependency=true" + "&includeDependencies=true" + "&all=true" + "&encryptSecrets=true"); } }
@TaskAction public void createSetupPy() throws IOException { File file = getProject().file("setup.py"); if (file.exists()) { logger.lifecycle("Contents of setup.py are going to be overwritten!!"); file.delete(); } file.createNewFile(); String setupPy = IOUtils.toString(GenerateSetupPyTask.class.getResourceAsStream("/templates/setup.py.template")); FileUtils.write(file, setupPy); } }
@TaskAction public void clean() throws IOException { Preconditions.checkNotNull(buildCacheDirectory, "buildCacheDirectory must not be null"); FileCache.getInstanceWithInterProcessLocking(buildCacheDirectory).delete(); }
@TaskAction public void download() throws IOException { try { super.download(); } catch (IOException e) { throw new IOException("Failed to download " + getSrc(), e); } }
@TaskAction public void initShipkitConfigFile(){ if(configFile.exists()){ LOG.lifecycle(" Shipkit configuration already exists, nothing to do. Configuration file: {}", configFile.getPath()); } else{ createShipKitConfigFile(); LOG.lifecycle(" Shipkit configuration created at {}!\n" + " You can modify it manually. Remember to check it into VCS!", configFile.getPath()); } }
/** * See {@link BumpVersionFileTask} */ @TaskAction public void bumpVersionFile() { new BumpVersionFile().bumpVersionFile(this); }
@TaskAction public void run() throws IOException { ProguardFiles.extractBundledProguardFiles(getProject()); } }
@TaskAction public void run() { getProject().copy( this::doCopy ); }