org.gradle.api.artifacts.maven.MavenDeployer Java Examples
The following examples show how to use
org.gradle.api.artifacts.maven.MavenDeployer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProjectDependencyArtifactIdExtractorHack.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
public String extract() { Collection<Upload> tasks = project.getTasks().withType(Upload.class); Collection<ArtifactRepository> repositories = getRepositories(tasks); if (!onlyContainsMavenResolvers(repositories)) { return project.getName(); } Collection<MavenDeployer> deployers = getMavenDeployers(repositories); Set<String> artifactIds = getArtifactIds(deployers); if (artifactIds.size() == 1) { String artifactId = artifactIds.iterator().next(); if (artifactId != null && !artifactId.equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID)) { return artifactId; } } String baseName = getArchivesBaseName(); return baseName != null ? baseName : project.getName(); }
Example #2
Source File: ProjectDependencyArtifactIdExtractorHack.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
public String extract() { Collection<Upload> tasks = project.getTasks().withType(Upload.class); Collection<ArtifactRepository> repositories = getRepositories(tasks); if (!onlyContainsMavenResolvers(repositories)) { return project.getName(); } Collection<MavenDeployer> deployers = getMavenDeployers(repositories); Set<String> artifactIds = getArtifactIds(deployers); if (artifactIds.size() == 1) { String artifactId = artifactIds.iterator().next(); if (artifactId != null && !artifactId.equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID)) { return artifactId; } } String baseName = getArchivesBaseName(); return baseName != null ? baseName : project.getName(); }
Example #3
Source File: ProjectDependencyArtifactIdExtractorHack.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
public String extract() { Collection<Upload> tasks = project.getTasks().withType(Upload.class); Collection<ArtifactRepository> repositories = getRepositories(tasks); if (!onlyContainsMavenResolvers(repositories)) { return project.getName(); } Collection<MavenDeployer> deployers = getMavenDeployers(repositories); Set<String> artifactIds = getArtifactIds(deployers); if (artifactIds.size() == 1) { String artifactId = artifactIds.iterator().next(); if (artifactId != null && !artifactId.equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID)) { return artifactId; } } String baseName = getArchivesBaseName(); return baseName != null ? baseName : project.getName(); }
Example #4
Source File: ProjectDependencyArtifactIdExtractorHack.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
public String extract() { Collection<Upload> tasks = project.getTasks().withType(Upload.class); Collection<ArtifactRepository> repositories = getRepositories(tasks); if (!onlyContainsMavenResolvers(repositories)) { return project.getName(); } Collection<MavenDeployer> deployers = getMavenDeployers(repositories); Set<String> artifactIds = getArtifactIds(deployers); if (artifactIds.size() == 1) { String artifactId = artifactIds.iterator().next(); if (artifactId != null && !artifactId.equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID)) { return artifactId; } } String baseName = getArchivesBaseName(); return baseName != null ? baseName : project.getName(); }
Example #5
Source File: ProjectDependencyArtifactIdExtractorHack.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private Collection<MavenDeployer> getMavenDeployers(Collection<ArtifactRepository> repositories) { Collection<MavenDeployer> result = Lists.newArrayList(); for (ArtifactRepository repository : repositories) { if (repository instanceof MavenDeployer) { result.add((MavenDeployer) repository); } } return result; }
Example #6
Source File: ProjectDependencyArtifactIdExtractorHack.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private Set<String> getArtifactIds(Collection<MavenDeployer> deployers) { Set<String> result = Sets.newHashSet(); for (MavenDeployer deployer : deployers) { result.add(deployer.getPom().getArtifactId()); } return result; }
Example #7
Source File: ProjectDependencyArtifactIdExtractorHack.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private Collection<MavenDeployer> getMavenDeployers(Collection<ArtifactRepository> repositories) { Collection<MavenDeployer> result = Lists.newArrayList(); for (ArtifactRepository repository : repositories) { if (repository instanceof MavenDeployer) { result.add((MavenDeployer) repository); } } return result; }
Example #8
Source File: ProjectDependencyArtifactIdExtractorHack.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private Set<String> getArtifactIds(Collection<MavenDeployer> deployers) { Set<String> result = Sets.newHashSet(); for (MavenDeployer deployer : deployers) { result.add(deployer.getPom().getArtifactId()); } return result; }
Example #9
Source File: VariantHelper.java From javaide with GNU General Public License v3.0 | 5 votes |
public static void setupDefaultConfig( @NonNull final Project project, @NonNull Configuration configuration) { // The library artifact is published (inter-project( for the "default" configuration so // we make sure "default" extends from the actual configuration used for building. Configuration defaultConfig = project.getConfigurations().getAt("default"); defaultConfig.setExtendsFrom(Collections.singleton(configuration)); // for the maven publication (for now), we need to manually include all the configuration // object in a special mapping. // It's not possible to put the top level config object as extended from config won't // be included. final Set<Configuration> flattenedConfigs = flattenConfigurations(configuration); project.getPlugins().withType(MavenPlugin.class, new Action<MavenPlugin>() { @Override public void execute(MavenPlugin mavenPlugin) { project.getTasks().withType(Upload.class, new Action<Upload>() { @Override public void execute(Upload upload) { upload.getRepositories().withType( MavenDeployer.class, new Action<MavenDeployer>() { @Override public void execute(MavenDeployer mavenDeployer) { for (Configuration config : flattenedConfigs) { mavenDeployer.getPom().getScopeMappings().addMapping( 300, project.getConfigurations().getByName( config.getName()), "compile"); } } }); } }); } }); }
Example #10
Source File: ProjectDependencyArtifactIdExtractorHack.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private Collection<MavenDeployer> getMavenDeployers(Collection<ArtifactRepository> repositories) { Collection<MavenDeployer> result = Lists.newArrayList(); for (ArtifactRepository repository : repositories) { if (repository instanceof MavenDeployer) { result.add((MavenDeployer) repository); } } return result; }
Example #11
Source File: ProjectDependencyArtifactIdExtractorHack.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private Set<String> getArtifactIds(Collection<MavenDeployer> deployers) { Set<String> result = Sets.newHashSet(); for (MavenDeployer deployer : deployers) { result.add(deployer.getPom().getArtifactId()); } return result; }
Example #12
Source File: ProjectDependencyArtifactIdExtractorHack.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private Collection<MavenDeployer> getMavenDeployers(Collection<ArtifactRepository> repositories) { Collection<MavenDeployer> result = Lists.newArrayList(); for (ArtifactRepository repository : repositories) { if (repository instanceof MavenDeployer) { result.add((MavenDeployer) repository); } } return result; }
Example #13
Source File: ProjectDependencyArtifactIdExtractorHack.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private Set<String> getArtifactIds(Collection<MavenDeployer> deployers) { Set<String> result = Sets.newHashSet(); for (MavenDeployer deployer : deployers) { result.add(deployer.getPom().getArtifactId()); } return result; }