Skip to content

Commit

Permalink
Build stuff (#17)
Browse files Browse the repository at this point in the history
* Add the V make parameter to enable verbose logging

Setting V to anything than 0 (zero) enables verbose logging for
{ms,x}build as well as exports MONO_OPTIONS=--debug to enable
stack traces should an exception be thrown when running mono.

To add/override MONO_OPTIONS simply set it on the command line when
invoking make, for instance:

    make V=1 MONO_OPTIONS="--trace"

* File.Move doesn't overwrite targets

File.Move will throw an exception whenever the target file exists.
Assuming that the task should overwrite the existing target files
for smooth operation, this change checks whether the target file
exists and, if so, deletes it prior to calling File.Move
  • Loading branch information
grendello authored and dellis1972 committed May 4, 2016
1 parent 39c5905 commit ff1993a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
V ?= 0
CONFIGURATION = Debug
MSBUILD = xbuild /p:Configuration=$(CONFIGURATION) $(MSBUILD_ARGS)

ifneq ($(V),0)
MONO_OPTIONS += --debug
MSBUILD += /v:d
endif

ifneq ($(MONO_OPTIONS),)
export MONO_OPTIONS
endif

all:
$(MSBUILD)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ async TTask ExtractFile (string tempDir, string sourceFile, string relativeDestD
Log.LogMessage (MessageImportance.Low, $"mv '{fse}' '{dest}'");
if (Directory.Exists (fse))
Process.Start ("/bin/mv", $@"""{fse}"" ""{dest}""").WaitForExit ();
else
else {
if (File.Exists (dest))
File.Delete (dest);
File.Move (fse, dest);
}
}
}
}
Expand Down

0 comments on commit ff1993a

Please sign in to comment.