Commit 22ec56a1 authored by Thierry's avatar Thierry

update

parent fecf6403
......@@ -20,15 +20,15 @@ PODS:
- AFNetworking/UIKit (2.6.3):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- GMLibrary (0.0.1):
- GMLibrary/Cache (= 0.0.1)
- GMLibrary/Network (= 0.0.1)
- GMLibrary/Cache (0.0.1):
- GMLibrary (0.0.7):
- GMLibrary/Cache (= 0.0.7)
- GMLibrary/Network (= 0.0.7)
- GMLibrary/Cache (0.0.7):
- TMCache (~> 2.1.0)
- GMLibrary/Network (0.0.1):
- GMLibrary/Network (0.0.7):
- AFNetworking (~> 2.6.1)
- GMLibrary/Cache (~> 0.0.1)
- GMPhobos (0.1.8):
- GMLibrary/Cache (~> 0.0.7)
- GMPhobos (0.1.9):
- GMLibrary (~> 0.0.1)
- TMCache (2.1.0)
......@@ -37,12 +37,12 @@ DEPENDENCIES:
EXTERNAL SOURCES:
GMPhobos:
:path: ../
:path: "../"
SPEC CHECKSUMS:
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
GMLibrary: c31039ad32bc93f866d6c3052c20acb8cf9c1568
GMPhobos: f97ba62026b0250bec934dd6536c436096ec1e5f
GMLibrary: fd93736247477cc0381b6648f4b80bee98eb4c31
GMPhobos: 40c9c9a4d56887903e4221ee25487ff15e0b6f1d
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
COCOAPODS: 0.39.0
......@@ -7,7 +7,6 @@
//
#import <Foundation/Foundation.h>
//#import <TMCache.h>
#import "WMDocumentCache.h"
typedef NS_ENUM(NSUInteger, WMCacheMethod) {
......
......@@ -6,7 +6,7 @@
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import "TMCache.h"
#import <TMCache/TMCache.h>
@interface WMDocumentCache : TMCache
......
......@@ -17,8 +17,42 @@ typedef void (^ImageUploadFinishBlock)(NSDictionary * JSON);
@property (nonatomic, copy) ImageUploadFinishBlock imageUploadFinishBlock;
- (instancetype)initWithImage:(UIImage *)image url:(NSString *)url;
/*!
* @author zhaiguojun, 16-04-15
*
* @brief 默认压缩率的上传
*
* @param image
* @param url
*
* @return
*
* @since 0.0.1
*/
- (instancetype)initWithImage:(UIImage *)image url:(NSString *)url;
/*!
* @author zhaiguojun, 16-04-15
*
* @brief 指定压缩率的上传图片
*
* @param image
* @param url
* @param compressionQuality 压缩率
*
* @return
*
* @since 0.0.1
*/
- (instancetype)initWithImage:(UIImage *)image url:(NSString *)url withCompressionQuality:(float)compressionQuality;
/*!
* @author zhaiguojun, 16-04-15
*
* @brief startUpload
*
* @since 0.0.1
*/
- (void)startUpload;
@end
......@@ -29,6 +29,7 @@
@interface WMImageUploadOperation ()
@property (nonatomic, strong) UIImage *image;
@property (nonatomic, strong) NSString *url;
@property (nonatomic, assign) float compressionQuality;
@end
@implementation WMImageUploadOperation
......@@ -39,13 +40,25 @@
{
_image = image;
_url = url;
_compressionQuality = 0.75;
}
return self;
}
- (instancetype)initWithImage:(UIImage *)image url:(NSString *)url withCompressionQuality:(float)compressionQuality
{
if (self = [super init])
{
_image = image;
_url = url;
_compressionQuality = compressionQuality;
}
return self;
}
- (void)main{
NSData *imageData = UIImageJPEGRepresentation(_image, 1);
NSData *imageData = UIImageJPEGRepresentation(_image, _compressionQuality);
__weak __typeof(self)weakSelf = self;
[[WMNetService sharedInstance] sendUploadTaskRequestWithData:imageData fileName:@"file" name:@"file" url:_url mineType:@"image/jpeg" parameters:@{@"type":@"image"} success:^(NSDictionary* jsonData) {
......
......@@ -7,7 +7,7 @@
//
#import <Foundation/Foundation.h>
#import "AFHTTPSessionManager.h"
#import <AFNetworking/AFHTTPSessionManager.h>
@interface WMNetSecurityWorking : AFHTTPSessionManager
......
......@@ -7,7 +7,7 @@
//
#import <Foundation/Foundation.h>
#import "AFHTTPSessionManager.h"
#import <AFNetworking/AFHTTPSessionManager.h>
/**
* @brief 针对AFNetworking的封装
......
{
"name": "GMPhobos",
"version": "0.1.8",
"version": "0.1.9",
"summary": "GM statistic data sdk",
"description": "GM event track sdk.",
"homepage": "http://git.gengmei.cc/gengmeiios/GMPhobos",
......
......@@ -20,15 +20,15 @@ PODS:
- AFNetworking/UIKit (2.6.3):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- GMLibrary (0.0.1):
- GMLibrary/Cache (= 0.0.1)
- GMLibrary/Network (= 0.0.1)
- GMLibrary/Cache (0.0.1):
- GMLibrary (0.0.7):
- GMLibrary/Cache (= 0.0.7)
- GMLibrary/Network (= 0.0.7)
- GMLibrary/Cache (0.0.7):
- TMCache (~> 2.1.0)
- GMLibrary/Network (0.0.1):
- GMLibrary/Network (0.0.7):
- AFNetworking (~> 2.6.1)
- GMLibrary/Cache (~> 0.0.1)
- GMPhobos (0.1.8):
- GMLibrary/Cache (~> 0.0.7)
- GMPhobos (0.1.9):
- GMLibrary (~> 0.0.1)
- TMCache (2.1.0)
......@@ -37,12 +37,12 @@ DEPENDENCIES:
EXTERNAL SOURCES:
GMPhobos:
:path: ../
:path: "../"
SPEC CHECKSUMS:
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
GMLibrary: c31039ad32bc93f866d6c3052c20acb8cf9c1568
GMPhobos: f97ba62026b0250bec934dd6536c436096ec1e5f
GMLibrary: fd93736247477cc0381b6648f4b80bee98eb4c31
GMPhobos: 40c9c9a4d56887903e4221ee25487ff15e0b6f1d
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
COCOAPODS: 0.39.0
......@@ -14,7 +14,7 @@
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = 'primary'
BlueprintIdentifier = 'D153497DAD57BC4298D094B6'
BlueprintIdentifier = 'A78A9594EA24AD1DC8C50659'
BlueprintName = 'GMPhobos'
ReferencedContainer = 'container:Pods.xcodeproj'
BuildableName = 'GMPhobos.framework'>
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.0.1</string>
<string>0.0.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1.8</string>
<string>0.1.9</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -16,7 +16,7 @@
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "1.64.0"
fastlane_version "1.80.0"
default_platform :ios
......@@ -24,30 +24,20 @@ platform :ios do
before_all do
end
desc "Runs all the tests"
lane :test do
scan
end
desc "Release new version"
lane :release do |options|
path = "GMPhobos.podspec"
target_version = options[:version]
raise "The version is missed." if target_version.nil?
ensure_git_branch # 确认 master 分支
#ensure_git_status_clean # 确认没有未提交的文件
#scan # 运行测试
#sync_build_number_to_git # 将 build 号设为 git commit 数
#increment_version_number(version_number: target_version) # 设置版本号
pod_install
pod_lint(verbose: true, allow_warnings: true, sources: ["git@git.gengmei.cc:gengmeiios/GMSpecs.git","https://github.com/CocoaPods/Specs"])
version_bump_podspec(path: "GMPhobos.podspec", version_number: target_version) # 更新 podspec
pod_lib_lint(verbose: true, allow_warnings: true, sources: ["git@git.gengmei.cc:gengmeiios/GMSpecs.git","https://github.com/CocoaPods/Specs"], use_bundle_exec: true)
version_bump_podspec(path: path, version_number: target_version) # 更新 podspec
git_commit_all(message: "Bump version to #{target_version}") # 提交版本号修改
add_git_tag tag: target_version # 设置 tag
push_to_git_remote # 推送到 git 仓库
pod_push(path: "GMPhobos.podspec", repo: "GMSpecs", allow_warnings: true, sources: ["git@git.gengmei.cc:gengmeiios/GMSpecs.git","https://github.com/CocoaPods/Specs"]) # 提交到 CocoaPods
pod_push(path: path, repo: "GMSpecs", allow_warnings: true, sources: ["git@git.gengmei.cc:gengmeiios/GMSpecs.git","https://github.com/CocoaPods/Specs"]) # 提交到 CocoaPods
end
end
......
......@@ -6,11 +6,6 @@ sudo gem install fastlane
```
# Available Actions
## iOS
### ios test
```
fastlane ios test
```
Runs all the tests
### ios release
```
fastlane ios release
......@@ -19,6 +14,6 @@ Release new version
----
This README.md is auto-generated and will be re-generated every time to run [fastlane](https://fastlane.tools).
More information about fastlane can be found on [https://fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [GitHub](https://github.com/fastlane/fastlane).
\ No newline at end of file
This README.md is auto-generated and will be re-generated every time to run [fastlane](https://fastlane.tools).
More information about fastlane can be found on [https://fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [GitHub](https://github.com/fastlane/fastlane/tree/master/fastlane).
\ No newline at end of file
module Fastlane
module Actions
class PodLibLintAction < Action
def self.run(params)
command = []
if File.exist?("Gemfile") && params[:use_bundle_exec]
command << "bundle exec"
end
command << "pod lib lint"
if params[:verbose]
command << "--verbose"
end
if params[:sources]
sources = params[:sources].join(",")
command << "--sources='#{sources}'"
end
if params[:allow_warnings]
command << "--allow-warnings"
end
result = Actions.sh(command.join(' '))
Helper.log.info "Pod lib lint Successfully ⬆️ ".green
return result
end
#####################################################
# @!group Documentation
#####################################################
def self.description
"Pod lib lint"
end
def self.details
"Test the syntax of your Podfile by linting the pod against the files of its directory"
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
description: "Use bundle exec when there is a Gemfile presented",
is_string: false,
default_value: true),
FastlaneCore::ConfigItem.new(key: :verbose,
description: "Allow ouput detail in console",
optional: true,
is_string: false),
FastlaneCore::ConfigItem.new(key: :allow_warnings,
description: "Allow warnings during pod lint",
optional: true,
is_string: false),
FastlaneCore::ConfigItem.new(key: :sources,
description: "The sources of repos you want the pod spec to lint with, separated by commas",
optional: true,
is_string: false,
verify_block: proc do |value|
raise "Sources must be an array.".red unless value.kind_of?(Array)
end)
]
end
def self.output
end
def self.return_value
nil
end
def self.authors
["thierryxing"]
end
def self.is_supported?(platform)
true
end
end
end
end
module Fastlane
module Actions
class PodLintAction < Action
def self.run(params)
command = "pod lib lint"
if params[:verbose]
command << " --verbose"
end
if params[:sources]
sources = params[:sources].join(",")
command << " --sources='#{sources}'"
end
if params[:allow_warnings]
command << " --allow-warnings"
end
result = Actions.sh("#{command}")
Helper.log.info "Successfully pod lint ⬆️ ".green
return result
end
#####################################################
# @!group Documentation
#####################################################
def self.description
"Pod lint"
end
def self.details
""
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :verbose,
description: "Allow ouput detail in console",
optional: true,
is_string: false),
FastlaneCore::ConfigItem.new(key: :allow_warnings,
description: "Allow warnings during pod push",
optional: true,
is_string: false),
FastlaneCore::ConfigItem.new(key: :sources,
description: "The sources of repos you want the pod spec to lint with, separated by commas",
optional: true,
is_string: false,
verify_block: proc do |value|
raise "Sources must be an array.".red unless value.kind_of?(Array)
end)
]
end
def self.output
end
def self.return_value
nil
end
def self.authors
["thierry"]
end
def self.is_supported?(platform)
true
end
end
end
end
\ No newline at end of file
......@@ -3,24 +3,19 @@
<testsuite name="fastlane.lanes">
<testcase classname="fastlane.lanes" name="0: Verifying required fastlane version" time="0.000323">
<testcase classname="fastlane.lanes" name="0: Verifying required fastlane version" time="0.000526">
</testcase>
<testcase classname="fastlane.lanes" name="1: default_platform" time="0.000267">
<testcase classname="fastlane.lanes" name="1: default_platform" time="0.000275">
</testcase>
<testcase classname="fastlane.lanes" name="2: ensure_git_branch" time="0.023142">
<testcase classname="fastlane.lanes" name="2: tag_bump_podspec" time="0.001387">
</testcase>
<testcase classname="fastlane.lanes" name="3: ensure_git_status_clean" time="0.013297">
<failure message="/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/actions/actions_helper.rb:33:in `execute_action'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/runner.rb:129:in `block in execute_action'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/runner.rb:128:in `chdir'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/runner.rb:128:in `execute_action'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/fast_file.rb:149:in `method_missing'&#10;Fastfile:38:in `block (2 levels) in parsing_binding'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/lane.rb:36:in `call'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/lane.rb:36:in `call'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/runner.rb:52:in `block in execute'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/runner.rb:46:in `chdir'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/runner.rb:46:in `execute'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/lane_manager.rb:46:in `cruise_lane'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/lib/fastlane/command_line_handler.rb:30:in `handle'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/bin/fastlane:38:in `block (2 levels) in run'&#10;/Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'&#10;/Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'&#10;/Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'&#10;/Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane_core-0.37.0/lib/fastlane_core/ui/fastlane_runner.rb:23:in `run!'&#10;/Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/bin/fastlane:156:in `run'&#10;/Library/Ruby/Gems/2.0.0/gems/fastlane-1.64.0/bin/fastlane:162:in `&lt;top (required)&gt;'&#10;/usr/local/bin/fastlane:23:in `load'&#10;/usr/local/bin/fastlane:23:in `&lt;main&gt;'&#10;&#10;[31mGit repository is dirty! Please ensure the repo is in a clean state by commiting/stashing/discarding all changes first.[0m" />
<failure message="/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/actions/actions_helper.rb:33:in `execute_action'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/runner.rb:129:in `block in execute_action'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/runner.rb:128:in `chdir'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/runner.rb:128:in `execute_action'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/fast_file.rb:149:in `method_missing'&#10;Fastfile:42:in `block (2 levels) in parsing_binding'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/lane.rb:36:in `call'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/lane.rb:36:in `call'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/runner.rb:52:in `block in execute'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/runner.rb:46:in `chdir'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/runner.rb:46:in `execute'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/lane_manager.rb:46:in `cruise_lane'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/lib/fastlane/command_line_handler.rb:30:in `handle'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/bin/fastlane:38:in `block (2 levels) in run'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1@global/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1@global/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1@global/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1@global/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane_core-0.41.2/lib/fastlane_core/ui/fastlane_runner.rb:23:in `run!'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1@global/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/bin/fastlane:158:in `run'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/gems/fastlane-1.80.0/bin/fastlane:164:in `&lt;top (required)&gt;'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/bin/fastlane:23:in `load'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/bin/fastlane:23:in `&lt;main&gt;'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'&#10;/Users/Thierry/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `&lt;main&gt;'&#10;&#10;Could not find version in podspec content '#&#10;# Be sure to run `pod lib lint GMPhobos.podspec' to ensure this is a&#10;# valid spec before submitting.&#10;#&#10;# Any lines starting with a # are optional, but their use is encouraged&#10;# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html&#10;#&#10;&#10;Pod::Spec.new do |s|&#10; s.name = &quot;GMPhobos&quot;&#10; s.version = &quot;0.1.9&quot;&#10; s.summary = &quot;GM statistic data sdk&quot;&#10;&#10;# This description is used to generate tags and improve search results.&#10;# * Think: What does it do? Why did you write it? What is the focus?&#10;# * Try to keep it short, snappy and to the point.&#10;# * Write the description between the DESC delimiters below.&#10;# * Finally, don't worry about the indent, CocoaPods strips it! &#10; s.description = &lt;&lt;-DESC&#10;&#10; GM event track sdk.&#10;&#10; DESC&#10;&#10; s.homepage = &quot;http://git.gengmei.cc/gengmeiios/GMPhobos&quot;&#10; # s.screenshots = &quot;www.example.com/screenshots_1&quot;, &quot;www.example.com/screenshots_2&quot;&#10; s.license = 'MIT'&#10; s.author = { &quot;licong&quot; =&gt; &quot;licong@gmei.com&quot; }&#10; s.source = { :git =&gt; &quot;http://git.gengmei.cc/gengmeiios/GMPhobos.git&quot;, :tag =&gt; &quot;0.1.8&quot; }&#10; # s.social_media_url = 'https://twitter.com/&lt;TWITTER_USERNAME&gt;'&#10;&#10; s.platform = :ios, '7.0'&#10; s.requires_arc = true&#10;&#10; s.source_files = 'Pod/Classes/**/*'&#10; s.dependency 'GMLibrary','~&gt; 0.0.1'&#10; s.library = 'z'&#10; s.resource_bundles = {&#10; 'GMPhobos' =&gt; ['Pod/Assets/*.png']&#10; }&#10;&#10;end&#10;'" />
</testcase>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment