Skip to content

Commit

Permalink
Merge pull request quarkusio#28687 from geoand/appcds-missing-feature
Browse files Browse the repository at this point in the history
Add missing code for improved AppCDS feature
  • Loading branch information
geoand authored Oct 19, 2022
2 parents 4ee09af + 8f9947b commit b175105
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import io.quarkus.deployment.configuration.RunTimeConfigurationGenerator;
import io.quarkus.deployment.naming.NamingConfig;
import io.quarkus.deployment.pkg.PackageConfig;
import io.quarkus.deployment.pkg.builditem.AppCDSControlPointBuildItem;
import io.quarkus.deployment.pkg.builditem.AppCDSRequestedBuildItem;
import io.quarkus.deployment.recording.BytecodeRecorderImpl;
import io.quarkus.dev.appstate.ApplicationStateNotification;
Expand Down Expand Up @@ -117,6 +118,7 @@ void build(List<StaticBytecodeRecorderBuildItem> staticInitTasks,
ApplicationInfoBuildItem applicationInfo,
List<AllowJNDIBuildItem> allowJNDIBuildItems,
Optional<AppCDSRequestedBuildItem> appCDSRequested,
Optional<AppCDSControlPointBuildItem> appCDSControlPoint,
NamingConfig namingConfig) {

appClassNameProducer.produce(new ApplicationClassNameBuildItem(Application.APP_CLASS_NAME));
Expand Down Expand Up @@ -191,8 +193,9 @@ void build(List<StaticBytecodeRecorderBuildItem> staticInitTasks,
mv = file.getMethodCreator("doStart", void.class, String[].class);
mv.setModifiers(Modifier.PROTECTED | Modifier.FINAL);

// if AppCDS generation was requested, we ensure that the application simply loads some classes from a file and terminates
if (appCDSRequested.isPresent()) {
// if AppCDS generation was requested and no other code has requested handling of the process,
// we ensure that the application simply loads some classes from a file and terminates
if (appCDSRequested.isPresent() && appCDSControlPoint.isEmpty()) {
ResultHandle createAppCDsSysProp = mv.invokeStaticMethod(
ofMethod(System.class, "getProperty", String.class, String.class, String.class),
mv.load(GENERATE_APP_CDS_SYSTEM_PROPERTY), mv.load("false"));
Expand Down

0 comments on commit b175105

Please sign in to comment.