|
|
@@ -1,15 +1,23 @@
|
|
|
platform :ios, '12.0'
|
|
|
use_frameworks!
|
|
|
|
|
|
-# Creator generates the Xcode project outside this source directory.
|
|
|
-# COCOS_IOS_PROJECT=/absolute/path/game_2c.xcodeproj pod install
|
|
|
-project_path = ENV['COCOS_IOS_PROJECT']
|
|
|
-abort 'Set COCOS_IOS_PROJECT to the generated .xcodeproj path.' unless project_path && File.directory?(project_path)
|
|
|
+# 1. 获取当前 Podfile 所在目录 (native/engine/ios)
|
|
|
+current_dir = File.dirname(__FILE__)
|
|
|
+
|
|
|
+# 2. 根据 Cocos Creator 默认构建路径计算出的 .xcodeproj 相对路径
|
|
|
+# 提示:如果你的构建工程名不是 game_2c 或发布路径不是 build/ios/proj,请自行修改下方文件名
|
|
|
+rel_xcodeproj_path = File.join(current_dir, '../../../build/ios/proj/game_2c.xcodeproj')
|
|
|
+
|
|
|
+# 3. 转换为绝对路径,如果没有传环境变量,则自动使用计算出来的路径
|
|
|
+project_path = ENV['COCOS_IOS_PROJECT'] || File.expand_path(rel_xcodeproj_path)
|
|
|
+
|
|
|
+abort "未找到 Xcode 工程文件,请检查路径: #{project_path}" unless File.directory?(project_path)
|
|
|
+
|
|
|
project project_path
|
|
|
-workspace File.join(File.dirname(project_path), 'FacebookGame')
|
|
|
+workspace File.join(File.dirname(project_path), 'game_2c')
|
|
|
|
|
|
target ENV.fetch('COCOS_IOS_TARGET', 'game_2c-mobile') do
|
|
|
pod 'FBSDKCoreKit', '18.1.1'
|
|
|
pod 'FBSDKLoginKit', '18.1.1'
|
|
|
pod 'FBSDKShareKit', '18.1.1'
|
|
|
-end
|
|
|
+end
|