Skip to content

Commit

Permalink
Missed a couple customizers
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Nov 14, 2024
1 parent 40a86e6 commit a6850cc
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package io.quarkus.amazon.lambda.deployment;

import java.util.OptionalInt;

import io.smallrye.config.ConfigSourceInterceptor;
import io.smallrye.config.ConfigSourceInterceptorContext;
import io.smallrye.config.ConfigSourceInterceptorFactory;
import io.smallrye.config.ConfigValue;
import io.smallrye.config.SmallRyeConfigBuilder;
import io.smallrye.config.SmallRyeConfigBuilderCustomizer;

/**
* A configuration customizer to change the default packaging to legacy-jar.
*/
public final class ConfigurationCustomizer implements SmallRyeConfigBuilderCustomizer {
public void configBuilder(final SmallRyeConfigBuilder builder) {
builder.withInterceptorFactories(new ConfigSourceInterceptorFactory() {
public ConfigSourceInterceptor getInterceptor(final ConfigSourceInterceptorContext context) {
return (ic, name) -> switch (name) {
case "quarkus.package.jar.type" ->
ConfigValue.builder().withName(name).withValue("legacy-jar").build();
default -> ic.proceed(name);
};
}

public OptionalInt getPriority() {
return OptionalInt.of(Integer.MIN_VALUE + 100);
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.quarkus.amazon.lambda.deployment.ConfigurationCustomizer
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package io.quarkus.funqy.gcp.functions.deployment.bindings;

import java.util.OptionalInt;

import io.smallrye.config.ConfigSourceInterceptor;
import io.smallrye.config.ConfigSourceInterceptorContext;
import io.smallrye.config.ConfigSourceInterceptorFactory;
import io.smallrye.config.ConfigValue;
import io.smallrye.config.SmallRyeConfigBuilder;
import io.smallrye.config.SmallRyeConfigBuilderCustomizer;

/**
* A configuration customizer to change the default packaging to uber-jar.
*/
public final class ConfigurationCustomizer implements SmallRyeConfigBuilderCustomizer {
public void configBuilder(final SmallRyeConfigBuilder builder) {
builder.withInterceptorFactories(new ConfigSourceInterceptorFactory() {
public ConfigSourceInterceptor getInterceptor(final ConfigSourceInterceptorContext context) {
return (ic, name) -> switch (name) {
case "quarkus.package.jar.type" ->
ConfigValue.builder().withName(name).withValue("uber-jar").build();
default -> ic.proceed(name);
};
}

public OptionalInt getPriority() {
return OptionalInt.of(Integer.MIN_VALUE + 100);
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.quarkus.funqy.gcp.functions.deployment.bindings.ConfigurationCustomizer

0 comments on commit a6850cc

Please sign in to comment.