From 951781b838e627f2de6f73c93055be5bf4b55273 Mon Sep 17 00:00:00 2001 From: Jacob Carlborg Date: Sat, 16 Jan 2016 21:29:03 +0100 Subject: [PATCH] Fix #44: Debian 0.2.1 release on Fedora Rawhide Make the input file optional. This allows access to Clang flags which don't take any arguments. --- build.sh | 2 +- dstep/driver/Application.d | 18 +++++++++++++----- dub.json | 2 +- dub.selections.json | 4 ++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 41a8ac48..9e630eb8 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ if [ -s "$HOME/.dvm/scripts/dvm" ] ; then . "$HOME/.dvm/scripts/dvm" ; - dvm use 2.066.1 + dvm use 2.069.2 fi dub build diff --git a/dstep/driver/Application.d b/dstep/driver/Application.d index 62f10026..1e595633 100644 --- a/dstep/driver/Application.d +++ b/dstep/driver/Application.d @@ -49,8 +49,15 @@ class Application : DStack.Application protected override void run () { handleArguments; - inputFiles ~= arguments.argument.input; - startConversion(inputFiles.first); + + if (arguments.argument.input.hasValue) + { + inputFiles ~= arguments.argument.input; + startConversion(inputFiles.first); + } + + else + startConversion(""); } protected override void setupArguments () @@ -88,15 +95,16 @@ private: translationUnit = TranslationUnit.parse(index, file, compilerArgs, compiler.extraHeaders); - if (!translationUnit.isValid) - throw new DStepException("An unknown error occurred"); + // hope that the diagnostics below handle everything + // if (!translationUnit.isValid) + // throw new DStepException("An unknown error occurred"); diagnostics = translationUnit.diagnostics; scope (exit) clean; - if (handleDiagnostics) + if (handleDiagnostics && file.any) { Translator.Options options; options.outputFile = arguments.output; diff --git a/dub.json b/dub.json index 397ac17e..7e430ba4 100644 --- a/dub.json +++ b/dub.json @@ -33,6 +33,6 @@ ], "dependencies": { - "dstack": "0.0.4" + "dstack": "~>0.0.5" } } diff --git a/dub.selections.json b/dub.selections.json index a4896505..5a6a281d 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -1,8 +1,8 @@ { "fileVersion": 1, "versions": { - "dstack": "0.0.4", - "mambo": "0.0.6", + "dstack": "0.0.5", + "mambo": "0.0.7", "tango": "1.0.3+2.068" } }