chore: Support CI build universal macOS package (#3124)

* fix: macos release build

* feat: support build arm64 macOS package on CI

* feat: support build arm64 macOS package on CI
This commit is contained in:
Lucas.Xu
2023-08-06 15:06:43 +07:00
committed by GitHub
parent 63a12a1d2b
commit f724185f1c
5 changed files with 135 additions and 15 deletions

View File

@ -27,18 +27,31 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
flutter_macos_podfile_setup
def build_specify_archs_only
# if ENV.has_key?('BUILD_ARCHS')
# xcodeproj_path = File.dirname(__FILE__) + '/Runner.xcodeproj'
# project = Xcodeproj::Project.open(xcodeproj_path)
# project.targets.each do |target|
# if target.name == 'Runner'
# target.build_configurations.each do |config|
# config.build_settings['ARCHS'] = ENV['BUILD_ARCHS']
# end
# end
# end
# project.save()
# end
if ENV.has_key?('BUILD_ACTIVE_ARCHS_ONLY')
xcodeproj_path = File.dirname(__FILE__) + '/Runner.xcodeproj'
project = Xcodeproj::Project.open(xcodeproj_path)
project.targets.each do |target|
if target.name == 'Runner'
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = ENV['BUILD_ACTIVE_ARCHS_ONLY']
end
end
end
project.save()
end
if ENV.has_key?('BUILD_ARCHS')
xcodeproj_path = File.dirname(__FILE__) + '/Runner.xcodeproj'
project = Xcodeproj::Project.open(xcodeproj_path)
project.targets.each do |target|
if target.name == 'Runner'
target.build_configurations.each do |config|
config.build_settings['ARCHS'] = ENV['BUILD_ARCHS']
end
end
end
project.save()
end
end
build_specify_archs_only()