use of org.gradle.api.Project in project spring-security by spring-projects.
the class CreateGitHubReleaseTask method readReleaseNotes.
private String readReleaseNotes() {
Project project = getProject();
File inputFile = project.file(Paths.get(project.getBuildDir().getPath(), GitHubChangelogPlugin.RELEASE_NOTES_PATH));
try {
return Files.readString(inputFile.toPath());
} catch (IOException ex) {
throw new RuntimeException("Unable to read release notes from " + inputFile, ex);
}
}
use of org.gradle.api.Project in project spring-security by spring-projects.
the class GlobalLockTask method lock.
@TaskAction
public void lock() {
Project taskProject = getProject();
if (!taskProject.getGradle().getStartParameter().isWriteDependencyLocks()) {
throw new IllegalStateException("You just specify --write-locks argument");
}
writeLocksFor(taskProject);
taskProject.getSubprojects().forEach(new Consumer<Project>() {
@Override
public void accept(Project subproject) {
writeLocksFor(subproject);
}
});
}
use of org.gradle.api.Project in project spring-security by spring-projects.
the class PublishAllJavaComponentsPlugin method apply.
@Override
public void apply(Project project) {
project.getPlugins().withType(MavenPublishPlugin.class).all((mavenPublish) -> {
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
publishing.getPublications().create("mavenJava", MavenPublication.class, new Action<MavenPublication>() {
@Override
public void execute(MavenPublication maven) {
project.getPlugins().withType(JavaPlugin.class, (plugin) -> {
maven.from(project.getComponents().getByName("java"));
});
project.getPlugins().withType(JavaPlatformPlugin.class, (plugin) -> {
maven.from(project.getComponents().getByName("javaPlatform"));
});
}
});
});
}
use of org.gradle.api.Project in project spring-security by spring-projects.
the class S101Configurer method hspTemplateValues.
private Map<String, Object> hspTemplateValues(String version, File configurationDirectory) {
Map<String, Object> values = new LinkedHashMap<>();
values.put("version", version);
values.put("patchVersion", version.split("\\.")[2]);
values.put("relativeTo", "const(THIS_FILE)/" + configurationDirectory.toPath().relativize(this.project.getProjectDir().toPath()));
List<Map<String, Object>> entries = new ArrayList<>();
Set<Project> projects = this.project.getAllprojects();
for (Project p : projects) {
SourceSetContainer sourceSets = (SourceSetContainer) p.getExtensions().findByName("sourceSets");
if (sourceSets == null) {
continue;
}
for (SourceSet source : sourceSets) {
Set<File> classDirs = source.getOutput().getClassesDirs().getFiles();
for (File directory : classDirs) {
Map<String, Object> entry = new HashMap<>();
entry.put("path", this.project.getProjectDir().toPath().relativize(directory.toPath()));
entry.put("module", p.getName());
entries.add(entry);
}
}
}
values.put("entries", entries);
return values;
}
use of org.gradle.api.Project in project spring-security by spring-projects.
the class S101Plugin method configure.
private void configure(JavaExec exec) {
exec.setDescription("Runs Structure101 headless analysis, installing and configuring if necessary");
exec.dependsOn("check");
Project project = exec.getProject();
S101PluginExtension extension = project.getExtensions().getByType(S101PluginExtension.class);
exec.workingDir(extension.getInstallationDirectory()).classpath(new File(extension.getInstallationDirectory().get(), "structure101-java-build.jar")).args(new File(new File(project.getBuildDir(), "s101"), "config.xml")).systemProperty("s101.label", computeLabel(extension).get()).doFirst((task) -> {
installAndConfigureIfNeeded(project);
copyConfigurationToBuildDirectory(extension, project);
}).doLast((task) -> {
copyResultsBackToConfigurationDirectory(extension, project);
});
}
Aggregations