Skip to content

Commit

Permalink
chore(cli): read plugin podspec values from package.json (#3092)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Jun 12, 2020
1 parent c5878a8 commit 2e61a9a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions cli/src/tasks/new-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,22 @@ async function createIosPlugin(config: Config, pluginPath: string, domain: strin

function generatePodspec(config: Config, answers: NewPluginAnswers) {
return `
require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = '${fixName(answers.name)}'
s.version = '0.0.1'
s.summary = '${answers.description}'
s.license = '${answers.license}'
s.homepage = '${answers.git}'
s.author = '${answers.author}'
s.source = { :git => '${answers.git}', :tag => s.version.to_s }
s.version = package['version']
s.summary = package['description']
s.license = package['license']
s.homepage = package['repository']['url']
s.author = package['author']
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '${config.ios.minVersion}'
s.dependency 'Capacitor'
s.swift_version = '5.0'
end`;
}

Expand Down

0 comments on commit 2e61a9a

Please sign in to comment.