Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce IsLocalDevelopment boolean supplier #45145

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package io.quarkus.deployment;

import java.util.function.BooleanSupplier;

import io.quarkus.dev.spi.DevModeType;
import io.quarkus.runtime.LaunchMode;

/**
* Similar to {@link IsDevelopment} except checks whether the application is being launched in dev mode but not from a
* {@code mutable-jar} package,
* in other words, not a remote server in a remote dev session.
*/
public class IsLocalDevelopment implements BooleanSupplier {

private final LaunchMode launchMode;
private final DevModeType devModeType;

public IsLocalDevelopment(LaunchMode launchMode, DevModeType devModeType) {
this.launchMode = launchMode;
this.devModeType = devModeType;
}

@Override
public boolean getAsBoolean() {
return launchMode == LaunchMode.DEVELOPMENT && devModeType != DevModeType.REMOTE_SERVER_SIDE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import io.quarkus.agroal.runtime.DataSourcesJdbcBuildTimeConfig;
import io.quarkus.agroal.runtime.dev.ui.DatabaseInspector;
import io.quarkus.deployment.IsDevelopment;
import io.quarkus.deployment.IsLocalDevelopment;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.BuildSteps;
Expand All @@ -12,7 +12,7 @@
import io.quarkus.devui.spi.page.CardPageBuildItem;
import io.quarkus.devui.spi.page.Page;

@BuildSteps(onlyIf = IsDevelopment.class)
@BuildSteps(onlyIf = IsLocalDevelopment.class)
class AgroalDevUIProcessor {

@BuildStep
Expand Down
Loading