出于CI的目的,我需要向通过脚本从Unity导出的Xcode项目添加“ Sticker Pack Extension”。
通过以下脚本成功添加了 Sticker Pack扩展目标:
def add_stickers_extension(proj_dir_path="", proj_file_name="")
proj_path = File::join(proj_dir_path, proj_file_name)
project = Xcodeproj::Project.open(proj_path)
puts "Project: #{project.path}"
group = project.main_group.find_subpath('Stickers', true)
group.new_reference("Stickers/Info.plist")
assets = group.new_reference("Stickers/Stickers.xcassets")
target = project.new_target(:sticker_pack, 'Stickers', :ios, "10.0")
target.add_file_references([assets])
target.build_configuration_list.set_setting('INFOPLIST_FILE', "Stickers/Info.plist")
plist_path = File::join(proj_dir_path, "Stickers", "Info.plist")
# the following two methods call do some customized configuration not relevant with the issue
customize_plist(plist_path)
customize_target(target)
project.save
end
但是,标贴目标未添加到应用目标的嵌入式二进制文件部分。我尝试了几种方法,但都失败了!手动添加贴纸包扩展时,应用目标的“嵌入式二进制文件”部分已正确配置。
谢谢!