msbuild.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/env bash
  2. source="${BASH_SOURCE[0]}"
  3. # resolve $source until the file is no longer a symlink
  4. while [[ -h "$source" ]]; do
  5. scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
  6. source="$(readlink "$source")"
  7. # if $source was a relative symlink, we need to resolve it relative to the path where the
  8. # symlink file was located
  9. [[ $source != /* ]] && source="$scriptroot/$source"
  10. done
  11. scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
  12. verbosity='minimal'
  13. warn_as_error=true
  14. node_reuse=true
  15. prepare_machine=false
  16. extra_args=''
  17. while (($# > 0)); do
  18. lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")"
  19. case $lowerI in
  20. --verbosity)
  21. verbosity=$2
  22. shift 2
  23. ;;
  24. --warnaserror)
  25. warn_as_error=$2
  26. shift 2
  27. ;;
  28. --nodereuse)
  29. node_reuse=$2
  30. shift 2
  31. ;;
  32. --ci)
  33. ci=true
  34. shift 1
  35. ;;
  36. --preparemachine)
  37. prepare_machine=true
  38. shift 1
  39. ;;
  40. *)
  41. extra_args="$extra_args $1"
  42. shift 1
  43. ;;
  44. esac
  45. done
  46. . "$scriptroot/tools.sh"
  47. if [[ "$ci" == true ]]; then
  48. node_reuse=false
  49. fi
  50. MSBuild $extra_args
  51. ExitWithExitCode 0