forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...deployment/src/main/java/io/quarkus/amazon/lambda/deployment/ConfigurationCustomizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
}); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...t/src/main/resources/META-INF/services/io.smallrye.config.SmallRyeConfigBuilderCustomizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
io.quarkus.amazon.lambda.deployment.ConfigurationCustomizer |
31 changes: 31 additions & 0 deletions
31
...main/java/io/quarkus/funqy/gcp/functions/deployment/bindings/ConfigurationCustomizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
}); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...t/src/main/resources/META-INF/services/io.smallrye.config.SmallRyeConfigBuilderCustomizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
io.quarkus.funqy.gcp.functions.deployment.bindings.ConfigurationCustomizer |