Advertisement
Guest User

Untitled

a guest
Feb 21st, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. SHELL = bash
  2.  
  3. ###
  4. # xcodebuild common arguments
  5. ###
  6. WORKSPACE := MyProject.xcworkspace
  7. SCHEME := MyScheme
  8. DEBUG_CONFIGURATION := Debug
  9. SIMULATOR := platform=iOS Simulator,OS=9.2,name=iPhone 6
  10.  
  11. ###
  12. # Utility programs
  13. ###
  14. XCPRETTY := xcpretty
  15. SLATHER := slather
  16. DOXYGEN := doxygen
  17. JAZZY := jazzy
  18. XCODEBUILD := xcodebuild -workspace "${WORKSPACE}" -scheme "${SCHEME}"
  19.  
  20. ###
  21. # Directories
  22. ###
  23. DOCS_DIRECTORY := docs
  24. BUILD_DIRECTORY := build
  25. REPORTS_DIRECTORY := ${BUILD_DIRECTORY}/reports
  26.  
  27. ###
  28. # Custom targets
  29. ###
  30. .PHONY: clean build test
  31. .PHONY: analyze report_coverage
  32. .PHONY: documentation delete_documentation
  33. .PHONY: ${XCPRETTY} ${SLATHER} ${DOXYGEN} ${JAZZY}
  34.  
  35. .DEFAULT_GOAL = build
  36.  
  37.  
  38. ###
  39. # Building
  40. ###
  41. clean: ${XCPRETTY}
  42. @set -o pipefail && ${XCODEBUILD} -configuration "${DEBUG_CONFIGURATION}" clean | ${XCPRETTY}
  43.  
  44. build: clean
  45. @set -o pipefail && ${XCODEBUILD} -configuration "${DEBUG_CONFIGURATION}" -destination "${SIMULATOR}" build | ${XCPRETTY}
  46.  
  47. test: clean
  48. @set -o pipefail && ${XCODEBUILD} -configuration "${DEBUG_CONFIGURATION}" -destination "${SIMULATOR}" test | ${XCPRETTY}
  49.  
  50. ${XCPRETTY}:
  51. @type ${XCPRETTY}
  52.  
  53. ###
  54. # Code Quality
  55. ###
  56. analyze: clean
  57. @set -o pipefail && ${XCODEBUILD} -configuration "${DEBUG_CONFIGURATION}" -sdk iphoneos analyze | ${XCPRETTY}
  58.  
  59. report_coverage:
  60. @slather coverage --simple-output GPX.xcodeproj
  61.  
  62. # When build artifacts must be generated
  63. ${REPORTS_DIRECTORY}:
  64. @mkdir -p ${REPORTS_DIRECTORY}
  65.  
  66. ###
  67. # Documentation
  68. ###
  69. # FIXME: Jazzy for Objective-C only seems to play well with frameworks, not apps.
  70. # jazzy --objc --clean --umbrella-header ???.h --framework-root . --sdk iphoneos
  71. documentation: ${DOXYGEN} delete_documentation
  72. @${DOXYGEN}
  73.  
  74. ${DOXYGEN}:
  75. @type ${DOXYGEN}
  76.  
  77. ${DOCS_DIRECTORY}:
  78. @mkdir -p ${DOCS_DIRECTORY}
  79.  
  80. delete_documentation: ${DOCS_DIRECTORY}
  81. @echo "Cleaning ${DOCS_DIRECTORY} directory" && rm -rf "${DOCS_DIRECTORY}/*"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement