@capacitor/cli
Advanced tools
Comparing version 0.0.87 to 0.0.88
@@ -44,2 +44,3 @@ "use strict"; | ||
await autoGeneratePods(plugins); | ||
await autoGenerateResourcesPods(cordovaPlugins); | ||
await installCocoaPodsPlugins(config, plugins, needsUpdate); | ||
@@ -59,2 +60,13 @@ } | ||
exports.autoGeneratePods = autoGeneratePods; | ||
async function autoGenerateResourcesPods(plugins) { | ||
const resoucesPlugins = plugins.filter(p => getPluginResources(p).length > 0); | ||
return Promise.all(resoucesPlugins | ||
.map(async (p) => { | ||
const name = p.name + 'Resources'; | ||
const content = generateResourcesPodspec(p); | ||
const path = path_1.join(p.rootPath, p.ios.path, name + '.podspec'); | ||
return fs_1.writeFileAsync(path, content); | ||
})); | ||
} | ||
exports.autoGenerateResourcesPods = autoGenerateResourcesPods; | ||
function generatePodspec(plugin) { | ||
@@ -106,2 +118,22 @@ const repo = (plugin.repository && plugin.repository.url) || 'https://github.com/ionic-team/does-not-exist.git'; | ||
exports.generatePodspec = generatePodspec; | ||
function generateResourcesPodspec(plugin) { | ||
const repo = (plugin.repository && plugin.repository.url) || 'https://github.com/ionic-team/does-not-exist.git'; | ||
const resources = getPluginResources(plugin); | ||
let resourceFiles = []; | ||
resources.map((resource) => { | ||
resourceFiles.push(resource.$.src.replace('src/ios/', '')); | ||
}); | ||
return ` | ||
Pod::Spec.new do |s| | ||
s.name = '${plugin.name}Resources' | ||
s.version = '${plugin.version}' | ||
s.summary = 'Autogenerated spec' | ||
s.license = 'Unknown' | ||
s.homepage = 'https://example.com' | ||
s.authors = { 'Capacitor Generator' => 'hi@example.com' } | ||
s.source = { :git => '${repo}', :tag => '${plugin.version}' } | ||
s.resources = ['${resourceFiles.join("', '")}'] | ||
end`; | ||
} | ||
exports.generateResourcesPodspec = generateResourcesPodspec; | ||
async function installCocoaPodsPlugins(config, plugins, needsUpdate) { | ||
@@ -138,2 +170,5 @@ await common_2.runTask('Updating iOS native dependencies', () => { | ||
}); | ||
if (getPluginResources(p).length > 0) { | ||
pods.push(`pod '${p.ios.name}Resources', :path => '../../node_modules/${p.id}/${p.ios.path}'`); | ||
} | ||
}); | ||
@@ -165,4 +200,14 @@ return ` | ||
} | ||
function getPluginResources(p) { | ||
const iosPlatform = update_1.getPluginPlatform(p, platform); | ||
if (iosPlatform) { | ||
const resourceFiles = iosPlatform['resource-file']; | ||
if (resourceFiles) { | ||
return resourceFiles; | ||
} | ||
} | ||
return []; | ||
} | ||
function getFrameworkName(framework) { | ||
return framework.$.src.substr(0, framework.$.src.indexOf('.')); | ||
} |
{ | ||
"name": "@capacitor/cli", | ||
"version": "0.0.87", | ||
"version": "0.0.88", | ||
"description": "Capacitor: Cross-platform apps with JavaScript and the web", | ||
@@ -5,0 +5,0 @@ "homepage": "https://capacitor.ionicframework.com/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1455682
2425