From e7bfc5f9fa70b4ea9372954966e3101d2fefaebb Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 23 Nov 2017 14:30:53 +0100 Subject: [PATCH] Remove deprecated internal constructor --- .../gradle/api/internal/java/JavaLibrary.java | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/subprojects/plugins/src/main/java/org/gradle/api/internal/java/JavaLibrary.java b/subprojects/plugins/src/main/java/org/gradle/api/internal/java/JavaLibrary.java index 352d1d224085..31ef5974ad46 100644 --- a/subprojects/plugins/src/main/java/org/gradle/api/internal/java/JavaLibrary.java +++ b/subprojects/plugins/src/main/java/org/gradle/api/internal/java/JavaLibrary.java @@ -24,15 +24,11 @@ import org.gradle.api.artifacts.PublishArtifact; import org.gradle.api.attributes.AttributeContainer; import org.gradle.api.attributes.Usage; -import org.gradle.api.internal.attributes.DefaultImmutableAttributesFactory; import org.gradle.api.internal.attributes.ImmutableAttributes; import org.gradle.api.internal.attributes.ImmutableAttributesFactory; import org.gradle.api.internal.component.SoftwareComponentInternal; import org.gradle.api.internal.component.UsageContext; -import org.gradle.api.internal.model.DefaultObjectFactory; -import org.gradle.api.internal.model.NamedObjectInstantiator; import org.gradle.api.model.ObjectFactory; -import org.gradle.internal.reflect.DirectInstantiator; import javax.inject.Inject; import java.util.LinkedHashSet; @@ -45,10 +41,6 @@ * A SoftwareComponent representing a library that runs on a java virtual machine. */ public class JavaLibrary implements SoftwareComponentInternal { - - // This must ONLY be used in the deprecated constructor, for backwards compatibility - private final static ObjectFactory DEPRECATED_OBJECT_FACTORY = new DefaultObjectFactory(DirectInstantiator.INSTANCE, NamedObjectInstantiator.INSTANCE); - private final Set artifacts = new LinkedHashSet(); private final UsageContext runtimeUsage; private final UsageContext compileUsage; @@ -66,20 +58,6 @@ public JavaLibrary(ObjectFactory objectFactory, ConfigurationContainer configura this.compileUsage = new CompileUsageContext(Usage.JAVA_API); } - /** - * This constructor should not be used, and is maintained only for backwards - * compatibility with the widely used Shadow plugin. - */ - @Deprecated - public JavaLibrary(PublishArtifact jarArtifact, DependencySet runtimeDependencies) { - this.artifacts.add(jarArtifact); - this.objectFactory = DEPRECATED_OBJECT_FACTORY; - this.attributesFactory = new DefaultImmutableAttributesFactory(null); - this.runtimeUsage = new BackwardsCompatibilityUsageContext(Usage.JAVA_RUNTIME, runtimeDependencies); - this.compileUsage = new BackwardsCompatibilityUsageContext(Usage.JAVA_API, runtimeDependencies); - this.configurations = null; - } - @VisibleForTesting Set getArtifacts() { return artifacts; @@ -156,23 +134,4 @@ public Set getDependencies() { return dependencies.withType(ModuleDependency.class); } } - - private class BackwardsCompatibilityUsageContext extends AbstractUsageContext { - private final DependencySet runtimeDependencies; - - private BackwardsCompatibilityUsageContext(String usageName, DependencySet runtimeDependencies) { - super(usageName); - this.runtimeDependencies = runtimeDependencies; - } - - @Override - public String getName() { - return getUsage().getName(); - } - - @Override - public Set getDependencies() { - return runtimeDependencies.withType(ModuleDependency.class); - } - } }