idebuild 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. #
  3. # idebuild -- Build a project using the native IDE
  4. #
  5. PRODUCT=goahead
  6. XCODE=/usr/bin/xcodebuild
  7. PROFILE=default
  8. BINARIES="goahead goahead-test gopass"
  9. LIBRARIES="libgo"
  10. # Just for VS
  11. unset TEMP TMP
  12. for v in 12 11 10
  13. do
  14. VS="/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/devenv.exe"
  15. if [ -x "${VS}" ] ; then
  16. break
  17. fi
  18. done
  19. log() {
  20. tag=$1
  21. shift
  22. printf "%12s %s\n" $tag "$*"
  23. }
  24. if [ -x "${VS}" ] ; then
  25. log "[Test]" "Building ${PRODUCT} Visual Studio Project"
  26. "${VS}" projects/${PRODUCT}-windows-${PROFILE}.sln /upgrade
  27. "${VS}" projects/${PRODUCT}-windows-${PROFILE}.sln /clean
  28. "${VS}" projects/${PRODUCT}-windows-${PROFILE}.sln /build
  29. for f in $BINARIES
  30. do
  31. echo check $f
  32. if [ ! -f build/windows-x86-${PROFILE}/bin/${f}.exe ] ; then
  33. echo "VS IDE build is missing $f.exe"
  34. exit 255
  35. fi
  36. done
  37. for f in $LIBRARIES
  38. do
  39. echo check $f
  40. if [ ! -f build/windows-x86-${PROFILE}/bin/${f}.dll ] ; then
  41. echo "VS IDE build is missing $f.dll"
  42. exit 255
  43. fi
  44. done
  45. fi
  46. if [ -x "${XCODE}" ] ; then
  47. log "[Test]" "Building ${PRODUCT} Xcode Project"
  48. "${XCODE}" -project projects/${PRODUCT}-macosx-${PROFILE}.xcodeproj -alltargets clean
  49. "${XCODE}" -project projects/${PRODUCT}-macosx-${PROFILE}.xcodeproj -alltargets build
  50. fi