Skip to content

Commit

Permalink
Merge pull request #50 from Automattic/release/1.0
Browse files Browse the repository at this point in the history
Release/1.0
  • Loading branch information
loremattei committed Mar 23, 2020
2 parents 5d3b797 + 2882a89 commit 7789334
Show file tree
Hide file tree
Showing 414 changed files with 3,930 additions and 15,230 deletions.
24 changes: 19 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
version: 2.1

orbs:
# This uses the iOS Orb located at https://github.com/wordpress-mobile/circleci-orbs
ios: wordpress-mobile/ios@0.0.22
# Using 1.0 of our Orbs means it will use the latest 1.0.x version from https://github.com/wordpress-mobile/circleci-orbs
ios: wordpress-mobile/ios@1.0

workflows:
test_and_validate:
jobs:
- ios/test:
name: Test
xcode-version: "11.2.1"
workspace: Gridicons.xcworkspace
scheme: Gridicons
device: iPhone XS
ios-version: "12.1"
bundle-install: false
device: iPhone 11
ios-version: "13.2.2"
bundle-install: true
pod-install: false
- ios/validate-podspec:
name: Validate Podspec
xcode-version: "11.2.1"
podspec-path: Gridicons.podspec
bundle-install: true
- ios/publish-podspec:
name: Publish to Trunk
xcode-version: "11.2.1"
podspec-path: Gridicons.podspec
bundle-install: true
post-to-slack: true
filters:
tags:
only: /.*/
branches:
ignore: /.*/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ xcuserdata/
## Other
*.moved-aside
*.xcuserstate
Pods/
vendor/

## Obj-C/Swift specific
*.hmap
Expand All @@ -30,4 +32,3 @@ timeline.xctimeline
playground.xcworkspace

# Bundler
vendor/
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.5.5
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source 'https://rubygems.org' do
gem 'cocoapods', '1.5.3'
gem 'rake', '~> 13'
gem 'cocoapods', '~> 1.8.0'
end
53 changes: 31 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,65 +1,73 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
activesupport (4.2.11)
CFPropertyList (3.0.1)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
algoliasearch (1.27.1)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.0.2)
cocoapods (1.5.3)
claide (1.0.3)
cocoapods (1.8.4)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.5.3)
cocoapods-deintegrate (>= 1.0.2, < 2.0)
cocoapods-downloader (>= 1.2.0, < 2.0)
cocoapods-core (= 1.8.4)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.3.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (~> 2.0.1)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.5)
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.1)
xcodeproj (>= 1.5.7, < 2.0)
cocoapods-core (1.5.3)
ruby-macho (~> 1.4)
xcodeproj (>= 1.11.1, < 2.0)
cocoapods-core (1.8.4)
activesupport (>= 4.0.2, < 6)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.2)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.3.1)
cocoapods-trunk (1.4.1)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.1.0)
colored2 (3.1.2)
concurrent-ruby (1.1.4)
concurrent-ruby (1.1.5)
escape (0.0.4)
fourflusher (2.0.1)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
minitest (5.11.3)
json (2.2.0)
minitest (5.12.2)
molinillo (0.6.6)
nanaimo (0.2.6)
nap (1.1.0)
netrc (0.11.0)
ruby-macho (1.3.1)
rake (13.0.1)
ruby-macho (1.4.0)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
xcodeproj (1.8.0)
xcodeproj (1.13.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -70,7 +78,8 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods (= 1.5.3)!
cocoapods (~> 1.8.0)!
rake (~> 13)!

BUNDLED WITH
1.17.2
2.0.2
11 changes: 8 additions & 3 deletions Gridicons.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
Pod::Spec.new do |s|
s.name = "Gridicons"
s.version = "0.19"
s.version = "1.0"
s.summary = "Gridicons is a tiny framework which generates Gridicon images at any resolution."

s.homepage = "http://apps.wordpress.com"
s.license = { :type => "GPLv2" }
s.author = { "Automattic" => "mobile@automattic.com" }
s.social_media_url = "http://twitter.com/WordPressiOS"

s.platform = :ios, "9.0"
s.platform = :ios, "10.0"
s.source = { :git => "https://github.com/Automattic/Gridicons-iOS.git", :tag => s.version.to_s }

s.source_files = "Gridicons/Gridicons/**/*.swift"
s.source_files = "Gridicons/Gridicons/**/*.swift"
s.resource_bundles = {
'Gridicons': [
'Gridicons/Gridicons/*.{xcassets}',
]
}
s.requires_arc = true
end
54 changes: 54 additions & 0 deletions Gridicons.stencil
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen
{% if catalogs %}
{% set enumName %}{{param.enumName|default:"GridiconType"}}{% endset %}

{% macro enumBlock assets sp %}
{{sp}} {% call casesBlock assets sp %}
{% endmacro %}
{% macro casesBlock assets sp %}
{{sp}} {% for asset in assets %}
{{sp}} {% if asset.type == "image" %}
{{sp}} case {{asset.name|swiftIdentifier:"pretty"|lowerFirstWord|replace:"Ios","iOS"|escapeReservedKeywords}}
{{sp}} {% endif %}
{{sp}} {% endfor %}
{% endmacro %}
{% macro assetNamesBlock assets sp %}
{{sp}} {% for asset in assets %}
{{sp}} {% if asset.type == "image" %}
{{sp}} case .{{asset.name|swiftIdentifier:"pretty"|lowerFirstWord|replace:"Ios","iOS"|escapeReservedKeywords}}: return "{{asset.name}}"
{{sp}} {% endif %}
{{sp}} {% endfor %}
{% endmacro %}

@objc
public enum {{enumName}}: Int {
{% call enumBlock catalogs.first.assets " " %}
}

extension {{enumName}} {
var name: String {
switch self {
{% call assetNamesBlock catalogs.first.assets " " %}
}
}

var icon: UIImage {
var bundle = Bundle(for: BundleToken.self)

if let url = bundle.url(forResource: "Gridicons", withExtension: "bundle"),
let assetBundle = Bundle(url: url) {
// When loaded through CocoaPods, assets reside in a separate resource bundle
bundle = assetBundle
}

let image = UIImage(named: name, in: bundle, compatibleWith: nil)
guard let result = image else { fatalError("Unable to load image named \(name).") }
return result
}
}

private final class BundleToken {}

{% else %}
// No assets found
{% endif %}
Loading

0 comments on commit 7789334

Please sign in to comment.