@Override public void exec() { if (Utils.isNullOrEmpty(url) || Utils.isNullOrEmpty(output)) { throw new IllegalArgumentException("Schema URL and output path can't be empty"); } setScript(new File(getProject().getTasks().getByPath(ApolloCodegenInstallTask.NAME).getOutputs().getFiles() .getAsPath(), ApolloLocalCodegenGenerationTask.APOLLO_CODEGEN_EXEC_FILE)); List<String> args = Lists.newArrayList("introspect-schema", url, "--output", getProject().file(output) .getAbsolutePath()); if (!headers.isEmpty()) { for(String h : headers) { args.add("--header"); args.add(h); } } if (insecure) { args.add("--insecure"); args.add("true"); } setArgs(args); super.exec(); }
private void createUnpackDevTask( final Project project ) { final UnpackDevTask task = project.getTasks().create( "unpackDevResources", UnpackDevTask.class ); project.getTasks().getByPath( "processResources" ).dependsOn( task ); } }
@InputFile public File getFrom() { return ( (Jar) getProject().getTasks().getByPath( "jar" ) ).getArchivePath(); }
@InputFile public File getFrom() { return ( (Jar) getProject().getTasks().getByPath( "jar" ) ).getArchivePath(); }
/** * Returns the input files for a task. * * @param extraDirectory the image's configured extra directory * @param project the gradle project * @return the input files to the task are all the output files for all the dependencies of the * {@code classes} task */ static FileCollection getInputFiles(File extraDirectory, Project project) { Task classesTask = project.getTasks().getByPath("classes"); Set<? extends Task> classesDependencies = classesTask.getTaskDependencies().getDependencies(classesTask); List<FileCollection> dependencyFileCollections = new ArrayList<>(); for (Task task : classesDependencies) { dependencyFileCollections.add(task.getOutputs().getFiles()); } if (Files.exists(extraDirectory.toPath())) { return project.files(dependencyFileCollections, extraDirectory); } else { return project.files(dependencyFileCollections); } }
@Override public void exec() { if (Utils.isNullOrEmpty(url) || Utils.isNullOrEmpty(output)) { throw new IllegalArgumentException("Schema URL and output path can't be empty"); } setScript(new File(getProject().getTasks().getByPath(ApolloCodeGenInstallTask.NAME).getOutputs().getFiles() .getAsPath(), ApolloIRGenTask.APOLLO_CODEGEN_EXEC_FILE)); List<String> args = Lists.newArrayList("introspect-schema", url, "--output", getProject().file(output) .getAbsolutePath()); if (!headers.isEmpty()) { for(String h : headers) { args.add("--header"); args.add(h); } } if (insecure) { args.add("--insecure"); args.add("true"); } setArgs(args); super.exec(); }
private void createExplodedWarTask() { project .getTasks() .create( EXPLODE_WAR_TASK_NAME, ExplodeWarTask.class, explodeWar -> { explodeWar.setExplodedAppDirectory(explodedWarDir); explodeWar.dependsOn(WarPlugin.WAR_TASK_NAME); explodeWar.setGroup(APP_ENGINE_STANDARD_TASK_GROUP); explodeWar.setDescription("Explode a war into a directory"); project.afterEvaluate( project -> explodeWar.setWarFile( ((War) project.getTasks().getByPath(WarPlugin.WAR_TASK_NAME)) .getArchivePath())); }); project.getTasks().getByName(BasePlugin.ASSEMBLE_TASK_NAME).dependsOn(EXPLODE_WAR_TASK_NAME); }
@Override public void apply(Project project) { PackagingExtension extension = project.getExtensions().create(EXTENSION, PackagingExtension.class, project); extension.getPlatformZip().set(project.file("hybris/temp/hybris/hybrisServer/hybrisServer-Platform.zip")); extension.getAllExtensionsZip().set(project.file("hybris/temp/hybris/hybrisServer/hybrisServer-AllExtensions.zip")); extension.getEnvironments().set(project.provider(() -> new HashSet<>(Arrays.asList("dev", "stag", "prod")))); extension.getPreProductionEnvironment().set("stag"); extension.getProjectID().set(project.provider(project::getName)); extension.getConfigurationFolder().set(project.file("ccv1-configuration")); extension.getDistributionFolder().set(project.file("dist")); extension.getTempFolder().set(project.file("temp")); Task bootstrap = project.getTasks().create("bootstrapCCV1Config"); bootstrap.setGroup(GROUP); bootstrap.setDescription("Creates environment config folders, if they don't exist"); project.afterEvaluate(p -> setupBootstrap(p, bootstrap, extension)); Delete cleanTempFolder = project.getTasks().create("cleanTemp", Delete.class, t -> { t.delete(extension.getTempFolder()); }); cleanTempFolder.setGroup(GROUP); cleanTempFolder.setDescription("cleans temp folder used to assemble the final package"); Task buildPackage = project.getTasks().create("buildCCV1Package"); buildPackage.setGroup(GROUP); buildPackage.setDescription("Builds a distribution package based on Deployment Packaging Guidelines (v.2.3.3)"); project.afterEvaluate(p -> setupPackaging(p, buildPackage, extension)); project.getPlugins().withType(HybrisPlugin.class, hybrisPlugin -> { //sensible defaults buildPackage.mustRunAfter(project.getTasks().getByPath("yproduction")); }); }
project.afterEvaluate(p -> project.getTasks().getByPath("build").dependsOn(buildBundleTask, packageGW7Task));
private static void configureGeneratedArtifacts(@NotNull Project project, GatewayDeveloperPluginConfig pluginConfig, BuildDeploymentBundleTask buildDeploymentBundleTask, BuildEnvironmentBundleTask buildEnvironmentBundleTask, BuildFullBundleTask buildFullBundleTask, PackageTask packageGW7Task) { // add build-bundle to the default build task project.afterEvaluate(p -> project.getTasks().getByPath("build").dependsOn(buildDeploymentBundleTask, packageGW7Task)); // add the deployment bundle to the default artifacts project.artifacts(artifactHandler -> addBundleArtifact(artifactHandler, packageGW7Task.getBundle(), buildDeploymentBundleTask, project::getName, "deployment")); // add the environment bundle to the artifacts only if the environment bundle task was triggered if (project.getGradle().getStartParameter().getTaskNames().contains(BUILD_ENVIRONMENT_BUNDLE)) { project.artifacts(artifactHandler -> addBundleArtifact( artifactHandler, pluginConfig.getBuiltBundleDir().file(new DefaultProvider<>(() -> getBuiltArtifactName(project, "-environment", BUNDLE_FILE_EXTENSION))), buildEnvironmentBundleTask, project::getName, "environment")); } // add the full bundle to the artifacts only if the full bundle task was triggered if (project.getGradle().getStartParameter().getTaskNames().contains(BUILD_FULL_BUNDLE)) { project.artifacts(artifactHandler -> addBundleArtifact( artifactHandler, pluginConfig.getBuiltBundleDir().file(new DefaultProvider<>(() -> getBuiltArtifactName(project, "-full", BUNDLE_FILE_EXTENSION))), buildFullBundleTask, project::getName, "full")); } }
.getByPath(EtaBasePlugin.ETA_RESOLVE_DEPENDENCIES_TASK_NAME);
.getByPath(EtaBasePlugin.ETA_RESOLVE_DEPENDENCIES_TASK_NAME);