Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplication of Info.plist copying that was causing Xcode errors #194

Merged
merged 3 commits into from
Dec 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ Gemfile*.lock
/tmp/
fastlane-plugin-xcake/Gemfile.lock

## Specific to RubyMotion:
.dat*
.repl_history
build/
## Xcake test fixture temp files
spec/fixtures/integration/*/temp/**
spec/fixtures/integration/**/xcuserdata/**

## Documentation cache and generated files:
/.yardoc/
Expand Down
19 changes: 16 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ tasks = ENV.fetch('XCAKE_CI_TASKS') { ALL_TASKS }.upcase.split(/\s+/)

task :spec do
begin
all_specs = specs('.', 'fastlane-plugin-xcake')
all_specs = specs('.', 'fastlane-plugin-xcake', except_specs: ['./spec/integration_spec.rb'])
sh "bundle exec rspec #{all_specs}"
rescue RuntimeError
STDERR.puts 'Tests failed!'
exit 1
end
end

task :integration do
begin
all_specs = 'spec/integration_spec.rb'
sh "bundle exec rspec #{all_specs}"
rescue RuntimeError
STDERR.puts 'Tests failed!'
Expand All @@ -21,6 +31,9 @@ task :all do
if tasks.include?('TEST')
title 'Running tests'
Rake::Task['spec'].invoke

title 'Running integration tests'
Rake::Task['integration'].invoke
end

if tasks.include?('LINT')
Expand All @@ -34,10 +47,10 @@ task default: :all
# Helpers
#-----------------------------------------------------------------------------#

def specs(*dirs)
def specs(*dirs, except_specs: [])
dirs = dirs.flatten if dirs.first.kind_of?(Array)
dirs.map do |dir|
FileList["#{dir}/spec/**/*_spec.rb"].shuffle
FileList["#{dir}/spec/**/*_spec.rb"].shuffle - except_specs
end.flatten.join(' ')
end

Expand Down
4 changes: 4 additions & 0 deletions lib/xcake/dsl/target.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ def system_frameworks
@system_frameworks ||= default_system_frameworks_for(platform)
end

def info_plist_paths
all_configurations.map { |config| config.settings['INFOPLIST_FILE'] }.uniq
end

# @!group Conversion

def to_s
Expand Down
1 change: 1 addition & 0 deletions lib/xcake/generator/target_file_reference_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def include_file_for_path_and_target(path, target)
build_phase_symbol = PathClassifier.classification_for_path(path)

return unless PathClassifier.should_create_build_phase_for_classification?(build_phase_symbol)
return if target.info_plist_paths.include?(path)

build_phase_class = Xcodeproj::Project::Object.const_get(build_phase_symbol)
build_phase = native_target.build_phase_by_class(build_phase_class)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

int main(int argc, char * argv[]) {
@autoreleasepool {
return 0;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
application_for :ios, 9.0 do |application|
application.name = 'BananaApp'
end
Loading