use of org.gradle.api.Project in project atlas by alibaba.
the class AppVariantContext method getAwSourceOutputDir.
public List<ConfigurableFileTree> getAwSourceOutputDir(AwbBundle awbBundle) {
Project project = scope.getGlobalScope().getProject();
// Build the list of source folders.
ImmutableList.Builder<ConfigurableFileTree> sourceSets = ImmutableList.builder();
// then all the generated src folders.
if (getAwbRClassSourceOutputDir(awbBundle) != null) {
sourceSets.add(project.fileTree(getAwbRClassSourceOutputDir(awbBundle)));
}
sourceSets.add(project.fileTree(getAwbMergeResourcesOutputDir(awbBundle)));
if (scope.getGlobalScope().getExtension().getDataBinding().isEnabled()) {
sourceSets.add(project.fileTree(getAwbClassOutputForDataBinding(awbBundle)));
}
return sourceSets.build();
}
use of org.gradle.api.Project in project spring-boot by spring-projects.
the class ArtifactoryRepositoryTests method whenProjectVersionIsSnapshotThenRepositoryIsSnapshot.
@Test
void whenProjectVersionIsSnapshotThenRepositoryIsSnapshot() {
Project project = ProjectBuilder.builder().build();
project.setVersion("1.2.3-SNAPSHOT");
assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("snapshot");
}
use of org.gradle.api.Project in project spring-boot by spring-projects.
the class ArtifactoryRepositoryTests method whenProjectVersionIsMilestoneThenRepositoryIsMilestone.
@Test
void whenProjectVersionIsMilestoneThenRepositoryIsMilestone() {
Project project = ProjectBuilder.builder().build();
project.setVersion("1.2.3-M1");
assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("milestone");
}
use of org.gradle.api.Project in project spring-boot by spring-projects.
the class ConfigurationPropertiesPlugin method addMetadataArtifact.
private void addMetadataArtifact(Project project) {
SourceSet mainSourceSet = project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
project.getConfigurations().maybeCreate(CONFIGURATION_PROPERTIES_METADATA_CONFIGURATION_NAME);
project.afterEvaluate((evaluatedProject) -> evaluatedProject.getArtifacts().add(CONFIGURATION_PROPERTIES_METADATA_CONFIGURATION_NAME, mainSourceSet.getJava().getDestinationDirectory().dir("META-INF/spring-configuration-metadata.json"), (artifact) -> artifact.builtBy(evaluatedProject.getTasks().getByName(mainSourceSet.getClassesTaskName()))));
}
use of org.gradle.api.Project in project spring-boot by spring-projects.
the class MavenRepositoryPlugin method apply.
@Override
public void apply(Project project) {
project.getPlugins().apply(MavenPublishPlugin.class);
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
File repositoryLocation = new File(project.getBuildDir(), "maven-repository");
publishing.getRepositories().maven((mavenRepository) -> {
mavenRepository.setName("project");
mavenRepository.setUrl(repositoryLocation.toURI());
});
project.getTasks().matching((task) -> task.getName().equals(PUBLISH_TO_PROJECT_REPOSITORY_TASK_NAME)).all((task) -> setUpProjectRepository(project, task, repositoryLocation));
project.getTasks().matching((task) -> task.getName().equals("publishPluginMavenPublicationToProjectRepository")).all((task) -> setUpProjectRepository(project, task, repositoryLocation));
}
Aggregations