Skip to content

Commit a6850cc

Browse files
committed
Missed a couple customizers
1 parent 40a86e6 commit a6850cc

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package io.quarkus.amazon.lambda.deployment;
2+
3+
import java.util.OptionalInt;
4+
5+
import io.smallrye.config.ConfigSourceInterceptor;
6+
import io.smallrye.config.ConfigSourceInterceptorContext;
7+
import io.smallrye.config.ConfigSourceInterceptorFactory;
8+
import io.smallrye.config.ConfigValue;
9+
import io.smallrye.config.SmallRyeConfigBuilder;
10+
import io.smallrye.config.SmallRyeConfigBuilderCustomizer;
11+
12+
/**
13+
* A configuration customizer to change the default packaging to legacy-jar.
14+
*/
15+
public final class ConfigurationCustomizer implements SmallRyeConfigBuilderCustomizer {
16+
public void configBuilder(final SmallRyeConfigBuilder builder) {
17+
builder.withInterceptorFactories(new ConfigSourceInterceptorFactory() {
18+
public ConfigSourceInterceptor getInterceptor(final ConfigSourceInterceptorContext context) {
19+
return (ic, name) -> switch (name) {
20+
case "quarkus.package.jar.type" ->
21+
ConfigValue.builder().withName(name).withValue("legacy-jar").build();
22+
default -> ic.proceed(name);
23+
};
24+
}
25+
26+
public OptionalInt getPriority() {
27+
return OptionalInt.of(Integer.MIN_VALUE + 100);
28+
}
29+
});
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
io.quarkus.amazon.lambda.deployment.ConfigurationCustomizer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package io.quarkus.funqy.gcp.functions.deployment.bindings;
2+
3+
import java.util.OptionalInt;
4+
5+
import io.smallrye.config.ConfigSourceInterceptor;
6+
import io.smallrye.config.ConfigSourceInterceptorContext;
7+
import io.smallrye.config.ConfigSourceInterceptorFactory;
8+
import io.smallrye.config.ConfigValue;
9+
import io.smallrye.config.SmallRyeConfigBuilder;
10+
import io.smallrye.config.SmallRyeConfigBuilderCustomizer;
11+
12+
/**
13+
* A configuration customizer to change the default packaging to uber-jar.
14+
*/
15+
public final class ConfigurationCustomizer implements SmallRyeConfigBuilderCustomizer {
16+
public void configBuilder(final SmallRyeConfigBuilder builder) {
17+
builder.withInterceptorFactories(new ConfigSourceInterceptorFactory() {
18+
public ConfigSourceInterceptor getInterceptor(final ConfigSourceInterceptorContext context) {
19+
return (ic, name) -> switch (name) {
20+
case "quarkus.package.jar.type" ->
21+
ConfigValue.builder().withName(name).withValue("uber-jar").build();
22+
default -> ic.proceed(name);
23+
};
24+
}
25+
26+
public OptionalInt getPriority() {
27+
return OptionalInt.of(Integer.MIN_VALUE + 100);
28+
}
29+
});
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
io.quarkus.funqy.gcp.functions.deployment.bindings.ConfigurationCustomizer

0 commit comments

Comments
 (0)