thsa/datawarrior

add .tsv extension to DataWarrior compatible data files

Closed this issue · 8 comments

Would it be possible to add .tsv extension? I know that currently TAB separated files with .txt extension are supported, so it is convenience/UX feature request. If at all possible I would appreciate it very much.

thsa commented

That's awesome!

However, I have some issues with the build (on mac). Here is what I did:

brew install java
brew info java
sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
git clone git@github.com:thsa/datawarrior.git
cd datawarrior
./buildDataWarrior >& buildDataWarrior.log
./runDataWarrior >& runDataWarrior.log

See attached log files:

buildDataWarrior.log
runDataWarrior.log

thsa commented

I installed liberica-jdk-8-full, but I still cannot build:

$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/liberica-jdk-8-full.jdk/Contents/Home/
$ $JAVA_HOME/bin/javac -d ./bin -sourcepath ./src:./stubs -classpath "./lib/*" src/com/actelion/research/datawarrior/DataWarriorOSX.java >& javac.log
rm -r bin/chemaxon
# rm: bin/chemaxon: No such file or directory
$JAVA_HOME/bin/jar -cfm datawarrior.jar manifest_additions.txt -C ./bin .
rm -r bin
# feeling lucky :)
$JAVA_HOME/bin/java -classpath "datawarrior.jar:./lib/*" com.actelion.research.datawarrior.DataWarriorOSX
Error: Could not find or load main class com.actelion.research.datawarrior.DataWarriorOSX

javac.log

thsa commented

Still does not work :( - Here is what I did:

git pull
./buildDataWarriorOSX >& buildDataWarriorOSX.log
./runDataWarriorOSX >& runDataWarriorOSX.log

BTW: build.sh (or something along these lines) might help to streamline things a bit...

#!/bin/sh

declare -A X=([Darwin]=OSX [Linux]=Linux)
OS_TAG=${X[`uname`]}

if [ -z ${OS_TAG+x} ]; then
  echo "WARNING: unknown OS= `uname`"
  exit 1
fi

mkdir ./bin
cp -r ./src/{html,images} ./bin
javac -d ./bin -sourcepath ./src:./stubs -classpath "./lib/*":./lib/${OS_TAG,,}/AppleJavaExtensions.jar src/com/actelion/research/datawarrior/DataWarrior${OS_TAG}.java
rm -r ./bin/chemaxon
jar -cfm datawarrior.jar manifest_additions${OS_TAG}.txt -C ./bin .
rm -rf ./bin

buildDataWarriorOSX.log
runDataWarriorOSX.log

thsa commented

My mistake, my "java" was pointing to the wrong location.
With build.sh and run.sh below, it works. Thanks!

build.sh:

#!/usr/local/bin/bash

OS=`uname`
declare -A OS_MAP=([Darwin]=OSX [Linux]=Linux)
OS_TAG=${OS_MAP[${OS}]}

if [ -z ${OS_TAG+x} ]; then
  echo "WARNING: unknown OS= ${OS}"
  exit 1
fi

if [ -z ${JAVA_HOME+x} ]; then
  if [ ${OS} == "Darwin" ]; then
    export JAVA_HOME=/Library/Java/JavaVirtualMachines/liberica-jdk-8-full.jdk/Contents/Home
  elif [ ${OS} == "Linux" ]; then
    export JAVA_HOME="???"
  fi
fi

mkdir ./bin
cp -r ./src/{html,images} ./bin
$JAVA_HOME/bin/javac -d ./bin \
          -sourcepath ./src:./stubs \
          -classpath "./lib/*":./lib/${OS_TAG,,}/AppleJavaExtensions.jar \
          src/com/actelion/research/datawarrior/DataWarrior${OS_TAG}.java
rm -rf ./bin/chemaxon
$JAVA_HOME/bin/jar -cfm datawarrior.jar manifest_additions${OS_TAG}.txt -C ./bin .
rm -rf ./bin

run.sh:

#!/usr/local/bin/bash

OS=`uname`
declare -A OS_MAP=([Darwin]=OSX [Linux]=Linux)
OS_TAG=${OS_MAP[${OS}]}

if [ -z ${OS_TAG+x} ]; then
  echo "WARNING: unknown OS= ${OS}"
  exit 1
fi

if [ -z ${JAVA_HOME+x} ]; then
  if [ ${OS} == "Darwin" ]; then
    export JAVA_HOME=/Library/Java/JavaVirtualMachines/liberica-jdk-8-full.jdk/Contents/Home
  elif [ ${OS} == "Linux" ]; then
    export JAVA_HOME="???"
  fi
fi

if [ $OS == "Darwin" ]; then
  $JAVA_HOME/bin/java \
     -classpath "datawarrior.jar:./lib/*:./lib/${OS_TAG,,}/AppleJavaExtensions.jar" \
     com.actelion.research.datawarrior.DataWarrior${OS_TAG}
elif [ $OS == "Darwin" ]; then
  $JAVA_HOME/bin/java -classpath "datawarrior.jar:./lib/*" \
      com.actelion.research.datawarrior.DataWarriorLinux
else
   echo "ERROR: unknown OS= $OS"
   exit 1
fi