Search in sources :

Example 1 with VersionInfo

use of com.milaboratory.util.VersionInfo in project repseqio by repseqio.

the class Main method main.

public static void main(String[] args) throws Exception {
    Signal.handle(new Signal("PIPE"), new SignalHandler() {

        @Override
        public void handle(Signal signal) {
            System.exit(0);
        }
    });
    if (System.getProperty("localOnly") == null) {
        Path cachePath = Paths.get(System.getProperty("user.home"), ".repseqio", "cache");
        SequenceResolvers.initDefaultResolver(cachePath);
    }
    // Setting up main helper
    JCommanderBasedMain main = new JCommanderBasedMain("repseqio", new ListAction(), new FilterAction(), new MergeAction(), new CompileAction(), new GenerateClonesAction(), new NormalizeCloneAbundancesAction(), new ExportCloneSequencesAction(), new FastaAction(), new TsvAction(), new InferAnchorPointsAction(), new DebugAction(), new FormatAction(), new StatAction(), new FromFastaAction(), new FromPaddedFastaAction());
    main.setVersionInfoCallback(new Runnable() {

        @Override
        public void run() {
            VersionInfo milib = VersionInfo.getVersionInfoForArtifact("milib");
            VersionInfo repseqio = VersionInfo.getVersionInfoForArtifact("repseqio");
            StringBuilder builder = new StringBuilder();
            builder.append("RepSeq.IO.CLI v").append(repseqio.getVersion()).append(" (built ").append(repseqio.getTimestamp()).append("; rev=").append(repseqio.getRevision()).append("; branch=").append(repseqio.getBranch()).append("; host=").append(repseqio.getHost()).append(")").append("\n");
            builder.append("MiLib v").append(milib.getVersion()).append(" (rev=").append(milib.getRevision()).append("; branch=").append(milib.getBranch()).append(")").append("\n");
            builder.append("Built-in libraries:\n");
            VDJCLibraryRegistry reg = VDJCLibraryRegistry.createDefaultRegistry();
            reg.loadAllLibraries("default");
            for (VDJCLibrary lib : reg.getLoadedLibraries()) builder.append(lib.getLibraryId()).append("\n");
            System.out.print(builder.toString());
        }
    });
    main.main(args);
}
Also used : Signal(sun.misc.Signal) Path(java.nio.file.Path) VersionInfo(com.milaboratory.util.VersionInfo) JCommanderBasedMain(com.milaboratory.cli.JCommanderBasedMain) SignalHandler(sun.misc.SignalHandler) VDJCLibrary(io.repseq.core.VDJCLibrary) VDJCLibraryRegistry(io.repseq.core.VDJCLibraryRegistry)

Aggregations

JCommanderBasedMain (com.milaboratory.cli.JCommanderBasedMain)1 VersionInfo (com.milaboratory.util.VersionInfo)1 VDJCLibrary (io.repseq.core.VDJCLibrary)1 VDJCLibraryRegistry (io.repseq.core.VDJCLibraryRegistry)1 Path (java.nio.file.Path)1 Signal (sun.misc.Signal)1 SignalHandler (sun.misc.SignalHandler)1