Skip to content

Commit 621b68d

Browse files
maickifrostney
authored andcommitted
Create Podspec in root of library directory and use package.json for Spec details (#56)
1 parent c6798d5 commit 621b68d

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

templates/ios.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
/* eslint max-len: 0 */
22

33
module.exports = platform => [{
4-
name: ({ name }) => `${platform}/${name}.podspec`,
5-
content: ({ name }) => `
4+
name: ({ name }) => `${name}.podspec`,
5+
content: ({ name }) => `require "json"
6+
7+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
8+
69
Pod::Spec.new do |s|
710
s.name = "${name}"
8-
s.version = "1.0.0"
9-
s.summary = "${name}"
11+
s.version = package["version"]
12+
s.summary = package["description"]
1013
s.description = <<-DESC
1114
${name}
1215
DESC
13-
s.homepage = ""
16+
s.homepage = "https://github.com/author/${name}"
1417
s.license = "MIT"
15-
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
16-
s.author = { "author" => "author@domain.cn" }
18+
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
19+
s.author = { "author" => "author@domain.cn" }
1720
s.platform = :ios, "7.0"
18-
s.source = { :git => "https://github.com/author/${name}.git", :tag => "master" }
19-
s.source_files = "${name}/**/*.{h,m}"
20-
s.requires_arc = true
21+
s.source = { :git => "https://github.com/author/${name}.git", :tag => "#{s.version}" }
2122
23+
s.source_files = "ios/**/*.{h,m}"
24+
s.requires_arc = true
2225
2326
s.dependency "React"
2427
#s.dependency "others"
25-
2628
end
2729
2830
`,

0 commit comments

Comments
 (0)