-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45145 from aloubyansky/is-local-dev
Introduce IsLocalDevelopment boolean supplier
- Loading branch information
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
core/deployment/src/main/java/io/quarkus/deployment/IsLocalDevelopment.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,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; | ||
} | ||
} |
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