Skip to content

Commit

Permalink
Merge pull request #80 from iosphere/develop-feature-flags
Browse files Browse the repository at this point in the history
Feature Flags
  • Loading branch information
Hagi authored Oct 17, 2016
2 parents c242b71 + a488130 commit ff248ae
Show file tree
Hide file tree
Showing 73 changed files with 842 additions and 1,851 deletions.
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ install:

script:
- set -o pipefail
# Build framework variants and clean all targets between builds
- xcodebuild -project ISHPermissionKit.xcodeproj -scheme ISHPermissionKit+HealthKit -destination 'platform=iOS Simulator,name=iPhone 6' -derivedDataPath build/ISHPermissionKitHealth clean build | xcpretty
# Build framework target and clean all targets between builds
- xcodebuild -project ISHPermissionKit.xcodeproj -scheme ISHPermissionKit -destination 'platform=iOS Simulator,name=iPhone 6' -derivedDataPath build/ISHPermissionKit clean build | xcpretty

# Build static lib variants and clean all targets between builds
# Build static lib target and clean all targets between builds
- xcodebuild -project ISHPermissionKit.xcodeproj -scheme ISHPermissionKitLib -destination 'platform=iOS Simulator,name=iPhone 6' -derivedDataPath build/ISHPermissionKitLib clean build | xcpretty
- xcodebuild -project ISHPermissionKit.xcodeproj -scheme 'ISHPermissionKitLib+HealthKit' -destination 'platform=iOS Simulator,name=iPhone 6' -derivedDataPath build/ISHPermissionKitLibHealth clean build | xcpretty

# run tests
- xcodebuild -project ISHPermissionKit.xcodeproj -scheme 'ISHPermissionKitLib+HealthKit' -destination 'platform=iOS Simulator,name=iPhone 6' -derivedDataPath build/ISHPermissionKitLibHealth clean test | xcpretty
- xcodebuild -project ISHPermissionKit.xcodeproj -scheme 'ISHPermissionKit+HealthKit' -destination 'platform=iOS Simulator,name=iPhone 6' -derivedDataPath build/ISHPermissionKitHealth clean test | xcpretty
- xcodebuild -project ISHPermissionKit.xcodeproj -scheme 'ISHPermissionKit' -destination 'platform=iOS Simulator,name=iPhone 6' -derivedDataPath build/ISHPermissionKit clean test | xcpretty
109 changes: 107 additions & 2 deletions ISHPermissionKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,116 @@ Pod::Spec.new do |s|
core.requires_arc = true
end

s.subspec 'Motion' do |motion|
motion.dependency 'ISHPermissionKit/Core'
motion.weak_framework = 'CoreMotion'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestMotionEnabled' }
motion.pod_target_xcconfig = feature_flags
motion.user_target_xcconfig = feature_flags
end

s.subspec 'Health' do |health|
health.dependency 'ISHPermissionKit/Core'

health.weak_framework = 'HealthKit'
health.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestHealthKitEnabled' }
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestHealthKitEnabled' }
health.pod_target_xcconfig = feature_flags
health.user_target_xcconfig = feature_flags
end

s.subspec 'Location' do |location|
location.dependency 'ISHPermissionKit/Core'
location.weak_framework = 'CoreLocation'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestLocationEnabled' }
location.pod_target_xcconfig = feature_flags
location.user_target_xcconfig = feature_flags
end

s.subspec 'Microphone' do |mic|
mic.dependency 'ISHPermissionKit/Core'
mic.weak_framework = 'AVFoundation'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestMicrophoneEnabled' }
mic.pod_target_xcconfig = feature_flags
mic.user_target_xcconfig = feature_flags
end

s.subspec 'PhotoLibrary' do |photo|
photo.dependency 'ISHPermissionKit/Core'
photo.weak_framework = 'Photos', 'AssetsLibrary'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestPhotoLibraryEnabled' }
photo.pod_target_xcconfig = feature_flags
photo.user_target_xcconfig = feature_flags
end

s.subspec 'Camera' do |cam|
cam.dependency 'ISHPermissionKit/Core'
cam.weak_framework = 'AVFoundation'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestCameraEnabled' }
cam.pod_target_xcconfig = feature_flags
cam.user_target_xcconfig = feature_flags
end

s.subspec 'Notifications' do |note|
note.dependency 'ISHPermissionKit/Core'
note.weak_framework = 'UIKit', 'UserNotifications'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestNotificationsEnabled' }
note.pod_target_xcconfig = feature_flags
note.user_target_xcconfig = feature_flags
end

s.subspec 'SocialAccounts' do |social|
social.dependency 'ISHPermissionKit/Core'
social.weak_framework = 'Accounts'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestSocialAccountsEnabled' }
social.pod_target_xcconfig = feature_flags
social.user_target_xcconfig = feature_flags
end

s.subspec 'Contacts' do |contacts|
contacts.dependency 'ISHPermissionKit/Core'
contacts.weak_framework = 'Contacts', 'AddressBook'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestContactsEnabled' }
contacts.pod_target_xcconfig = feature_flags
contacts.user_target_xcconfig = feature_flags
end

s.subspec 'Calendar' do |cal|
cal.dependency 'ISHPermissionKit/Core'
cal.weak_framework = 'EventKit'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestCalendarEnabled' }
cal.pod_target_xcconfig = feature_flags
cal.user_target_xcconfig = feature_flags
end

s.subspec 'Reminders' do |rem|
rem.dependency 'ISHPermissionKit/Core'
rem.weak_framework = 'EventKit'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestRemindersEnabled' }
rem.pod_target_xcconfig = feature_flags
rem.user_target_xcconfig = feature_flags
end

s.subspec 'Siri' do |siri|
siri.dependency 'ISHPermissionKit/Core'
siri.weak_framework = 'Intents'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestSiriEnabled' }
siri.pod_target_xcconfig = feature_flags
siri.user_target_xcconfig = feature_flags
end

s.subspec 'Speech' do |speech|
speech.dependency 'ISHPermissionKit/Core'
speech.weak_framework = 'Speech'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestSpeechEnabled' }
speech.pod_target_xcconfig = feature_flags
speech.user_target_xcconfig = feature_flags
end

s.subspec 'MusicLibrary' do |music|
music.dependency 'ISHPermissionKit/Core'
music.weak_framework = 'MediaPlayer'
feature_flags = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'ISHPermissionRequestMusicLibraryEnabled' }
music.pod_target_xcconfig = feature_flags
music.user_target_xcconfig = feature_flags
end

end
Loading

0 comments on commit ff248ae

Please sign in to comment.