Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change - Remove support for Deprecated Interfaces (please upgrade dependencies) #670

Merged
merged 13 commits into from
Nov 24, 2024
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public synchronized void init(ProcessingEnvironment processingEnv) {
* Loads provider files generated by avaje-inject-maven-plugin
*/
void loadProvidedFiles() {
pluginFileProvided.addAll(lines("avaje-plugin-provides.txt"));
lines("avaje-module-dependencies.csv").stream()
.filter(s -> s.contains("|") && !s.startsWith("External Module Type"))
.distinct()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.avaje.inject.generator;

import io.avaje.inject.spi.Module;
import io.avaje.inject.spi.*;

import java.util.ArrayList;
Expand All @@ -14,8 +13,6 @@ private LoadServices() {}

static List<AvajeModule> loadModules(ClassLoader classLoader) {
List<AvajeModule> modules = new ArrayList<>();
// load using older Module
ServiceLoader.load(Module.class, classLoader).forEach(modules::add);
// load newer AvajeModule
final var iterator = ServiceLoader.load(InjectExtension.class, classLoader).iterator();
while (iterator.hasNext()) {
Expand All @@ -33,8 +30,6 @@ static List<AvajeModule> loadModules(ClassLoader classLoader) {

static List<InjectPlugin> loadPlugins(ClassLoader classLoader) {
List<InjectPlugin> plugins = new ArrayList<>();
ServiceLoader.load(Plugin.class, classLoader).forEach(plugins::add);

final var iterator = ServiceLoader.load(InjectExtension.class, classLoader).iterator();
while (iterator.hasNext()) {
try {
Expand Down
4 changes: 0 additions & 4 deletions inject-generator/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
requires static io.avaje.spi;

uses io.avaje.inject.spi.InjectExtension;
uses io.avaje.inject.spi.Plugin;
uses io.avaje.inject.spi.Module;
uses io.avaje.inject.spi.InjectPlugin;
uses io.avaje.inject.spi.AvajeModule;

provides javax.annotation.processing.Processor with io.avaje.inject.generator.InjectProcessor;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import io.avaje.inject.spi.AvajeModule;
import io.avaje.inject.spi.InjectPlugin;
import io.avaje.inject.spi.InjectExtension;
import io.avaje.inject.spi.Module;
import io.avaje.inject.spi.Plugin;

import org.gradle.api.Project;
import org.gradle.api.Task;
Expand Down Expand Up @@ -65,7 +63,6 @@ private FileWriter createFileWriter(String dir, String file) throws IOException

private void writeProvidedPlugins(ClassLoader classLoader, FileWriter pluginWriter) throws IOException {
final List<InjectPlugin> plugins = new ArrayList<>();
ServiceLoader.load(Plugin.class, classLoader).forEach(plugins::add);
ServiceLoader.load(InjectExtension.class, classLoader).stream()
.map(Provider::get)
.filter(InjectPlugin.class::isInstance)
Expand Down Expand Up @@ -122,7 +119,6 @@ private static URL[] createClassPath(Project project) {
private void writeModuleCSV(ClassLoader classLoader, FileWriter moduleWriter) throws IOException {

final List<AvajeModule> avajeModules = new ArrayList<>();
ServiceLoader.load(Module.class, classLoader).forEach(avajeModules::add);
ServiceLoader.load(InjectExtension.class, classLoader).stream()
.map(Provider::get)
.filter(AvajeModule.class::isInstance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
import io.avaje.inject.spi.AvajeModule;
import io.avaje.inject.spi.InjectExtension;
import io.avaje.inject.spi.InjectPlugin;
import io.avaje.inject.spi.Module;
import io.avaje.inject.spi.Plugin;

/**
* Plugin that generates <code>target/avaje-module-provides.txt</code> and <code>
Expand Down Expand Up @@ -98,7 +96,6 @@ private void writeProvidedPlugins(URLClassLoader newClassLoader, FileWriter plug
final Log log = getLog();

final List<InjectPlugin> plugins = new ArrayList<>();
ServiceLoader.load(Plugin.class, newClassLoader).forEach(plugins::add);
ServiceLoader.load(InjectExtension.class, newClassLoader).stream()
.map(Provider::get)
.filter(InjectPlugin.class::isInstance)
Expand Down Expand Up @@ -132,7 +129,6 @@ private void writeProvidedPlugins(URLClassLoader newClassLoader, FileWriter plug
private void writeModuleCSV(ClassLoader newClassLoader, FileWriter moduleWriter) throws IOException {
final Log log = getLog();
final List<AvajeModule> avajeModules = new ArrayList<>();
ServiceLoader.load(Module.class, newClassLoader).forEach(avajeModules::add);
ServiceLoader.load(InjectExtension.class, newClassLoader).stream()
.map(Provider::get)
.filter(AvajeModule.class::isInstance)
Expand Down
10 changes: 0 additions & 10 deletions inject/src/main/java/io/avaje/inject/BeanScopeBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import io.avaje.inject.spi.AvajeModule;
import io.avaje.inject.spi.ConfigPropertyPlugin;
import io.avaje.inject.spi.PropertyRequiresPlugin;

/**
* Build a bean scope with options for shutdown hook and supplying external dependencies.
Expand Down Expand Up @@ -79,15 +78,6 @@ public interface BeanScopeBuilder {
*/
BeanScopeBuilder modules(AvajeModule... modules);

/**
* Return the PropertyRequiresPlugin used for this scope. This is useful for plugins that want to
* use the scopes wiring properties.
*
* @deprecated use {@link #configPlugin()} instead
*/
@Deprecated(forRemoval = true)
PropertyRequiresPlugin propertyPlugin();

/**
* Set the ConfigPropertyPlugin used for this scope. This is serviceloaded automatically of not set
*
Expand Down
9 changes: 0 additions & 9 deletions inject/src/main/java/io/avaje/inject/DBeanScopeBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import io.avaje.inject.spi.ConfigPropertyPlugin;
import io.avaje.inject.spi.EnrichBean;
import io.avaje.inject.spi.ModuleOrdering;
import io.avaje.inject.spi.PropertyRequiresPlugin;
import io.avaje.inject.spi.SuppliedBean;
import jakarta.inject.Provider;

Expand Down Expand Up @@ -68,14 +67,6 @@ public BeanScopeBuilder modules(AvajeModule... modules) {
return this;
}

@Override
public PropertyRequiresPlugin propertyPlugin() {
if (propertyPlugin == null) {
propertyPlugin = defaultPropertyPlugin();
}
return propertyPlugin;
}

@Override
public void configPlugin(ConfigPropertyPlugin propertyPlugin) {
this.propertyPlugin = propertyPlugin;
Expand Down
4 changes: 0 additions & 4 deletions inject/src/main/java/io/avaje/inject/DServiceLoader.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.avaje.inject;

import io.avaje.inject.spi.*;
import io.avaje.inject.spi.Module;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -30,9 +29,6 @@ final class DServiceLoader {
propertyPlugin = (ConfigPropertyPlugin) spi;
}
}
// older plugins and modules
ServiceLoader.load(Plugin.class, classLoader).forEach(plugins::add);
ServiceLoader.load(Module.class, classLoader).forEach(modules::add);
}

List<InjectPlugin> plugins() {
Expand Down
16 changes: 0 additions & 16 deletions inject/src/main/java/io/avaje/inject/spi/Builder.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,6 @@ default boolean isBeanAbsent(Type... types) {
return isBeanAbsent(null, types);
}

/**
* @deprecated use {@link #isBeanAbsent(String, Type...)}
*/
@Deprecated(forRemoval = true)
default boolean isAddBeanFor(String name, Type... types) {
return isBeanAbsent(name, types);
}

/**
* @deprecated use {@link #isBeanAbsent(Type...)} instead
*/
@Deprecated(forRemoval = true)
default boolean isAddBeanFor(Type... types) {
return isBeanAbsent(types);
}

/**
* Register the next bean as having Primary priority.
* Highest priority, will be used over any other matching beans.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,27 @@
* System#getProperty(String)} and {@link System#getenv(String)}.
*/
@NullMarked
public interface ConfigPropertyPlugin extends InjectExtension, PropertyRequiresPlugin {
public interface ConfigPropertyPlugin extends InjectExtension {

/**
* Return a configuration value that might not exist.
*/
@Override
Optional<String> get(String property);

/**
* Return true if the property is defined.
*/
@Override
boolean contains(String property);

/** Return true if the property is not defined. */
@Override
default boolean missing(String property) {
return !contains(property);
}

/** Return true if the property is equal to the given value. */
@Override
boolean equalTo(String property, String value);

/** Return true if the property is not defined or not equal to the given value. */
@Override
default boolean notEqualTo(String property, String value) {
return !equalTo(property, value);
}
Expand Down
103 changes: 0 additions & 103 deletions inject/src/main/java/io/avaje/inject/spi/Module.java

This file was deleted.

39 changes: 0 additions & 39 deletions inject/src/main/java/io/avaje/inject/spi/Plugin.java

This file was deleted.

Loading