lib/swordfish/helpers/framework_builder.rb in cocoapods-swordfish-0.1.7 vs lib/swordfish/helpers/framework_builder.rb in cocoapods-swordfish-1.0.0
- old
+ new
@@ -145,11 +145,11 @@
# `lipo -create -output #{output} #{lipo_libraries.join(' ')}`
# end
end
def ios_build_options
- "ARCHS=\'#{ios_architectures.join(' ')}\' "
+ "ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
end
def ios_architectures
# >armv7
# iPhone4
@@ -161,12 +161,12 @@
# iPhone5S(以上)
# >i386
# iphone5,iphone5s以下的模拟器
# >x86_64
# iphone6以上的模拟器
- # archs = %w[x86_64 arm64 armv7s i386]
archs = %w[arm64 armv7]
+ # archs = %w[x86_64 arm64 armv7s i386]
# @vendored_libraries.each do |library|
# archs = `lipo -info #{library}`.split & archs
# end
archs
end
@@ -186,11 +186,11 @@
options = ios_build_options
# if is_debug_model
archs = ios_architectures
# archs = %w[arm64 armv7 armv7s]
archs.map do |arch|
- xcodebuild(defines, "ARCHS=\'#{arch}\' ","build-#{arch}",@build_model)
+ xcodebuild(defines, "ARCHS=\'#{arch}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'","build-#{arch}",@build_model)
end
# else
# xcodebuild(defines,options)
# end
@@ -210,19 +210,19 @@
@spec.name
end
end
def xcodebuild(defines = '', args = '', build_dir = 'build', build_model = 'Debug')
+
unless File.exist?("Pods.xcodeproj") #cocoapods-generate v2.0.0
command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{File.join(File.expand_path("..", build_dir), File.basename(build_dir))} clean build -configuration #{build_model} SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES -target #{target_name} -project ./Pods/Pods.xcodeproj 2>&1"
else
command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{build_model} -target #{target_name} -project ./Pods.xcodeproj 2>&1"
end
UI.message "command = #{command}"
- output_str = `#{command}`
- output = output_str.lines.to_a
+ output = `#{command}`.lines.to_a
if $CHILD_STATUS.exitstatus != 0
raise <<~EOF
Build command failed: #{command}
Output:
@@ -366,10 +366,10 @@
`cp "#{license_file}" .` if Pathname(license_file).exist?
end
def copy_resources
resource_dir = './build/*.bundle'
- # resource_dir = './build-armv7/*.bundle' if File.exist?('./build-armv7')
+ resource_dir = './build-armv7/*.bundle' if File.exist?('./build-armv7')
resource_dir = './build-arm64/*.bundle' if File.exist?('./build-arm64')
bundles = Dir.glob(resource_dir)
bundle_names = [@spec, *@spec.recursive_subspecs].flat_map do |spec|