lib/cocoapods-flutter/native/archive/archive.rb in cocoapods-flutter-dt-0.2.3 vs lib/cocoapods-flutter/native/archive/archive.rb in cocoapods-flutter-dt-0.2.4
- old
+ new
@@ -60,10 +60,12 @@
end
build_framework
@plugins = fetch_plugins
if @build_modes.include?('debug')
+ # Debug瘦身
+ thin_arm64 "#{@product_dir}Debug/App.framework/App"
debug
end
if @build_modes.include?('release')
release
@@ -105,10 +107,26 @@
plugins
end
private
+ def thin_arm64(path)
+ # thin arm64
+ thin_commands = [
+ 'lipo',
+ path,
+ '-thin',
+ "arm64",
+ '-output',
+ path,
+ ]
+
+ if CommandRunner.run(*thin_commands) == false
+ raise "Error running #{commands.join ' '} "
+ end
+ end
+
def release
app_file, sdk_file = zip_files @plugins, 'Release'
upload_files app_file, sdk_file, 'Release'
make_pod 'Release'
end
@@ -220,9 +238,10 @@
if CommandRunner.run(*commands) == false
# FileUtils.remove_dir product_dir, true
raise "Error running #{commands.join ' '} "
end
+
end
def build_app(mode)
if CommandRunner.run(@flutter_wrapper, 'build','ios',"--#{mode}" ,"--no-codesign") == false
# FileUtils.remove_dir product_dir, true