fastlane-plugin-commit_android_version_bump 0.1.3 → 0.2.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4c5d5656c8ccddd9e5aeb0df88f70117d4925f1
|
4
|
+
data.tar.gz: dced72431c36bb6b4fd927d866c6053c2ea7e284
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 844932b6deb51c53cd8cb8b4efacdc2dda1b0fa9e58e02dc736dca9d3c76269ffd71e1fee9448c0bf08de876052dcc92a1dbc959ea68bfe75c17575d15e47690
|
7
|
+
data.tar.gz: dbfa09bef5975e4d72208278bcf8dac757642c5cfdb6b81dbc4c590cf35a023c6c41e4f20ba862c15bb0e5a8bc3083ad7f1be3068480db9390d17c959a02f3d8
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2016 Jérémy TOUDIC <jeremy.toudic@
|
3
|
+
Copyright (c) 2016 Jérémy TOUDIC <jeremy.toudic@gmail.com>
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/lib/fastlane/plugin/commit_android_version_bump/actions/commit_android_version_bump_action.rb
CHANGED
@@ -7,38 +7,50 @@ module Fastlane
|
|
7
7
|
require 'set'
|
8
8
|
require 'shellwords'
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
10
|
+
build_file_folder ||= params[:gradle_file_folder]
|
11
|
+
if build_file_folder != nil
|
12
|
+
UI.message("The commit_android_version_bump plugin will use gradle file at (#{build_file_folder})!")
|
13
|
+
|
14
|
+
absolute_path = File.expand_path(build_file_folder)
|
15
|
+
build_file_path = build_file_folder+"/build.gradle"
|
16
|
+
# find the repo root path
|
17
|
+
repo_path = Actions.sh("git -C #{absolute_path} rev-parse --show-toplevel").strip
|
18
|
+
repo_pathname = Pathname.new(repo_path)
|
19
|
+
else
|
20
|
+
app_folder_name ||= params[:app_folder_name]
|
21
|
+
UI.message("The commit_android_version_bump plugin is looking inside your project folder (#{app_folder_name})!")
|
22
|
+
|
23
|
+
build_folder_paths = Dir[File.expand_path(File.join('**/', app_folder_name))].reject { |file| ['build/', 'node_modules/'].any? { |part| file.include? part } }
|
24
|
+
# no build.gradle found: error
|
25
|
+
UI.user_error!('Could not find a build folder in the current repository\'s working directory.') if build_folder_paths.count == 0
|
26
|
+
|
27
|
+
UI.message("Found the following project path: #{build_folder_paths}")
|
28
|
+
# too many projects found: error
|
29
|
+
if build_folder_paths.count > 1
|
30
|
+
UI.user_error!("Found multiple build.gradle projects in the current repository's working directory.")
|
31
|
+
end
|
32
|
+
|
33
|
+
build_folder_path = build_folder_paths.first
|
34
|
+
|
35
|
+
# find the repo root path
|
36
|
+
repo_path = Actions.sh("git -C #{build_folder_path} rev-parse --show-toplevel").strip
|
37
|
+
repo_pathname = Pathname.new(repo_path)
|
38
|
+
|
39
|
+
|
40
|
+
build_file_paths = Dir[File.expand_path(File.join('**/', app_folder_name, 'build.gradle'))].reject { |file| file.include? 'node_modules/' }
|
41
|
+
|
42
|
+
# no build.gradle found: error
|
43
|
+
UI.user_error!('Could not find a build.gradle in the current repository\'s working directory.') if
|
44
|
+
build_file_paths.count == 0
|
45
|
+
# too many projects found: error
|
46
|
+
if build_file_paths.count > 1
|
47
|
+
UI.user_error!("Found multiple build.gradle projects in the current repository's working directory.")
|
48
|
+
end
|
49
|
+
|
50
|
+
build_file_path = build_file_paths.first
|
51
|
+
build_file_path.replace build_file_path.sub("#{repo_pathname}/", "")
|
21
52
|
end
|
22
53
|
|
23
|
-
build_folder_path = build_folder_paths.first
|
24
|
-
|
25
|
-
# find the repo root path
|
26
|
-
repo_path = Actions.sh("git -C #{build_folder_path} rev-parse --show-toplevel").strip
|
27
|
-
repo_pathname = Pathname.new(repo_path)
|
28
|
-
|
29
|
-
|
30
|
-
build_file_paths = Dir[File.expand_path(File.join('**/',app_folder_name,'build.gradle'))]
|
31
|
-
|
32
|
-
# no build.gradle found: error
|
33
|
-
UI.user_error!('Could not find a build.gradle in the current repository\'s working directory.') if build_file_paths.count == 0
|
34
|
-
# too many projects found: error
|
35
|
-
if build_file_paths.count > 1
|
36
|
-
UI.user_error!("Found multiple build.gradle projects in the current repository's working directory.")
|
37
|
-
end
|
38
|
-
|
39
|
-
build_file_path = build_file_paths.first
|
40
|
-
build_file_path.replace build_file_path.sub("#{repo_pathname}/", "")
|
41
|
-
|
42
54
|
# create our list of files that we expect to have changed, they should all be relative to the project root, which should be equal to the git workdir root
|
43
55
|
expected_changed_files = []
|
44
56
|
expected_changed_files << build_file_path
|
@@ -98,7 +110,7 @@ module Fastlane
|
|
98
110
|
end
|
99
111
|
|
100
112
|
def self.authors
|
101
|
-
["
|
113
|
+
["Jems"]
|
102
114
|
end
|
103
115
|
|
104
116
|
def self.available_options
|
@@ -113,6 +125,12 @@ module Fastlane
|
|
113
125
|
optional: true,
|
114
126
|
type: String,
|
115
127
|
default_value:"app"),
|
128
|
+
FastlaneCore::ConfigItem.new(key: :gradle_file_folder,
|
129
|
+
env_name: "CVB_GRADLE_FILE_FOLDER",
|
130
|
+
description: "The relative path to the folder that contains the gradle file containing the modification to commit (example :project/app)",
|
131
|
+
optional: true,
|
132
|
+
type: String,
|
133
|
+
default_value: nil),
|
116
134
|
FastlaneCore::ConfigItem.new(key: :force,
|
117
135
|
env_name: "CVB_FORCE_COMMIT",
|
118
136
|
description: "Forces the commit, even if other files than the ones containing the version number have been modified",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-commit_android_version_bump
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|