Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMPhobos
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMPhobos
Commits
2606eb8c
Commit
2606eb8c
authored
Dec 19, 2018
by
jinzhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add action
parent
a8d0513c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
238 additions
and
1 deletion
+238
-1
.gitignore
.gitignore
+1
-1
get_app_version.rb
fastlane/actions/get_app_version.rb
+31
-0
git_commit_all.rb
fastlane/actions/git_commit_all.rb
+35
-0
pod_install.rb
fastlane/actions/pod_install.rb
+30
-0
pod_repo_update.rb
fastlane/actions/pod_repo_update.rb
+61
-0
sync_build_number_to_git.rb
fastlane/actions/sync_build_number_to_git.rb
+47
-0
update_build_number.rb
fastlane/actions/update_build_number.rb
+33
-0
No files found.
.gitignore
View file @
2606eb8c
...
@@ -32,4 +32,4 @@ Carthage
...
@@ -32,4 +32,4 @@ Carthage
# `pod install` in .travis.yml
# `pod install` in .travis.yml
#
#
Pods/
Pods/
fastlane/*
#
fastlane/*
fastlane/actions/get_app_version.rb
0 → 100644
View file @
2606eb8c
module
Fastlane
module
Actions
class
GetAppVersionAction
<
Action
def
self
.
run
(
params
)
command
=
[]
command
<<
"/usr/libexec/PlistBuddy"
command
<<
"-c"
command
<<
"'Print :CFBundleShortVersionString'"
command
<<
"./Gengmei/Info.plist"
result
=
Actions
.
sh
(
command
.
join
(
' '
))
return
result
end
def
self
.
description
"得到更美App版本号。"
end
def
self
.
return_value
"当前app版本"
end
def
self
.
authors
[
"汪洋"
]
end
def
self
.
is_supported?
(
platform
)
platform
==
:ios
end
end
end
end
fastlane/actions/git_commit_all.rb
0 → 100644
View file @
2606eb8c
module
Fastlane
module
Actions
class
GitCommitAllAction
<
Action
def
self
.
run
(
params
)
Actions
.
sh
"git commit -am
\"
#{
params
[
:message
]
}
\"
"
end
#####################################################
# @!group Documentation
#####################################################
def
self
.
description
"Commit all unsaved changes to git."
end
def
self
.
available_options
[
FastlaneCore
::
ConfigItem
.
new
(
key: :message
,
env_name:
"FL_GIT_COMMIT_ALL"
,
description:
"The git message for the commit"
,
is_string:
true
)
]
end
def
self
.
authors
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
[
"thierry"
]
end
def
self
.
is_supported?
(
platform
)
true
end
end
end
end
fastlane/actions/pod_install.rb
0 → 100644
View file @
2606eb8c
module
Fastlane
module
Actions
class
PodInstallAction
<
Action
def
self
.
run
(
params
)
Actions
.
sh
"cd Example && pod install"
Helper
.
log
.
info
"Successfully pod install ⬆️ "
.
green
end
#####################################################
# @!group Documentation
#####################################################
def
self
.
description
"Update all pods"
end
def
self
.
details
"Update all pods"
end
def
self
.
authors
[
"thierry"
]
end
def
self
.
is_supported?
(
platform
)
true
end
end
end
end
fastlane/actions/pod_repo_update.rb
0 → 100644
View file @
2606eb8c
module
Fastlane
module
Actions
# Updates the local clone of the spec-repo
class
PodRepoUpdateAction
<
Action
def
self
.
run
(
params
)
cmd
=
[]
repo
=
params
[
:repo
]
result
=
Actions
.
sh
(
"pod repo update
#{
repo
}
"
)
UI
.
success
(
"Successfully pod repo update 💾."
)
return
result
end
#####################################################
# @!group Documentation
#####################################################
def
self
.
description
"Updates the local clone of the spec-repo `NAME`. If `NAME` is omitted this will update all spec-repos in `~/.cocoapods/repos`."
end
def
self
.
details
# Optional:
# this is your chance to provide a more detailed description of this action
"You can use this action to do cool things..."
end
def
self
.
available_options
# Define all options your action supports.
[
FastlaneCore
::
ConfigItem
.
new
(
key: :repo
,
description:
"Repo"
,
is_string:
false
,
verify_block:
proc
do
|
value
|
end
),
]
end
def
self
.
output
# Define the shared values you are going to provide
# Example
[
[
'POD_REPO_UPDATE_CUSTOM_VALUE'
,
'A description of what this value contains'
]
]
end
def
self
.
return_value
# If you method provides a return value, you can describe here what it does
end
def
self
.
authors
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
[
"thierryxing"
]
end
def
self
.
is_supported?
(
platform
)
platform
==
:ios
end
end
end
end
fastlane/actions/sync_build_number_to_git.rb
0 → 100644
View file @
2606eb8c
module
Fastlane
module
Actions
module
SharedValues
BUILD_NUMBER
=
:BUILD_NUMBER
end
class
SyncBuildNumberToGitAction
<
Action
def
self
.
is_git?
Actions
.
sh
'git rev-parse HEAD'
return
true
rescue
return
false
end
def
self
.
run
(
params
)
if
is_git?
command
=
'git rev-list HEAD --count'
else
raise
"Not in a git repository."
end
build_number
=
(
Actions
.
sh
command
).
strip
Fastlane
::
Actions
::
IncrementBuildNumberAction
.
run
(
build_number:
build_number
)
Actions
.
lane_context
[
SharedValues
::
BUILD_NUMBER
]
=
build_number
end
def
self
.
output
[
[
'BUILD_NUMBER'
,
'The new build number'
]
]
end
#####################################################
# @!group Documentation
#####################################################
def
self
.
description
"Set the build version of your project to the same number of your total git commit count"
end
def
self
.
authors
[
"thierry"
]
end
def
self
.
is_supported?
(
platform
)
[
:ios
].
include?
platform
end
end
end
end
fastlane/actions/update_build_number.rb
0 → 100644
View file @
2606eb8c
module
Fastlane
module
Actions
class
UpdateBuildNumberAction
<
Action
#/usr/libexec/PlistBuddy -c "Set :CFBundleVersion 201605141556" GengmeiDoctor/Info.plist
def
self
.
run
(
params
)
command
=
[]
command
<<
"/usr/libexec/PlistBuddy"
command
<<
"-c"
command
<<
"
\"
Set :CFBundleVersion
#{
Time
.
now
.
strftime
(
"%Y%m%d%H%M"
)
}
\"
"
command
<<
"./Gengmei/Info.plist"
result
=
Actions
.
sh
(
command
.
join
(
' '
))
UI
.
success
(
"Update Build Number Successfully ⬆️ "
)
return
result
end
def
self
.
description
"更新iOS app build号为最新"
end
def
self
.
authors
[
"汪洋"
]
end
def
self
.
is_supported?
(
platform
)
platform
==
:ios
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment