io.thundra.plugin.gradle.ThundraExtension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of thundra-gradle-test-plugin Show documentation
Show all versions of thundra-gradle-test-plugin Show documentation
Thundra Gradle plugin for test
The newest version!
package io.thundra.plugin.gradle;
import org.gradle.api.GradleException;
import org.gradle.api.Task;
import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
import org.gradle.process.JavaForkOptions;
/**
* @author tolgatakir
*/
public class ThundraExtension {
private static final Logger LOGGER = Logging.getLogger(ThundraExtension.class);
private String agentPath;
public ThundraExtension() {
}
public String getAgentPath() {
return agentPath;
}
public void setAgentPath(String agentPath) {
this.agentPath = agentPath;
}
public void apply(T task) {
if (this.getAgentPath() != null && !this.getAgentPath().isEmpty()) {
LOGGER.debug("Add Thundra Java agent " + this.getAgentPath() + " to " + task.getName());
task.jvmArgs(getJvmArgs());
} else {
throw new GradleException("Thundra Agent path is null or empty.");
}
}
private String getJvmArgs() {
try {
return "-javaagent:" + this.getAgentPath();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy