org.gradle.api.artifacts.ExternalDependency Java Examples

The following examples show how to use org.gradle.api.artifacts.ExternalDependency. 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: ModuleFactoryHelper.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static void addExplicitArtifactsIfDefined(ExternalDependency moduleDependency, String artifactType, String classifier) {
    String actualArtifactType = artifactType;
    if (actualArtifactType == null) {
        if (classifier != null) {
            actualArtifactType = DependencyArtifact.DEFAULT_TYPE;
        }
    } else {
        moduleDependency.setTransitive(false);
    }
    if (actualArtifactType != null) {
        moduleDependency.addArtifact(new DefaultDependencyArtifact(moduleDependency.getName(),
                actualArtifactType, actualArtifactType, classifier, null));
    }
}
 
Example #2
Source File: ModuleFactoryHelper.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static void addExplicitArtifactsIfDefined(ExternalDependency moduleDependency, String artifactType, String classifier) {
    String actualArtifactType = artifactType;
    if (actualArtifactType == null) {
        if (classifier != null) {
            actualArtifactType = DependencyArtifact.DEFAULT_TYPE;
        }
    } else {
        moduleDependency.setTransitive(false);
    }
    if (actualArtifactType != null) {
        moduleDependency.addArtifact(new DefaultDependencyArtifact(moduleDependency.getName(),
                actualArtifactType, actualArtifactType, classifier, null));
    }
}
 
Example #3
Source File: WarOverlayPlugin.java    From gradle-plugins with MIT License 5 votes vote down vote up
private void configureOverlay(WarOverlay overlay, ExternalDependency dependency) {
    War warTask = overlay.getWarTask();

    dependency.setTransitive(false);

    Configuration configuration = project.getConfigurations().create(overlay.getConfigurationName());
    configuration.setDescription(String.format("Contents of the overlay '%s' for the task '%s'.", overlay.getName(), warTask.getName()));
    configuration.getDependencies().add(dependency);

    configureOverlay(overlay, () -> project.zipTree(configuration.getSingleFile()));
}
 
Example #4
Source File: WarOverlayPlugin.java    From gradle-plugins with MIT License 5 votes vote down vote up
private void configureOverlay(WarOverlay overlay, ExternalDependency dependency) {
    War warTask = overlay.getWarTask();

    dependency.setTransitive(false);

    Configuration configuration = project.getConfigurations().create(overlay.getConfigurationName());
    configuration.setDescription(String.format("Contents of the overlay '%s' for the task '%s'.", overlay.getName(), warTask.getName()));
    configuration.getDependencies().add(dependency);

    configureOverlay(overlay, () -> project.zipTree(configuration.getSingleFile()));
}
 
Example #5
Source File: ModuleFactoryHelper.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static void addExplicitArtifactsIfDefined(ExternalDependency moduleDependency, String artifactType, String classifier) {
    String actualArtifactType = artifactType;
    if (actualArtifactType == null) {
        if (classifier != null) {
            actualArtifactType = DependencyArtifact.DEFAULT_TYPE;
        }
    } else {
        moduleDependency.setTransitive(false);
    }
    if (actualArtifactType != null) {
        moduleDependency.addArtifact(new DefaultDependencyArtifact(moduleDependency.getName(),
                actualArtifactType, actualArtifactType, classifier, null));
    }
}
 
Example #6
Source File: ModuleFactoryHelper.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static void addExplicitArtifactsIfDefined(ExternalDependency moduleDependency, String artifactType, String classifier) {
    String actualArtifactType = artifactType;
    if (actualArtifactType == null) {
        if (classifier != null) {
            actualArtifactType = DependencyArtifact.DEFAULT_TYPE;
        }
    } else {
        moduleDependency.setTransitive(false);
    }
    if (actualArtifactType != null) {
        moduleDependency.addArtifact(new DefaultDependencyArtifact(moduleDependency.getName(),
                actualArtifactType, actualArtifactType, classifier, null));
    }
}
 
Example #7
Source File: AbstractExternalDependency.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected boolean isContentEqualsFor(ExternalDependency dependencyRhs) {
    if (!isKeyEquals(dependencyRhs) || !isCommonContentEquals(dependencyRhs)) {
        return false;
    }
    return isForce() == dependencyRhs.isForce();
}
 
Example #8
Source File: WarOverlayPlugin.java    From gradle-plugins with MIT License 4 votes vote down vote up
private void configureOverlay(WarOverlay overlay) {

        if (overlay.isDeferProvidedConfiguration()) {
            //Delay this to trick IntelliJ
            //noinspection Convert2Lambda
            overlay.getWarTask().doFirst(new Action<Task>() {
                @Override
                public void execute(Task w) {
                    overlay.getWarCopySpec().exclude(element -> overlay.isProvided());
                }
            });
        } else {
            overlay.getWarCopySpec().exclude(element -> overlay.isProvided());
        }

        Object source = overlay.getSource();

        if (source instanceof AbstractArchiveTask) {
            configureOverlay(overlay, (AbstractArchiveTask) source);
        } else if (source instanceof Project && overlay.getConfigureClosure() == null) {
            configureOverlay(overlay, (Project) source);
        } else if (source instanceof File) {
            configureOverlay(overlay, (File) source);
        } else {
            Closure configClosure = overlay.getConfigureClosure();
            Dependency dependency;
            if (configClosure == null) {
                dependency = project.getDependencies().create(source);
            } else {
                dependency = project.getDependencies().create(source, configClosure);
            }

            if (dependency instanceof ProjectDependency) {
                configureOverlay(overlay, ((ProjectDependency) dependency).getDependencyProject());
            } else if (dependency instanceof ExternalDependency) {
                configureOverlay(overlay, (ExternalDependency) dependency);
            } else {
                throw new GradleException("Unsupported dependency type: " + dependency.getClass().getName());
            }
        }
    }
 
Example #9
Source File: WarOverlayPlugin.java    From gradle-plugins with MIT License 4 votes vote down vote up
private void configureOverlay(WarOverlay overlay) {

        if (overlay.isDeferProvidedConfiguration()) {
            //Delay this to trick IntelliJ
            //noinspection Convert2Lambda
            overlay.getWarTask().doFirst(new Action<Task>() {
                @Override
                public void execute(Task w) {
                    overlay.getWarCopySpec().exclude(element -> overlay.isProvided());
                }
            });
        } else {
            overlay.getWarCopySpec().exclude(element -> overlay.isProvided());
        }

        Object source = overlay.getSource();

        if (source instanceof AbstractArchiveTask) {
            configureOverlay(overlay, (AbstractArchiveTask) source);
        } else if (source instanceof Project && overlay.getConfigureClosure() == null) {
            configureOverlay(overlay, (Project) source);
        } else if (source instanceof File) {
            configureOverlay(overlay, (File) source);
        } else {
            Closure configClosure = overlay.getConfigureClosure();
            Dependency dependency;
            if (configClosure == null) {
                dependency = project.getDependencies().create(source);
            } else {
                dependency = project.getDependencies().create(source, configClosure);
            }

            if (dependency instanceof ProjectDependency) {
                configureOverlay(overlay, ((ProjectDependency) dependency).getDependencyProject());
            } else if (dependency instanceof ExternalDependency) {
                configureOverlay(overlay, (ExternalDependency) dependency);
            } else {
                throw new GradleException("Unsupported dependency type: " + dependency.getClass().getName());
            }
        }
    }
 
Example #10
Source File: AbstractExternalDependency.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected boolean isContentEqualsFor(ExternalDependency dependencyRhs) {
    if (!isKeyEquals(dependencyRhs) || !isCommonContentEquals(dependencyRhs)) {
        return false;
    }
    return isForce() == dependencyRhs.isForce();
}
 
Example #11
Source File: ExternalModuleDependencyTranslator.java    From pushfish-android with BSD 2-Clause "Simplified" License votes vote down vote up
List<ExternalDependency> translate(Set<ResolvedDependency> resolvedDependencies); 
Example #12
Source File: ExternalModuleDependencyTranslator.java    From pushfish-android with BSD 2-Clause "Simplified" License votes vote down vote up
List<ExternalDependency> translate(Set<ResolvedDependency> resolvedDependencies); 
Example #13
Source File: ExternalModuleDependencyTranslator.java    From Pushjet-Android with BSD 2-Clause "Simplified" License votes vote down vote up
List<ExternalDependency> translate(Set<ResolvedDependency> resolvedDependencies); 
Example #14
Source File: ExternalModuleDependencyTranslator.java    From Pushjet-Android with BSD 2-Clause "Simplified" License votes vote down vote up
List<ExternalDependency> translate(Set<ResolvedDependency> resolvedDependencies);