lib/cocoapods-packager/builder.rb in ty-cocoapods-packager-1.5.3 vs lib/cocoapods-packager/builder.rb in ty-cocoapods-packager-1.5.4
- old
+ new
@@ -74,20 +74,24 @@
end
clean_directory_for_dynamic_build
if platform.name == :ios
build_dynamic_framework_for_ios(platform, defines, output)
+ elsif platform.name == :watchos
+ raise 'not supported yet'
else
build_dynamic_framework_for_mac(platform, defines, output)
end
end
def build_library(platform, defines, output)
static_libs = static_libs_in_sandbox
if platform.name == :ios
build_static_lib_for_ios(static_libs, defines, output)
+ elsif platform.name == :watchos
+ build_static_lib_for_watchos(static_libs, defines, output)
else
build_static_lib_for_mac(static_libs, output)
end
end
@@ -127,10 +131,12 @@
end
def build_sim_libraries(platform, defines)
if platform.name == :ios
xcodebuild(defines, '-sdk iphonesimulator', 'build-sim')
+ elsif platform.name == :watchos
+ xcodebuild(defines, '-sdk watchsimulator', 'build-sim')
end
end
def build_static_lib_for_ios(static_libs, _defines, output)
return if static_libs.count == 0
@@ -140,10 +146,14 @@
`libtool -static -o #{@static_sandbox_root}/build-sim/package.a #{sim_libs.join(' ')}`
`lipo #{@static_sandbox_root}/build/package.a #{@static_sandbox_root}/build-sim/package.a -create -output #{output}`
end
+ def build_static_lib_for_watchos(static_libs, _defines, output)
+ build_static_lib_for_ios(static_libs, _defines, output)
+ end
+
def build_static_lib_for_mac(static_libs, output)
return if static_libs.count == 0
`libtool -static -o #{output} #{static_libs.join(' ')}`
end
@@ -295,10 +305,10 @@
def ios_build_options
"ARCHS=\'x86_64 i386 arm64 armv7 armv7s\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
end
def watchos_build_options
- "ARCHS=\'i386 arm64_32 armv7k\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
+ "ARCHS=\'i386 armv7k\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
end
def xcodebuild(defines = '', args = '', build_dir = 'build', target = 'Pods-packager', project_root = @static_sandbox_root, config = @config)
if defined?(Pod::DONT_CODESIGN)
args = "#{args} CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=NO"