Skip to content

Commit

Permalink
Remove deprecated Config APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez authored and gsmet committed Aug 2, 2023
1 parent 7f732e2 commit bf77189
Show file tree
Hide file tree
Showing 38 changed files with 27 additions and 1,220 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
import io.quarkus.deployment.annotations.ProduceWeak;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.annotations.Weak;
import io.quarkus.deployment.builditem.BootstrapConfigSetupCompleteBuildItem;
import io.quarkus.deployment.builditem.BytecodeRecorderObjectLoaderBuildItem;
import io.quarkus.deployment.builditem.ConfigurationBuildItem;
import io.quarkus.deployment.builditem.MainBytecodeRecorderBuildItem;
Expand Down Expand Up @@ -735,8 +734,7 @@ private static Consumer<BuildChainBuilder> loadStepsFromClass(Class<?> clazz,
throw reportError(method, "Unsupported method return type " + returnType);
}

if (methodConsumingConfigPhases.contains(ConfigPhase.BOOTSTRAP)
|| methodConsumingConfigPhases.contains(ConfigPhase.RUN_TIME)) {
if (methodConsumingConfigPhases.contains(ConfigPhase.RUN_TIME)) {
if (isRecorder && recordAnnotation.value() == ExecutionTime.STATIC_INIT) {
throw reportError(method,
"Bytecode recorder is static but an injected config object is declared as run time");
Expand All @@ -745,10 +743,6 @@ private static Consumer<BuildChainBuilder> loadStepsFromClass(Class<?> clazz,
methodStepConfig = methodStepConfig
.andThen(bsb -> bsb.consumes(RunTimeConfigurationProxyBuildItem.class));

if (methodConsumingConfigPhases.contains(ConfigPhase.BOOTSTRAP)) {
methodStepConfig = methodStepConfig
.andThen(bsb -> bsb.afterProduce(BootstrapConfigSetupCompleteBuildItem.class));
}
if (methodConsumingConfigPhases.contains(ConfigPhase.RUN_TIME)) {
methodStepConfig = methodStepConfig
.andThen(bsb -> bsb.afterProduce(RuntimeConfigSetupCompleteBuildItem.class));
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,10 @@ private static List<Class<?>> collectConfigRoots(ClassLoader classLoader) throws
final ConfigPatternMap<Container> buildTimePatternMap;
final ConfigPatternMap<Container> buildTimeRunTimePatternMap;
final ConfigPatternMap<Container> runTimePatternMap;
final ConfigPatternMap<Container> bootstrapPatternMap;

final List<RootDefinition> allRoots;
final List<RootDefinition> buildTimeVisibleRoots;

final boolean bootstrapRootsEmpty;

final List<ConfigClassWithPrefix> buildTimeMappings;
final List<ConfigClassWithPrefix> buildTimeRunTimeMappings;
final List<ConfigClassWithPrefix> runTimeMappings;
Expand Down Expand Up @@ -153,7 +150,6 @@ private BuildTimeConfigurationReader(ClassLoader classLoader, final List<Class<?
List<RootDefinition> buildTimeRoots = new ArrayList<>();
List<RootDefinition> buildTimeRunTimeRoots = new ArrayList<>();
List<RootDefinition> runTimeRoots = new ArrayList<>();
List<RootDefinition> bootstrapRoots = new ArrayList<>();

buildTimeMappings = new ArrayList<>();
buildTimeRunTimeMappings = new ArrayList<>();
Expand Down Expand Up @@ -210,8 +206,6 @@ private BuildTimeConfigurationReader(ClassLoader classLoader, final List<Class<?
buildTimeRoots.add(definition);
} else if (phase == ConfigPhase.BUILD_AND_RUN_TIME_FIXED) {
buildTimeRunTimeRoots.add(definition);
} else if (phase == ConfigPhase.BOOTSTRAP) {
bootstrapRoots.add(definition);
} else {
assert phase == ConfigPhase.RUN_TIME;
runTimeRoots.add(definition);
Expand All @@ -222,17 +216,13 @@ private BuildTimeConfigurationReader(ClassLoader classLoader, final List<Class<?
buildTimePatternMap = PatternMapBuilder.makePatterns(buildTimeRoots);
buildTimeRunTimePatternMap = PatternMapBuilder.makePatterns(buildTimeRunTimeRoots);
runTimePatternMap = PatternMapBuilder.makePatterns(runTimeRoots);
bootstrapPatternMap = PatternMapBuilder.makePatterns(bootstrapRoots);

buildTimeVisibleRoots = new ArrayList<>(buildTimeRoots.size() + buildTimeRunTimeRoots.size());
buildTimeVisibleRoots.addAll(buildTimeRoots);
buildTimeVisibleRoots.addAll(buildTimeRunTimeRoots);

bootstrapRootsEmpty = bootstrapRoots.isEmpty();

allRoots = new ArrayList<>(buildTimeVisibleRoots.size() + bootstrapRoots.size() + runTimeRoots.size());
allRoots = new ArrayList<>(buildTimeVisibleRoots.size() + runTimeRoots.size());
allRoots.addAll(buildTimeVisibleRoots);
allRoots.addAll(bootstrapRoots);
allRoots.addAll(runTimeRoots);

// ConfigMappings
Expand Down Expand Up @@ -594,17 +584,6 @@ ReadResult run() {
runTimeDefaultValues.put(configValue.getNameProfiled(), configValue.getValue());
}
}
// also check for the bootstrap properties since those need to be added to runTimeDefaultValues as well
ni.goToStart();
matched = bootstrapPatternMap.match(ni);
knownProperty = knownProperty || matched != null;
if (matched != null) {
// it's a run-time default (record for later)
ConfigValue configValue = withoutExpansion(() -> runtimeDefaultsConfig.getConfigValue(propertyName));
if (configValue.getValue() != null) {
runTimeDefaultValues.put(configValue.getNameProfiled(), configValue.getValue());
}
}

if (!knownProperty) {
unknownBuildProperties.add(propertyName);
Expand Down Expand Up @@ -675,10 +654,8 @@ ReadResult run() {
.setRunTimeDefaultValues(filterActiveProfileProperties(runTimeDefaultValues))
.setBuildTimePatternMap(buildTimePatternMap)
.setBuildTimeRunTimePatternMap(buildTimeRunTimePatternMap)
.setBootstrapPatternMap(bootstrapPatternMap)
.setRunTimePatternMap(runTimePatternMap)
.setAllRoots(allRoots)
.setBootstrapRootsEmpty(bootstrapRootsEmpty)
.setBuildTimeMappings(buildTimeMappings)
.setBuildTimeRunTimeMappings(buildTimeRunTimeMappings)
.setRunTimeMappings(runTimeMappings)
Expand Down Expand Up @@ -1136,11 +1113,8 @@ public static final class ReadResult {

final ConfigPatternMap<Container> buildTimePatternMap;
final ConfigPatternMap<Container> buildTimeRunTimePatternMap;
final ConfigPatternMap<Container> bootstrapPatternMap;
final ConfigPatternMap<Container> runTimePatternMap;

final boolean bootstrapRootsEmpty;

final List<RootDefinition> allRoots;
final Map<Class<?>, RootDefinition> allRootsByClass;

Expand All @@ -1161,11 +1135,8 @@ public ReadResult(final Builder builder) {

this.buildTimePatternMap = builder.getBuildTimePatternMap();
this.buildTimeRunTimePatternMap = builder.getBuildTimeRunTimePatternMap();
this.bootstrapPatternMap = builder.getBootstrapPatternMap();
this.runTimePatternMap = builder.getRunTimePatternMap();

this.bootstrapRootsEmpty = builder.isBootstrapRootsEmpty();

this.allRoots = builder.getAllRoots();
this.allRootsByClass = rootsToMap(builder);

Expand Down Expand Up @@ -1224,18 +1195,10 @@ public ConfigPatternMap<Container> getBuildTimeRunTimePatternMap() {
return buildTimeRunTimePatternMap;
}

public ConfigPatternMap<Container> getBootstrapPatternMap() {
return bootstrapPatternMap;
}

public ConfigPatternMap<Container> getRunTimePatternMap() {
return runTimePatternMap;
}

public boolean isBootstrapRootsEmpty() {
return bootstrapRootsEmpty;
}

public List<RootDefinition> getAllRoots() {
return allRoots;
}
Expand Down Expand Up @@ -1283,10 +1246,8 @@ static class Builder {
private Map<String, String> runTimeDefaultValues;
private ConfigPatternMap<Container> buildTimePatternMap;
private ConfigPatternMap<Container> buildTimeRunTimePatternMap;
private ConfigPatternMap<Container> bootstrapPatternMap;
private ConfigPatternMap<Container> runTimePatternMap;
private List<RootDefinition> allRoots;
private boolean bootstrapRootsEmpty;
private List<ConfigClassWithPrefix> buildTimeMappings;
private List<ConfigClassWithPrefix> buildTimeRunTimeMappings;
private List<ConfigClassWithPrefix> runTimeMappings;
Expand Down Expand Up @@ -1347,15 +1308,6 @@ Builder setBuildTimeRunTimePatternMap(final ConfigPatternMap<Container> buildTim
return this;
}

ConfigPatternMap<Container> getBootstrapPatternMap() {
return bootstrapPatternMap;
}

Builder setBootstrapPatternMap(final ConfigPatternMap<Container> bootstrapPatternMap) {
this.bootstrapPatternMap = bootstrapPatternMap;
return this;
}

ConfigPatternMap<Container> getRunTimePatternMap() {
return runTimePatternMap;
}
Expand All @@ -1374,15 +1326,6 @@ Builder setAllRoots(final List<RootDefinition> allRoots) {
return this;
}

boolean isBootstrapRootsEmpty() {
return bootstrapRootsEmpty;
}

Builder setBootstrapRootsEmpty(final boolean bootstrapRootsEmpty) {
this.bootstrapRootsEmpty = bootstrapRootsEmpty;
return this;
}

List<ConfigClassWithPrefix> getBuildTimeMappings() {
return buildTimeMappings;
}
Expand Down

This file was deleted.

Loading

0 comments on commit bf77189

Please sign in to comment.