Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
Conflicts:
	pom.xml
  • Loading branch information
kvb2univpitt committed Mar 5, 2019
2 parents 947bd8b + b082ea2 commit 370fa0b
Show file tree
Hide file tree
Showing 41 changed files with 1,494 additions and 921 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
- secure: CvgCaARwQXuVuiZxOXLtfVmgCS5yXkKJCbXSFB/3aJzCrGTSP8X+ihmXHoZ5/S3Z+KZNAWUwUI9N2dvYH03VqZV9obj/Qox5lNc0oO/xgNe9tXVrbartLslL1DMOkzCXoWf9rq8fys32rXcbuRjq8TKTebBAHnxC8CxJE3ptQa17DSQffLqo4nhRyJGLGwsGOrMCY5hviIVxgjbvjDwA0rbId8eyl9/3+wWAx2V8UPKUnlQgneiV/tsDjPpuY7Y6+OJEUEDObjSJCYhGdqDA3+CqDjFTF2aTTVpzf86YW7ke9j43vbGff/yrG53uzUIngqY5B641PI6H9D1echmPSKP0MHA/tVR+CfydzarBQE3xlwS8amnQ0edeOD/byf7TdztLjSr2VH4dlGQRQ0YbuSXf2VrP2kCLE5Yukx3IeLcJ5lMh9yjl0NdOUG/z+kCKPGnLm9PxDBJ0uhXbdFF7i1w0Jvt5VjVu/+Xqml8PDOPqVZ09Bwpz+6bTDkUDKmttkiX2LntH/2459PlLVMm7/6D+7hWdCpBXzi1bLi9g3VjIO80DMFMYUB9ibHJfEY0jZNMyyGZ9ihz8IiHH6lxOSMF1JH/e0D3l3m08dq29X9C4xtWu5DCGAe2rq2xUwgJxSVfWczJeXAGEaOVL/fk/NI7ptz8R6XEjmKopupp0+g4=

after_success:
- mvn deploy --settings settings.xml -DskipTests=true -B
- mvn deploy --settings settings.xml -DskipTests -B

before_script:
- echo "MAVEN_OPTS='-Xmx3g'" > ~/.mavenrc
18 changes: 14 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>edu.pitt.dbmi</groupId>
<artifactId>causal-cmd</artifactId>
<version>0.4.1</version>
<version>1.0.0</version>
<packaging>jar</packaging>

<properties>
Expand Down Expand Up @@ -61,7 +61,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
<configuration>
<archive>
<manifest>
Expand All @@ -73,7 +73,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -139,17 +139,27 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>edu.pitt.dbmi</groupId>
<artifactId>data-reader</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>edu.pitt.dbmi</groupId>
<artifactId>data-reader</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
<version>1.7.26</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017 University of Pittsburgh.
* Copyright (C) 2019 University of Pittsburgh.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017 University of Pittsburgh.
* Copyright (C) 2019 University of Pittsburgh.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand All @@ -16,9 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package edu.pitt.dbmi.causal.cmd.util;
package edu.pitt.dbmi.causal.cmd;

import edu.pitt.dbmi.causal.cmd.ParseOptions;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
Expand All @@ -33,15 +32,15 @@

/**
*
* Mar 10, 2017 1:26:52 PM
* Jan 8, 2019 12:04:29 PM
*
* @author Kevin V. Bui ([email protected])
*/
public class Application {
public final class Applications {

private static final DateFormat DF = new SimpleDateFormat("EEE, MMMM dd, yyyy hh:mm:ss a");

private Application() {
private Applications() {
}

public static void showHelp(String[] args, ParseOptions parseOptions, String footer) {
Expand Down Expand Up @@ -108,11 +107,11 @@ public static String fmtDateNow() {
}

public static String jarTitle() {
return Application.class.getPackage().getImplementationTitle();
return Applications.class.getPackage().getImplementationTitle();
}

public static String jarVersion() {
String version = Application.class.getPackage().getImplementationVersion();
String version = Applications.class.getPackage().getImplementationVersion();

return (version == null) ? "unknown" : version;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017 University of Pittsburgh.
* Copyright (C) 2019 University of Pittsburgh.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand All @@ -16,13 +16,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package edu.pitt.dbmi.causal.cmd.util;
package edu.pitt.dbmi.causal.cmd;

import edu.pitt.dbmi.causal.cmd.CmdOptions;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.Option;
Expand All @@ -35,7 +36,7 @@
*
* @author Kevin V. Bui ([email protected])
*/
public class Args {
public final class Args {

private Args() {
}
Expand Down Expand Up @@ -138,6 +139,13 @@ public static String[] extractOptions(String[] args, Options options) {
return argsList.toArray(new String[argsList.size()]);
}

/**
* Parse the long parameters from the command inputs to map where the
* parameters are map keys and parameter values are map values.
*
* @param args
* @return
*/
public static Map<String, String> toMapLongOptions(String[] args) {
Map<String, String> map = new HashMap<>();

Expand All @@ -163,6 +171,13 @@ public static Map<String, String> toMapLongOptions(String[] args) {
return map;
}

/**
* Parse the command inputs to map where the parameters are map keys and
* parameter values are map values.
*
* @param args
* @return
*/
public static Map<String, String> toMapOptions(String[] args) {
Map<String, String> map = new HashMap<>();

Expand Down Expand Up @@ -214,21 +229,13 @@ public static boolean isEmpty(String[] args) {
}

public static String[] clean(String[] args) {
if (args == null) {
return new String[0];
}

List<String> argList = new LinkedList<>();
for (String arg : args) {
if (arg != null) {
arg = arg.trim();
if (!arg.isEmpty()) {
argList.add(arg);
}
}
}

return argList.toArray(new String[argList.size()]);
return (args == null)
? new String[0]
: Arrays.stream(args)
.filter(Objects::nonNull)
.map(String::trim)
.filter(e -> !e.isEmpty())
.toArray(String[]::new);
}

}
Loading

0 comments on commit 370fa0b

Please sign in to comment.