use Cwd qw(abs_path getcwd);
$path = abs_path(dirname($exe));
chop($java=`which java`);
$jarfile_name = "xml-casa-assembly-1.68.jar";
$jarfile = "$path/java/$jarfile_name";
my $devjarfile = "$path/../target/scala-2.12/$jarfile_name";
my $cmd = "curl --create-dirs --output $jarfile https://casa.nrao.edu/download/devel/xml-casa/java/$jarfile_name 2>&1 |";
if ( `file $jarfile` =~ m|HTML| ) {
print( "\t--------------------------------------------------------------------------\n" );
print( "\tcould not fetch $jarfile_name\n" );
print( "\t--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- \n" );
print( "\t--------------------------------------------------------------------------\n" );
die "configuration error, cannot find jar file ($jarfile_name)" unless -e $jarfile;
m|^-markdown$| && (push(@flags,$_),$doing_something=1,next);
m|^-upgrade$| && (push(@flags,$_),$doing_something=1,next);
m|^-header$| && (push(@flags,$_),$doing_something=1,next);
m|^-swig$| && (push(@flags,$_),$doing_something=1,next);
m|^-tool$| && (push(@flags,$_),$doing_something=1,next);
m|^-task$| && (push(@flags,$_),$doing_something=1,next);
m|^-gotask$| && (push(@flags,$_),$doing_something=1,next);
m|^-all$| && (push(@flags,$_),$doing_something=1,next);
m|^-tgts$| && (push(@flags,$_),$doing_something=1,next);
m|^-output-tool-subdir$| && (push(@flags,$_),next);
m|^-help$| && (usage(), exit(0));
m|^gotask-imp-module=(.*)$| && (push(@flags,$_),next);
m|\.xml$| && -f && (push(@inputs,$_),next);
if ( m|^outdir=(.*)$| ) {
if ( -d $1 ) { push(@flags,$_) }