Skip to content

Commit

Permalink
feat: Agent version ranges from 1.3 to 2.0 (not inclusive)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgilpin committed Aug 6, 2021
1 parent d6e9019 commit e32f238
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/main/java/com/appland/appmap/AppMapPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.file.FileSystemOperations;
import org.gradle.api.internal.project.ProjectInternal;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.ReportingBasePlugin;
import org.gradle.language.base.plugins.LifecycleBasePlugin;
Expand All @@ -13,8 +11,7 @@
* The actual plugin definition for appmap plugin.
*/
public class AppMapPlugin implements Plugin<Project> {

public static final String DEFAULT_AGENT_VERSION = "latest.release";
public static final String DEFAULT_AGENT_VERSION = "[1.3, 2.0)";
public static final String AGENT_CONFIGURATION_NAME = "appmapAgent";
public static final String PLUGIN_EXTENSION_NAME = "appmap";
private Project project;
Expand Down Expand Up @@ -47,9 +44,7 @@ private void registerAgentConfiguration() {
}

private void addAppMapGradleTasks(AppMapPluginExtension extension) {
project.getPlugins().withType(JavaPlugin.class, javaPlugin -> {
addAppMapTasks(extension);
});
project.getPlugins().withType(JavaPlugin.class, javaPlugin -> addAppMapTasks(extension));
}

/**
Expand All @@ -66,15 +61,10 @@ private void addAppMapTasks(AppMapPluginExtension extension) {
prepareAgentTask.doFirst(
new ValidateConfigAction(extension.getConfigFile().getAsFile())
);
prepareAgentTask.doLast(
new CleanOutputDirectoryAction(
((ProjectInternal) project).getServices().get(FileSystemOperations.class),
extension.getOutputDirectory().getAsFile())
);
prepareAgentTask.doLast(new LoadAppMapAgentAction(project, extension));
prepareAgentTask.setGroup(LifecycleBasePlugin.BUILD_GROUP);
prepareAgentTask.setDescription(
String.format("Attaches AppMap Agent to the Test task")
String.format("Injects AppMap Agent JVM settings to the 'test' task")
);
});

Expand All @@ -86,7 +76,7 @@ private void addAppMapTasks(AppMapPluginExtension extension) {
);
validateConfigTask.setGroup(LifecycleBasePlugin.BUILD_GROUP);
validateConfigTask.setDescription(
String.format("Searches AppMap Agent config file and validates it")
String.format("Validates the AppMap Agent configuration")
);
}
);
Expand Down

0 comments on commit e32f238

Please sign in to comment.