Remove deprecated code flagged for removal

Closes gh-27303
This commit is contained in:
Stephane Nicoll
2021-07-14 11:49:52 +02:00
parent 46ad4c6f98
commit dc5acb0019
82 changed files with 183 additions and 2508 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,30 +41,6 @@ public abstract class AbstractBuildLog implements BuildLog {
log();
}
@Override
@Deprecated
public Consumer<TotalProgressEvent> pullingBuilder(BuildRequest request, ImageReference imageReference) {
return pullingImage(imageReference, ImageType.BUILDER);
}
@Override
@Deprecated
public void pulledBuilder(BuildRequest request, Image image) {
pulledImage(image, ImageType.BUILDER);
}
@Override
@Deprecated
public Consumer<TotalProgressEvent> pullingRunImage(BuildRequest request, ImageReference imageReference) {
return pullingImage(imageReference, ImageType.RUNNER);
}
@Override
@Deprecated
public void pulledRunImage(BuildRequest request, Image image) {
pulledImage(image, ImageType.RUNNER);
}
@Override
public Consumer<TotalProgressEvent> pullingImage(ImageReference imageReference, ImageType imageType) {
return getProgressConsumer(String.format(" > Pulling %s '%s'", imageType.getDescription(), imageReference));

View File

@@ -42,48 +42,6 @@ public interface BuildLog {
*/
void start(BuildRequest request);
/**
* Log that the builder image is being pulled.
* @param request the build request
* @param imageReference the builder image reference
* @return a consumer for progress update events
* @deprecated since 2.4.0 for removal in 2.6.0 in favor of
* {@link #pullingImage(ImageReference, ImageType)}
*/
@Deprecated
Consumer<TotalProgressEvent> pullingBuilder(BuildRequest request, ImageReference imageReference);
/**
* Log that the builder image has been pulled.
* @param request the build request
* @param image the builder image that was pulled
* @deprecated since 2.4.0 for removal in 2.6.0 in favor of
* {@link #pulledImage(Image, ImageType)}
*/
@Deprecated
void pulledBuilder(BuildRequest request, Image image);
/**
* Log that a run image is being pulled.
* @param request the build request
* @param imageReference the run image reference
* @return a consumer for progress update events
* @deprecated since 2.4.0 for removal in 2.6.0 in favor of
* {@link #pullingImage(ImageReference, ImageType)}
*/
@Deprecated
Consumer<TotalProgressEvent> pullingRunImage(BuildRequest request, ImageReference imageReference);
/**
* Log that a run image has been pulled.
* @param request the build request
* @param image the run image that was pulled
* @deprecated since 2.4.0 for removal in 2.6.0 in favor of
* {@link #pulledImage(Image, ImageType)}
*/
@Deprecated
void pulledRunImage(BuildRequest request, Image image);
/**
* Log that an image is being pulled.
* @param imageReference the image reference

View File

@@ -4,7 +4,7 @@ plugins {
}
bootJar {
mainClassName 'com.example.ExampleApplication'
mainClass = 'com.example.ExampleApplication'
}
// tag::env-runtime[]

View File

@@ -4,7 +4,7 @@ plugins {
}
bootJar {
mainClassName 'com.example.ExampleApplication'
mainClass = 'com.example.ExampleApplication'
}
// tag::publish[]

View File

@@ -7,7 +7,7 @@ plugins {
}
tasks.getByName<BootJar>("bootJar") {
mainClassName = "com.example.ExampleApplication"
mainClass.set("com.example.ExampleApplication")
}
// tag::publish[]

View File

@@ -20,7 +20,6 @@ import java.io.File;
import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.model.ReplacedBy;
import org.gradle.api.plugins.BasePlugin;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginConvention;
@@ -65,28 +64,6 @@ public class SpringBootExtension {
return this.mainClass;
}
/**
* Returns the fully-qualified main class name of the application.
* @return the fully-qualified name of the application's main class
* @deprecated since 2.4.0 for removal in 2.6.0 in favor of {@link #getMainClass()}.
*/
@Deprecated
@ReplacedBy("mainClass")
public String getMainClassName() {
return this.mainClass.getOrNull();
}
/**
* Sets the fully-qualified main class name of the application.
* @param mainClassName the fully-qualified name of the application's main class
* @deprecated since 2.4.0 for removal in 2.6.0 in favor of {@link #getMainClass} and
* {@link Property#set(Object)}
*/
@Deprecated
public void setMainClassName(String mainClassName) {
this.mainClass.set(mainClassName);
}
/**
* Creates a new {@link BuildInfo} task named {@code bootBuildInfo} and configures the
* Java plugin's {@code classes} task to depend upon it.

View File

@@ -21,7 +21,6 @@ import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.FileTreeElement;
import org.gradle.api.model.ReplacedBy;
import org.gradle.api.provider.Property;
import org.gradle.api.specs.Spec;
import org.gradle.api.tasks.Classpath;
@@ -44,24 +43,6 @@ public interface BootArchive extends Task {
@Input
Property<String> getMainClass();
/**
* Returns the fully-qualified main class name of the application.
* @return the fully-qualified name of the application's main class
* @deprecated since 2.4.0 for removal in 2.6.0 in favor of {@link #getMainClass()}.
*/
@Deprecated
@ReplacedBy("mainClass")
String getMainClassName();
/**
* Sets the fully-qualified main class name of the application.
* @param mainClassName the fully-qualified name of the application's main class
* @deprecated since 2.4.0 for removal in 2.6.0 in favor of {@link #getMainClass} and
* {@link Property#set(Object)}
*/
@Deprecated
void setMainClassName(String mainClassName);
/**
* Adds Ant-style patterns that identify files that must be unpacked from the archive
* when it is launched.

View File

@@ -133,18 +133,6 @@ public class BootJar extends Jar implements BootArchive {
return this.mainClass;
}
@Override
@Deprecated
public String getMainClassName() {
return this.mainClass.getOrNull();
}
@Override
@Deprecated
public void setMainClassName(String mainClassName) {
this.mainClass.set(mainClassName);
}
@Override
public void requiresUnpack(String... patterns) {
this.support.requiresUnpack(patterns);
@@ -180,15 +168,6 @@ public class BootJar extends Jar implements BootArchive {
return this.layered;
}
/**
* Configures the jar to be layered using the default layering.
* @since 2.3.0
* @deprecated since 2.4.0 for removal in 2.6.0 as layering as now enabled by default.
*/
@Deprecated
public void layered() {
}
/**
* Configures the jar's layering using the given {@code action}.
* @param action the action to apply

View File

@@ -115,18 +115,6 @@ public class BootWar extends War implements BootArchive {
return this.mainClass;
}
@Override
@Deprecated
public String getMainClassName() {
return this.mainClass.getOrNull();
}
@Override
@Deprecated
public void setMainClassName(String mainClassName) {
this.mainClass.set(mainClassName);
}
@Override
public void requiresUnpack(String... patterns) {
this.support.requiresUnpack(patterns);

View File

@@ -4,6 +4,6 @@ plugins {
}
bootJar {
mainClassName = 'com.example.Application'
mainClass = 'com.example.Application'
launchScript()
}

View File

@@ -85,17 +85,6 @@ public abstract class AbstractJarWriter implements LoaderClassesWriter {
writeEntry(entry, manifest::write);
}
/**
* Write all entries from the specified jar file.
* @param jarFile the source jar file
* @throws IOException if the entries cannot be written
* @deprecated since 2.4.8 for removal in 2.6.0
*/
@Deprecated
public void writeEntries(JarFile jarFile) throws IOException {
writeEntries(jarFile, EntryTransformer.NONE, UnpackHandler.NEVER, (entry) -> null);
}
final void writeEntries(JarFile jarFile, EntryTransformer entryTransformer, UnpackHandler unpackHandler,
Function<JarEntry, Library> libraryLookup) throws IOException {
Enumeration<JarEntry> entries = jarFile.entries();

View File

@@ -54,70 +54,6 @@ public class Library {
this(null, file, scope, null, false, false, true);
}
/**
* Create a new {@link Library}.
* @param file the source file
* @param scope the scope of the library
* @param unpackRequired if the library needs to be unpacked before it can be used
* @deprecated since 2.4.8 for removal in 2.6.0 in favor of
* {@link #Library(String, File, LibraryScope, LibraryCoordinates, boolean, boolean, boolean)}
*/
@Deprecated
public Library(File file, LibraryScope scope, boolean unpackRequired) {
this(null, file, scope, unpackRequired);
}
/**
* Create a new {@link Library}.
* @param name the name of the library as it should be written or {@code null} to use
* the file name
* @param file the source file
* @param scope the scope of the library
* @param unpackRequired if the library needs to be unpacked before it can be used
* @deprecated since 2.4.8 for removal in 2.6.0 in favor of
* {@link #Library(String, File, LibraryScope, LibraryCoordinates, boolean, boolean, boolean)}
*/
@Deprecated
public Library(String name, File file, LibraryScope scope, boolean unpackRequired) {
this(name, file, scope, null, unpackRequired);
}
/**
* Create a new {@link Library}.
* @param name the name of the library as it should be written or {@code null} to use
* the file name
* @param file the source file
* @param scope the scope of the library
* @param coordinates the library coordinates or {@code null}
* @param unpackRequired if the library needs to be unpacked before it can be used
* @deprecated since 2.4.8 for removal in 2.6.0 in favor of
* {@link #Library(String, File, LibraryScope, LibraryCoordinates, boolean, boolean, boolean)}
*/
@Deprecated
public Library(String name, File file, LibraryScope scope, LibraryCoordinates coordinates, boolean unpackRequired) {
this(name, file, scope, coordinates, unpackRequired, false);
}
/**
* Create a new {@link Library}.
* @param name the name of the library as it should be written or {@code null} to use
* the file name
* @param file the source file
* @param scope the scope of the library
* @param coordinates the library coordinates or {@code null}
* @param unpackRequired if the library needs to be unpacked before it can be used
* @param local if the library is local (part of the same build) to the application
* that is being packaged
* @since 2.4.0
* @deprecated since 2.4.8 for removal in 2.6.0 in favor of
* {@link #Library(String, File, LibraryScope, LibraryCoordinates, boolean, boolean, boolean)}
*/
@Deprecated
public Library(String name, File file, LibraryScope scope, LibraryCoordinates coordinates, boolean unpackRequired,
boolean local) {
this(name, file, scope, coordinates, unpackRequired, local, true);
}
/**
* Create a new {@link Library}.
* @param name the name of the library as it should be written or {@code null} to use

View File

@@ -68,19 +68,6 @@ public class ArtifactsLibraries implements Libraries {
private final Log log;
/**
* Creates a new {@code ArtifactsLibraries} from the given {@code artifacts}.
* @param artifacts the artifacts to represent as libraries
* @param unpacks artifacts that should be unpacked on launch
* @param log the log
* @deprecated since 2.4.0 for removal in 2.6.0 in favor of
* {@link #ArtifactsLibraries(Set, Collection, Collection, Log)}
*/
@Deprecated
public ArtifactsLibraries(Set<Artifact> artifacts, Collection<Dependency> unpacks, Log log) {
this(artifacts, Collections.emptyList(), unpacks, log);
}
/**
* Creates a new {@code ArtifactsLibraries} from the given {@code artifacts}.
* @param artifacts the artifacts to represent as libraries