Skip to content

Commit

Permalink
fix: gsub Appmap -> AppMap
Browse files Browse the repository at this point in the history
  • Loading branch information
kgilpin committed Aug 6, 2021
1 parent ceec53c commit 9286a9f
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/appland/appmap/AgentCommandLineLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
import org.gradle.util.RelativePathUtil;

/**
* This class is the actual responsible of building the JVM args to run the Appmap Agent.
* This class is the actual responsible of building the JVM args to run the AppMap Agent.
*/
public class AgentCommandLineLoader implements CommandLineArgumentProvider, Named {

private static final Logger LOGGER = Logging.getLogger(CommandLineArgumentProvider.class);
private static final List<String> DEBUG_FLAGS = Arrays.asList("hooks", "locals", "http");

private final AppmapPluginExtension appmap;
private final AppMapPluginExtension appmap;

public AgentCommandLineLoader(AppmapPluginExtension appmap) {
public AgentCommandLineLoader(AppMapPluginExtension appmap) {
this.appmap = appmap;
}

Expand Down Expand Up @@ -55,7 +55,7 @@ public List<String> getAsJvmArg() {
+ appmap.getConfigFile().get().getAsFile().getPath());
}
if (appmap.shouldSkip()) {
LOGGER.warn("Appmap task was executed but but is disable, skip property set to " + appmap
LOGGER.warn("AppMap task was executed but but is disable, skip property set to " + appmap
.shouldSkip());
return new ArrayList<>();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* The actual plugin definition for appmap plugin.
*/
public class AppmapPlugin implements Plugin<Project> {
public class AppMapPlugin implements Plugin<Project> {

public static final String DEFAULT_AGENT_VERSION = "latest.release";
public static final String AGENT_CONFIGURATION_NAME = "appmapAgent";
Expand All @@ -27,28 +27,28 @@ public void apply(Project project) {
final Configuration config = project.getConfigurations().getAt(AGENT_CONFIGURATION_NAME);
config.setVisible(false);
config.setTransitive(true);
config.setDescription("Appmap agent to generate app map data.");
config.setDescription("AppMap agent to generate app map data.");
config.defaultDependencies(dependencies ->
dependencies.add(
project.getDependencies().create("com.appland:appmap-agent:" + DEFAULT_AGENT_VERSION)
)
);
AppmapPluginExtension extension = project.getExtensions()
.create(PLUGIN_EXTENSION_NAME, AppmapPluginExtension.class, project, config);
AppMapPluginExtension extension = project.getExtensions()
.create(PLUGIN_EXTENSION_NAME, AppMapPluginExtension.class, project, config);
//extension.setAgentVersion(DEFAULT_AGENT_VERSION);*/
addAppmapGradleTasks(extension);
addAppMapGradleTasks(extension);
}

private void registerAgentConfiguration() {
Configuration agentConf = project.getConfigurations().create(AGENT_CONFIGURATION_NAME);
agentConf.setVisible(false);
agentConf.setTransitive(true);
agentConf.setDescription("Appmap agent to generate app map data.");
agentConf.setDescription("AppMap agent to generate app map data.");
}

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

Expand All @@ -58,10 +58,10 @@ private void addAppmapGradleTasks(AppmapPluginExtension extension) {
*
* @param extension holds the config parameters for the plugin.
*/
private void addAppmapTasks(AppmapPluginExtension extension) {
private void addAppMapTasks(AppMapPluginExtension extension) {
project.getTasks().register(
"appmap",
AppmapTask.class,
AppMapTask.class,
prepareAgentTask -> {
prepareAgentTask.doFirst(
new ValidateConfigAction(extension.getConfigFile().getAsFile())
Expand All @@ -71,10 +71,10 @@ private void addAppmapTasks(AppmapPluginExtension extension) {
((ProjectInternal) project).getServices().get(FileSystemOperations.class),
extension.getOutputDirectory().getAsFile())
);
prepareAgentTask.doLast(new LoadAppmapAgentAction(project, extension));
prepareAgentTask.doLast(new LoadAppMapAgentAction(project, extension));
prepareAgentTask.setGroup(LifecycleBasePlugin.BUILD_GROUP);
prepareAgentTask.setDescription(
String.format("Attaches Appmap Agent to the Test task")
String.format("Attaches AppMap Agent to the Test task")
);
});

Expand All @@ -86,7 +86,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("Searches AppMap Agent config file and validates it")
);
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* This class holds the configuration parameters read from the target project gradle.build
*/
public class AppmapPluginExtension {
public class AppMapPluginExtension {

public static final String DEFAULT_OUTPUT_DIRECTORY = "build/appmap";
protected final Project project;
Expand All @@ -32,20 +32,20 @@ public class AppmapPluginExtension {

/**
* Constructor method, receives the project, configuration and fork options, read and provide the
* rest of the configuration to the AppmapPlugin class.
* rest of the configuration to the AppMapPlugin class.
*
* @param project Actual project object representation.
* @param agentConf Holdder of the project configuration.
*/
public AppmapPluginExtension(Project project, Configuration agentConf) {
public AppMapPluginExtension(Project project, Configuration agentConf) {
this.project = project;
this.agentConf = agentConf;
this.configFile = project.getObjects().fileProperty().fileValue(new File("appmap.yml"));
this.outputDirectory = project.getObjects().directoryProperty()
.fileValue(new File(DEFAULT_OUTPUT_DIRECTORY));
this.debugFile = project.getObjects().fileProperty()
.fileValue(new File("build/appmap/agent.log"));
logger.info("Appmap Plugin Initialized.");
logger.info("AppMap Plugin Initialized.");
}

public Configuration getAgentConf() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
/**
* The actual task for adding <code>gradle appmap</code> to the build.
*/
public class AppmapTask extends Test {
public class AppMapTask extends Test {

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void execute(Task task) {
throw new GradleException(" destination file must not be null if output type is FILE");
}
if (fs.delete(spec -> spec.delete(outputDirectoryFile)).getDidWork()) {
task.getLogger().info("Appmap output directory cleared");
task.getLogger().info("AppMap output directory cleared");
} else {
task.getLogger().info("Output directory already cleared or is read only.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
/**
* This action if called sets a JvmArgumentProvider to the "test" task of the build.
*/
public class LoadAppmapAgentAction implements Action<Task> {
public class LoadAppMapAgentAction implements Action<Task> {

private static final Logger LOGGER = Logging.getLogger(LoadAppmapAgentAction.class);
private static final Logger LOGGER = Logging.getLogger(LoadAppMapAgentAction.class);

private final Project project;
private final AppmapPluginExtension extension;
private final AppMapPluginExtension extension;

public LoadAppmapAgentAction(Project project, AppmapPluginExtension extension) {
public LoadAppMapAgentAction(Project project, AppMapPluginExtension extension) {
this.project = project;
this.extension = extension;
}
Expand All @@ -29,11 +29,11 @@ public void execute(Task task) {
}

private <T extends Task & JavaForkOptions> void applyTo(final T task) {
if (task instanceof AppmapTask) {
if (task instanceof AppMapTask) {
return;
}
final String taskName = task.getName();
LOGGER.lifecycle("Attaching Appmap Agent to task: " + taskName);
LOGGER.lifecycle("Attaching AppMap Agent to task: " + taskName);
task.getJvmArgumentProviders().add(new AgentCommandLineLoader(extension));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class AppmapPluginFunctionalTest {
public class AppMapPluginFunctionalTest {

@TempDir File testProjectDir;
private File settingsFile;
Expand Down Expand Up @@ -61,7 +61,7 @@ public void testValidateConfigGoalSucceed() throws IOException {
}

@Test
public void testAppmapGoalSucceed() throws IOException {
public void testAppMapGoalSucceed() throws IOException {
writeFile(settingsFile, SETTINGS_GRADLE_CONTENT);
writeFile(buildFile, BUILD_FILE_CONTENT);
writeFile(appmapConfigFile, APPMAP_CONFIGFILE_CONTENT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.junit.jupiter.api.Test;


public class AppmapPluginTest {
public class AppMapPluginTest {
@Test
public void test() {
// Given
Expand Down

0 comments on commit 9286a9f

Please sign in to comment.