Skip to content

Commit

Permalink
Merge pull request #12911 from aloubyansky/common-dev-mode-runner
Browse files Browse the repository at this point in the history
Common dev mode launcher API for Maven and Gradle
  • Loading branch information
aloubyansky authored Oct 26, 2020
2 parents 673108d + 6dda6d1 commit 3233846
Show file tree
Hide file tree
Showing 8 changed files with 890 additions and 604 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package io.quarkus.gradle.tasks;

import org.gradle.api.logging.Logger;

import io.quarkus.deployment.dev.QuarkusDevModeLauncher;

public class GradleDevModeLauncher extends QuarkusDevModeLauncher {

public static Builder builder(Logger logger) {
return new GradleDevModeLauncher(logger).new Builder();
}

public class Builder extends QuarkusDevModeLauncher.Builder<GradleDevModeLauncher, Builder> {

private Builder() {
}
}

private final Logger logger;

private GradleDevModeLauncher(Logger logger) {
this.logger = logger;
}

@Override
protected boolean isDebugEnabled() {
return logger.isDebugEnabled();
}

@Override
protected void debug(Object msg) {
logger.warn(msg == null ? "null" : msg.toString());
}

@Override
protected void error(Object msg) {
logger.error(msg == null ? "null" : msg.toString());
}

@Override
protected void warn(Object msg) {
logger.warn(msg == null ? "null" : msg.toString());
}
}
291 changes: 92 additions & 199 deletions devtools/gradle/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package io.quarkus.gradle.tasks;

import io.quarkus.bootstrap.app.QuarkusBootstrap;
import io.quarkus.deployment.dev.DevModeContext;
import io.quarkus.deployment.dev.IsolatedRemoteDevModeMain;

public class QuarkusRemoteDev extends QuarkusDev {

public QuarkusRemoteDev() {
super("Remote development mode: enables hot deployment on remote JVM with background compilation");
}

protected void modifyDevModeContext(DevModeContext devModeContext) {
devModeContext.setMode(QuarkusBootstrap.Mode.PROD);
devModeContext.setAlternateEntryPoint(IsolatedRemoteDevModeMain.class.getName());
protected void modifyDevModeContext(GradleDevModeLauncher.Builder builder) {
builder.remoteDev(true);
}
}
Loading

0 comments on commit 3233846

Please sign in to comment.