org.bitbucket.bradleysmithllc.etlunit.cli.VersionsCmd Maven / Gradle / Ivy
package org.bitbucket.bradleysmithllc.etlunit.cli;
import org.bitbucket.bradleysmithllc.module_signer_mojo.IMavenProject;
import org.bitbucket.bradleysmithllc.module_signer_mojo.ModuleVersion;
import org.bitbucket.bradleysmithllc.module_signer_mojo.ModuleVersions;
import org.clamshellcli.api.Command;
import org.clamshellcli.api.Context;
import org.clamshellcli.api.IOConsole;
import java.util.*;
public class VersionsCmd implements Command {
private static final String NAMESPACE = "syscmd";
public static final String ACTION_NAME = "versions";
public Object execute(Context ctx) {
IOConsole console = ctx.getIoConsole();
List mvlist = new ModuleVersions().getAvailableVersions();
for (IMavenProject mv : mvlist)
{
console.writeOutput(
mv.getMavenGroupId()
+ "."
+ mv.getMavenArtifactId() + "\n");
console.writeOutput(mv.getMavenVersionNumber() + "\n");
console.writeOutput(mv.getGitBranch() + "\n");
console.writeOutput(mv.isGitBranchClean() + "\n");
console.writeOutput(mv.getGitBranchChecksum() + "\n");
}
return null;
}
public void plug(Context plug) {
// no load-time setup needed
}
public Descriptor getDescriptor(){
return new Descriptor() {
public String getNamespace() {return NAMESPACE;}
public String getName() {
return ACTION_NAME;
}
public String getDescription() {
return "Prints the version info of all installed bitbucket modules";
}
public String getUsage() {
return "versions";
}
public Map getArguments() {
return Collections.emptyMap();
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy