Module: QCloudHive::HivePod
- Defined in:
- lib/qcloudhive/pod_helper.rb
Constant Summary collapse
- @@podspecs =
nil
Class Method Summary collapse
- .configPostInstaller(installer) ⇒ Object
- .findPodspecs(path) ⇒ Object
- .installDependencies(target, podfilePath) ⇒ Object
- .podspecs ⇒ Object
- .search(name) ⇒ Object
- .sources ⇒ Object
Class Method Details
.configPostInstaller(installer) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/qcloudhive/pod_helper.rb', line 16 def HivePod.configPostInstaller(installer) installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = Config.bitcodeEnable ? "YES" : "NO" end end end |
.findPodspecs(path) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/qcloudhive/pod_helper.rb', line 34 def HivePod.findPodspecs(path) podspecs = [] path = Pathname(path) path.entries.each { |entry| if (entry.extname == '.podspec' || entry.to_s.end_with?('.podspec.json')) if path.basename.to_path == "Local Podspecs" next end podspecs.push(path.join(entry)) end } if podspecs.count != 0 return podspecs else path.entries.each { |entry| next if entry.to_path == "." next if entry.to_path == ".." next if entry.to_path == ".git" next if entry.to_path == ".repo" if File.directory?(path.join(entry)) subpath = path.join(entry) ps = findPodspecs(subpath) podspecs = podspecs + ps end } end return podspecs end |
.installDependencies(target, podfilePath) ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/qcloudhive/pod_helper.rb', line 83 def HivePod.installDependencies(target, podfilePath) Config.setup() Config.loadShareConfig L.info("target is nil #{target}") if target.nil? or target == "nil" return end Config.setup xcodeProject = QCloudHive.xcodeprojectByPath(Pathname.new(podfilePath).parent.to_s) if xcodeProject.nil? ERROR "该Podfile文件没有对应的Xcode工程 #{podfilePath}" end if xcodeProject.hiveSpecModules.nil? puts "nil!!!" end xcodeProject.hiveSpecModules.each { |spec| # local spec if not spec.path.nil? relativePath = Pathname.new(spec.path).dirname.relative_path_from(Pathname.new(podfilePath).parent) target.store_pod(spec.name,:path=>relativePath.to_s) elsif Config.buildFromCommit && (not spec.commit.nil?) target.store_pod(spec.name,:git=>spec.sourceURL, :commit=>spec.commit) else target.store_pod(spec.name,:git=>spec.sourceURL, :branch=>spec.branch) end } xcodeProject.saveHiveModulesConfig L.info("Config #{Config}") L.info("Config use frameworks #{Config.useFrameworks}") if Config.useFrameworks target.use_frameworks! L.info("Target use frameworks") end L.info "save projects" end |
.podspecs ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/qcloudhive/pod_helper.rb', line 62 def HivePod.podspecs if @@podspecs.nil? podspecs = findPodspecs(Config.projectRootDirectory) if not podspecs.nil? @@podspecs = podspecs.map { |specPath| name = nil basenamestr = specPath.basename.to_s extenname = specPath.extname if extenname == ".json" extenname = ".podspec.json" end if extenname.length>0 && basenamestr.end_with?(extenname) name = basenamestr[0,basenamestr.length - extenname.length] end HiveSpec.new(name, specPath) } end end return @@podspecs end |
.search(name) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/qcloudhive/pod_helper.rb', line 24 def HivePod.search(name) sources.each { |source| podspec = source.search(name) if podspec != nil return podspec end } return nil end |
.sources ⇒ Object
12 13 14 |
# File 'lib/qcloudhive/pod_helper.rb', line 12 def HivePod.sources() Pod::Config::instance.sources_manager.aggregate.sources end |