Advertisement
Guest User

Untitled

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