xcode_assets_gen 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/README.md +41 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/xcode_assets_gen +5 -0
- data/lib/agvtool.rb +5 -0
- data/lib/xcode_assets_gen.rb +58 -0
- data/lib/xcode_assets_gen/icon_gen.rb +77 -0
- data/lib/xcode_assets_gen/icons_size.yml +138 -0
- data/lib/xcode_assets_gen/launch_image_gen.rb +77 -0
- data/lib/xcode_assets_gen/launch_image_size.yml +69 -0
- data/lib/xcode_assets_gen/top_contents_json_gen.rb +18 -0
- data/lib/xcode_assets_gen/version.rb +3 -0
- metadata +142 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 974fa3208eb8feb8945885dcd18fa33764e7f1d4
|
4
|
+
data.tar.gz: 9cf38a4ce05eb1b33f3abfb4f287a12cab3a1aec
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d196a4ceee2d9decff724a2afe2022f5d941e993f11242a82895ad29e4b28dd9489a8e8cedb40628e3f7d9090c02d6da2019e85d285a627063223fa6013e246f
|
7
|
+
data.tar.gz: 8fdb1da5742d2c4d7785f68e1f375cca61d84fc6332193a7be8e813e104f3ad2045b581a5c06029ede18f3675aa2fbcad9ceb1a60bcd1252d446857b11720b81
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at whlsxl@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# XcodeAssetsGen
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/xcode_assets_gen`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'xcode_assets_gen'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install xcode_assets_gen
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/xcode_assets_gen. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "xcode_assets_gen"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'xcode_assets_gen/version'
|
2
|
+
require 'xcode_assets_gen/icon_gen'
|
3
|
+
require 'xcode_assets_gen/launch_image_gen'
|
4
|
+
require 'xcode_assets_gen/top_contents_json_gen'
|
5
|
+
|
6
|
+
require 'fileutils'
|
7
|
+
require 'slop'
|
8
|
+
|
9
|
+
module XcodeAssetsGen
|
10
|
+
class CLI
|
11
|
+
# set up defaults in its own method
|
12
|
+
def cli_flags
|
13
|
+
options = Slop::Options.new
|
14
|
+
pwd = Dir.pwd
|
15
|
+
options.banner = "usage: tubes [options] ..."
|
16
|
+
options.string "-i", "--icon", "Set icon path, default is ./icon.png", default: File.join(pwd, "icon.png")
|
17
|
+
options.string "-l", "--launch_image_path", "Set launch image path, default is current path", default: pwd
|
18
|
+
options.string "-o", "--output", "Set output file path, default is ./Assets.xcassets", default: File.join(pwd, "Assets.xcassets")
|
19
|
+
options.string "-s", "--icon_set_list", "Set icon set list, default: ['ipad-ios7+', 'iphone-ios7+']", default: ['ipad-ios7+', 'iphone-ios7+']
|
20
|
+
options
|
21
|
+
end
|
22
|
+
|
23
|
+
def parse_arguments(command_line_options, parser)
|
24
|
+
begin
|
25
|
+
# slop has the advantage over optparse that it can do strings and not just ARGV
|
26
|
+
result = parser.parse command_line_options
|
27
|
+
result.to_hash
|
28
|
+
|
29
|
+
# Very important to not bury this begin/rescue logic in another method
|
30
|
+
# otherwise it will be difficult to check to see if -h or --help was passed
|
31
|
+
# in this case -h acts as an unknown option as long as we don't define it
|
32
|
+
# in cli_flags.
|
33
|
+
rescue Slop::UnknownOption
|
34
|
+
# print help
|
35
|
+
puts cli_flags
|
36
|
+
exit
|
37
|
+
# If, for your program, you can't exit here, then reraise Slop::UnknownOption
|
38
|
+
# raise a custom exception, push the rescue up to main or track that "help was invoked"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def main(command_line_options="")
|
43
|
+
parser = Slop::Parser.new cli_flags
|
44
|
+
arguments = parse_arguments(command_line_options, parser)
|
45
|
+
|
46
|
+
# --ip is a boolean, it is set to false even if left off by slop
|
47
|
+
icon_path = arguments.fetch(:icon)
|
48
|
+
launch_image_path = arguments.fetch(:launch_image_path)
|
49
|
+
output = arguments.fetch(:output)
|
50
|
+
icon_set_list = arguments.fetch(:icon_set_list)
|
51
|
+
|
52
|
+
XcodeAssetsGen::IconGen.new.gen_icons(icon_set_list, output, icon_path)
|
53
|
+
XcodeAssetsGen::LaunchImageGen.new.gen_launch_images(output, launch_image_path)
|
54
|
+
XcodeAssetsGen.gen_top_contents_json(output)
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# require "xcode_assets_gen/version"
|
2
|
+
require "mini_magick"
|
3
|
+
require 'yaml'
|
4
|
+
require 'json'
|
5
|
+
require 'fileutils'
|
6
|
+
|
7
|
+
module XcodeAssetsGen
|
8
|
+
class IconGen
|
9
|
+
|
10
|
+
attr_accessor :icon_set_list, :assets_path, :o_icon_path
|
11
|
+
|
12
|
+
def load_config
|
13
|
+
return YAML.load_file(File.expand_path('../icons_size.yml', __FILE__))
|
14
|
+
end
|
15
|
+
|
16
|
+
def get_config_by_name config, name
|
17
|
+
config.detect { |config| config["name"] == name }
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
# icon_set_list is a list of icon set to generate, example: ['ipad-ios7+', 'iphone-ios7+']
|
22
|
+
def gen_icons icon_set_list, assets_path, icon_path
|
23
|
+
config = load_config
|
24
|
+
icon_save_path = File.join(assets_path, 'AppIcon.appiconset')
|
25
|
+
FileUtils::mkdir_p icon_save_path
|
26
|
+
puts Rainbow("Start generate icons").bright
|
27
|
+
|
28
|
+
images = []
|
29
|
+
icon_set_list.each { |icon_set|
|
30
|
+
puts Rainbow("Icon set #{icon_set}").cyan
|
31
|
+
sets = get_config_by_name(config, icon_set)
|
32
|
+
if sets != nil
|
33
|
+
images += gen_icon_set(sets, icon_save_path, icon_path)
|
34
|
+
else
|
35
|
+
puts Rainbow("Error: No #{icon_set}").red
|
36
|
+
end
|
37
|
+
}
|
38
|
+
content = {
|
39
|
+
"images": images,
|
40
|
+
"info": {
|
41
|
+
"version": 1,
|
42
|
+
"author": "xcode"
|
43
|
+
}
|
44
|
+
}
|
45
|
+
File.open(File.join(icon_save_path, "Contents.json"), "w") do |f|
|
46
|
+
f.write(content.to_json)
|
47
|
+
end
|
48
|
+
puts Rainbow("Finish generate icons").green
|
49
|
+
end
|
50
|
+
|
51
|
+
def get_icon_size icon
|
52
|
+
size = icon["size"].split('x').first.to_f
|
53
|
+
scale = icon["scale"].split('x').first.to_f
|
54
|
+
(size * scale).to_i
|
55
|
+
end
|
56
|
+
|
57
|
+
def gen_icon_set icon_set, icon_save_path, icon_path
|
58
|
+
images = []
|
59
|
+
icon_set["icons"].each { |icon|
|
60
|
+
image = MiniMagick::Image.open(icon_path)
|
61
|
+
size = get_icon_size icon
|
62
|
+
image.resize "#{size}x#{size}"
|
63
|
+
image.format "png"
|
64
|
+
icon_filename = "icon#{size}x#{size}.png"
|
65
|
+
image.write File.join(icon_save_path, icon_filename)
|
66
|
+
puts Rainbow("Generate #{icon_filename}").green
|
67
|
+
icon['idiom'] = icon_set["idiom"]
|
68
|
+
icon['filename'] = "icon#{size}x#{size}.png"
|
69
|
+
images.push(icon)
|
70
|
+
}
|
71
|
+
# return content file json
|
72
|
+
return images
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,138 @@
|
|
1
|
+
---
|
2
|
+
- name: ipad-ios7+
|
3
|
+
desc: iPad iOS 7.0 and Later
|
4
|
+
idiom: ipad
|
5
|
+
icons:
|
6
|
+
- size: 29x29
|
7
|
+
scale: 1x
|
8
|
+
- size: 29x29
|
9
|
+
scale: 2x
|
10
|
+
- size: 40x40
|
11
|
+
scale: 1x
|
12
|
+
- size: 40x40
|
13
|
+
scale: 2x
|
14
|
+
- size: 76x76
|
15
|
+
scale: 1x
|
16
|
+
- size: 76x76
|
17
|
+
scale: 2x
|
18
|
+
- size: 83.5x83.5
|
19
|
+
scale: 2x
|
20
|
+
- name: ipad-ios6.1-
|
21
|
+
desc: iPad iOS 6.1 and Prior
|
22
|
+
idiom: ipad
|
23
|
+
icons:
|
24
|
+
- size: 29x29
|
25
|
+
scale: 1x
|
26
|
+
- size: 29x29
|
27
|
+
scale: 2x
|
28
|
+
- size: 50x50
|
29
|
+
scale: 1x
|
30
|
+
- size: 50x50
|
31
|
+
scale: 2x
|
32
|
+
- size: 72x72
|
33
|
+
scale: 1x
|
34
|
+
- size: 72x72
|
35
|
+
scale: 2x
|
36
|
+
|
37
|
+
- name: iphone-ios7+
|
38
|
+
desc: iPhone iOS 7.0 and Later
|
39
|
+
idiom: iphone
|
40
|
+
icons:
|
41
|
+
- size: 29x29
|
42
|
+
scale: 2x
|
43
|
+
- size: 29x29
|
44
|
+
scale: 3x
|
45
|
+
- size: 40x40
|
46
|
+
scale: 2x
|
47
|
+
- size: 40x40
|
48
|
+
scale: 3x
|
49
|
+
- size: 60x60
|
50
|
+
scale: 2x
|
51
|
+
- size: 60x60
|
52
|
+
scale: 3x
|
53
|
+
- name: iphone-ios6.1-
|
54
|
+
desc: iPhone iOS 6.1 and Prior
|
55
|
+
idiom: iphone
|
56
|
+
icons:
|
57
|
+
- size: 29x29
|
58
|
+
scale: 1x
|
59
|
+
- size: 29x29
|
60
|
+
scale: 2x
|
61
|
+
- size: 57x57
|
62
|
+
scale: 1x
|
63
|
+
- size: 57x57
|
64
|
+
scale: 2x
|
65
|
+
|
66
|
+
- name: mac
|
67
|
+
desc: MAC ALL
|
68
|
+
idiom: mac
|
69
|
+
icons:
|
70
|
+
- size: 16x16
|
71
|
+
scale: 1x
|
72
|
+
- size: 16x16
|
73
|
+
scale: 2x
|
74
|
+
- size: 32x32
|
75
|
+
scale: 1x
|
76
|
+
- size: 32x32
|
77
|
+
scale: 2x
|
78
|
+
- size: 128x128
|
79
|
+
scale: 1x
|
80
|
+
- size: 128x128
|
81
|
+
scale: 2x
|
82
|
+
- size: 256x256
|
83
|
+
scale: 1x
|
84
|
+
- size: 256x256
|
85
|
+
scale: 2x
|
86
|
+
- size: 512x512
|
87
|
+
scale: 1x
|
88
|
+
- size: 512x512
|
89
|
+
scale: 2x
|
90
|
+
|
91
|
+
- name: car
|
92
|
+
desc: Car ALL
|
93
|
+
idiom: car
|
94
|
+
icons:
|
95
|
+
- size: 60x60
|
96
|
+
scale: 1x
|
97
|
+
- size: 60x60
|
98
|
+
scale: 2x
|
99
|
+
|
100
|
+
- name: watchall
|
101
|
+
desc: watchOS ALL versions
|
102
|
+
idiom: watch
|
103
|
+
icons:
|
104
|
+
- size: 24x24
|
105
|
+
scale: 2x
|
106
|
+
role: notificationCenter
|
107
|
+
subtype: 38mm
|
108
|
+
- size: 27.5x27.5
|
109
|
+
scale: 2x
|
110
|
+
role: notificationCenter
|
111
|
+
subtype: 42mm
|
112
|
+
- size: 29x29
|
113
|
+
scale: 2x
|
114
|
+
role: companionSettings
|
115
|
+
- size: 29x29
|
116
|
+
scale: 3x
|
117
|
+
role: companionSettings
|
118
|
+
- size: 40x40
|
119
|
+
scale: 2x
|
120
|
+
role: appLauncher
|
121
|
+
subtype: 38mm
|
122
|
+
- size: 86x86
|
123
|
+
scale: 2x
|
124
|
+
role: quickLook
|
125
|
+
subtype: 38mm
|
126
|
+
- size: 98x98
|
127
|
+
scale: 2x
|
128
|
+
role: quickLook
|
129
|
+
subtype: 42mm
|
130
|
+
|
131
|
+
- name: watch1
|
132
|
+
desc: watchOS 1.0 Specific
|
133
|
+
idiom: watch
|
134
|
+
icons:
|
135
|
+
- size: 44x44
|
136
|
+
scale: 2x
|
137
|
+
role: longLook
|
138
|
+
subtype: 42mm
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require "mini_magick"
|
2
|
+
require 'yaml'
|
3
|
+
require 'json'
|
4
|
+
require 'fileutils'
|
5
|
+
require 'rainbow'
|
6
|
+
|
7
|
+
module XcodeAssetsGen
|
8
|
+
class LaunchImageGen
|
9
|
+
|
10
|
+
def load_config
|
11
|
+
return YAML.load_file(File.expand_path('../launch_image_size.yml', __FILE__))
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_launch_items config, size
|
15
|
+
config.flatten(1).select { |item| item["size"] == size }
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_launch_items_with_set config, size, filename
|
19
|
+
datas = []
|
20
|
+
config.each do |items|
|
21
|
+
for item in items
|
22
|
+
if item["size"] == size
|
23
|
+
datas += items.each { |item| item["data"]["filename"] = filename if item["size"] == size}
|
24
|
+
break
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
datas
|
29
|
+
end
|
30
|
+
|
31
|
+
def set_launch_to_array datas, config, size, filename
|
32
|
+
if (datas.select { |item| item["size"] == size }).count != 0
|
33
|
+
datas.each { |item| item["data"]["filename"] = filename if item["size"] == size }
|
34
|
+
else
|
35
|
+
datas += get_launch_items_with_set(config, size, filename)
|
36
|
+
end
|
37
|
+
datas
|
38
|
+
end
|
39
|
+
|
40
|
+
def gen_launch_images assets_path, launch_image_path
|
41
|
+
puts Rainbow("Start generate launch images").bright
|
42
|
+
config = load_config
|
43
|
+
datas = []
|
44
|
+
asset_launch_path = "LaunchImage.launchimage"
|
45
|
+
launch_image_asset_path = File.join(assets_path, asset_launch_path)
|
46
|
+
FileUtils::mkdir_p launch_image_asset_path
|
47
|
+
Dir.glob(File.join(launch_image_path, "*.png")) do |file|
|
48
|
+
image = MiniMagick::Image.open(file)
|
49
|
+
size = "#{image.width}x#{image.height}"
|
50
|
+
filename = "launch_image#{size}.png"
|
51
|
+
|
52
|
+
if get_launch_items(config, size).count != 0
|
53
|
+
FileUtils.cp(file, File.join(launch_image_asset_path, filename))
|
54
|
+
datas = set_launch_to_array(datas, config, size, filename)
|
55
|
+
puts Rainbow("Find #{File.basename(file)} size is #{size} CP TO #{asset_launch_path}/#{filename}").green
|
56
|
+
else
|
57
|
+
puts Rainbow("Find #{File.basename(file)} size is #{size} not a launch image").yellow
|
58
|
+
end
|
59
|
+
end
|
60
|
+
content = {
|
61
|
+
"images": datas.map { |item| item["data"] },
|
62
|
+
"info": {
|
63
|
+
"version": 1,
|
64
|
+
"author": "xcode"
|
65
|
+
}
|
66
|
+
}
|
67
|
+
File.open(File.join(launch_image_asset_path, "Contents.json"), "w") do |f|
|
68
|
+
f.write(content.to_json)
|
69
|
+
end
|
70
|
+
puts Rainbow("Finish generate LaunchImages").green
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# launch_gen = XcodeAssetsGen::LaunchImageGen.new
|
77
|
+
# launch_gen.gen_launch_images("/Users/whl/Documents/Assets.xcassets/", "/Users/whl/Documents/ip_pro/rGuideMetro/rGuideMetro/Localized/whmtr")
|
@@ -0,0 +1,69 @@
|
|
1
|
+
---
|
2
|
+
- - data:
|
3
|
+
orientation: portrait
|
4
|
+
idiom: iphone
|
5
|
+
extent: full-screen
|
6
|
+
minimum-system-version: "8.0"
|
7
|
+
subtype: 736h
|
8
|
+
scale: 3x
|
9
|
+
size: 1242x2208
|
10
|
+
- data:
|
11
|
+
orientation: portrait
|
12
|
+
idiom: iphone
|
13
|
+
extent: full-screen
|
14
|
+
minimum-system-version: "8.0"
|
15
|
+
subtype: 667h
|
16
|
+
scale: 2x
|
17
|
+
size: 750x1334
|
18
|
+
- - data:
|
19
|
+
orientation: landscape
|
20
|
+
idiom: iphone
|
21
|
+
extent: full-screen
|
22
|
+
minimum-system-version: "8.0"
|
23
|
+
subtype: 736h
|
24
|
+
scale: 3x
|
25
|
+
size: 2208x1242
|
26
|
+
|
27
|
+
- - data:
|
28
|
+
orientation: portrait
|
29
|
+
idiom: iphone
|
30
|
+
extent: full-screen
|
31
|
+
minimum-system-version: "7.0"
|
32
|
+
scale: 2x
|
33
|
+
size: 640x960
|
34
|
+
- data:
|
35
|
+
orientation: portrait
|
36
|
+
idiom: iphone
|
37
|
+
extent: full-screen
|
38
|
+
minimum-system-version: "7.0"
|
39
|
+
subtype: retina4
|
40
|
+
scale: 2x
|
41
|
+
size: 640x1136
|
42
|
+
- - data:
|
43
|
+
orientation: portrait
|
44
|
+
idiom: ipad
|
45
|
+
extent: full-screen
|
46
|
+
minimum-system-version: "7.0"
|
47
|
+
scale: 1x
|
48
|
+
size: 768x1024
|
49
|
+
- data:
|
50
|
+
orientation: portrait
|
51
|
+
idiom: ipad
|
52
|
+
extent: full-screen
|
53
|
+
minimum-system-version: "7.0"
|
54
|
+
scale: 2x
|
55
|
+
size: 1536x2048
|
56
|
+
- - data:
|
57
|
+
orientation: landscape
|
58
|
+
idiom: ipad
|
59
|
+
extent: full-screen
|
60
|
+
minimum-system-version: "7.0"
|
61
|
+
scale: 1x
|
62
|
+
size: 1024x768
|
63
|
+
- data:
|
64
|
+
orientation: landscape
|
65
|
+
idiom: ipad
|
66
|
+
extent: full-screen
|
67
|
+
minimum-system-version: "7.0"
|
68
|
+
scale: 2x
|
69
|
+
size: 2048x1536
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module XcodeAssetsGen
|
5
|
+
def self.gen_top_contents_json assets_path
|
6
|
+
puts Rainbow("Start generate Top Contents.json").bright
|
7
|
+
content = {
|
8
|
+
"info": {
|
9
|
+
"version": 1,
|
10
|
+
"author": "xcode"
|
11
|
+
}
|
12
|
+
}
|
13
|
+
File.open(File.join(assets_path, "Contents.json"), "w") do |f|
|
14
|
+
f.write(content.to_json)
|
15
|
+
end
|
16
|
+
puts Rainbow("Finish generate Top Contents.json").green
|
17
|
+
end
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xcode_assets_gen
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Wang Hailong
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-09-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mini_magick
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: slop
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 4.2.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 4.2.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rainbow
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.0.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.0.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.12'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.12'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '10.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: minitest
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '5.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '5.0'
|
97
|
+
description: ''
|
98
|
+
email:
|
99
|
+
- whlsxl@gmail.com
|
100
|
+
executables:
|
101
|
+
- xcode_assets_gen
|
102
|
+
extensions: []
|
103
|
+
extra_rdoc_files: []
|
104
|
+
files:
|
105
|
+
- CODE_OF_CONDUCT.md
|
106
|
+
- README.md
|
107
|
+
- bin/console
|
108
|
+
- bin/setup
|
109
|
+
- bin/xcode_assets_gen
|
110
|
+
- lib/agvtool.rb
|
111
|
+
- lib/xcode_assets_gen.rb
|
112
|
+
- lib/xcode_assets_gen/icon_gen.rb
|
113
|
+
- lib/xcode_assets_gen/icons_size.yml
|
114
|
+
- lib/xcode_assets_gen/launch_image_gen.rb
|
115
|
+
- lib/xcode_assets_gen/launch_image_size.yml
|
116
|
+
- lib/xcode_assets_gen/top_contents_json_gen.rb
|
117
|
+
- lib/xcode_assets_gen/version.rb
|
118
|
+
homepage: ''
|
119
|
+
licenses:
|
120
|
+
- MIT
|
121
|
+
metadata: {}
|
122
|
+
post_install_message:
|
123
|
+
rdoc_options: []
|
124
|
+
require_paths:
|
125
|
+
- lib
|
126
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
131
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
requirements: []
|
137
|
+
rubyforge_project:
|
138
|
+
rubygems_version: 2.5.1
|
139
|
+
signing_key:
|
140
|
+
specification_version: 4
|
141
|
+
summary: Generate icons and launch images Assets.xcassets file.
|
142
|
+
test_files: []
|