fastlane-plugin-emerge 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 147f6fba27728c230b0cda85c93253b75eeff200722eeb8bfad811ed4f5dc8ba
|
4
|
+
data.tar.gz: 4d0cdd42690b1b140506467d2957e7a080a207cab05ebfd1dd8973e17085d7b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e3975113c2415dd8e4cc29bb107a5b65537ab5cc48962c7d96ad10b1ca545be7dae93ee5bf9c042e32e83f8116ecc9c843f86bef89ecef55b43251737e362c6
|
7
|
+
data.tar.gz: 81f4b386e95a063e5dfdc046e3370d1ae4679be4cded0d81fd2f5dbade302104c908ae60353298f71c42bc47a9682aeab3a8e9d688932b839c9df1cb30f7c6fe
|
@@ -1,19 +1,59 @@
|
|
1
1
|
require 'fastlane/action'
|
2
2
|
require 'fastlane_core/print_table'
|
3
3
|
require_relative '../helper/emerge_helper'
|
4
|
+
require 'pathname'
|
5
|
+
require 'tmpdir'
|
6
|
+
require 'fileutils'
|
4
7
|
|
5
8
|
module Fastlane
|
6
9
|
module Actions
|
7
10
|
class EmergeAction < Action
|
8
11
|
def self.run(params)
|
9
12
|
api_token = params[:api_token]
|
10
|
-
file_path = params[:file_path]
|
13
|
+
file_path = params[:file_path] || lane_context[SharedValues::XCODEBUILD_ARCHIVE]
|
14
|
+
|
15
|
+
if file_path == nil
|
16
|
+
file_path = Dir.glob("#{lane_context[SharedValues::SCAN_DERIVED_DATA_PATH]}/Build/Products/Debug-iphonesimulator/*.app").first
|
17
|
+
end
|
11
18
|
pr_number = params[:pr_number]
|
12
19
|
build_id = params[:build_id]
|
13
20
|
base_build_id = params[:base_build_id]
|
14
21
|
repo_name = params[:repo_name]
|
15
22
|
build_type = params[:build_type]
|
16
|
-
|
23
|
+
|
24
|
+
if !File.exist?(file_path)
|
25
|
+
UI.error("Invalid input file")
|
26
|
+
return
|
27
|
+
end
|
28
|
+
|
29
|
+
# If the user provided a .app we will look for dsyms and package it into a zipped xcarchive
|
30
|
+
if File.extname(file_path) == '.app'
|
31
|
+
absolute_path = Pathname.new(File.expand_path(file_path))
|
32
|
+
UI.message("A .app was provided, dSYMs will be looked for in #{absolute_path.dirname}")
|
33
|
+
Dir.mktmpdir do |d|
|
34
|
+
application_folder = "#{d}/archive.xcarchive/Products/Applications/"
|
35
|
+
dsym_folder = "#{d}/archive.xcarchive/dSYMs/"
|
36
|
+
FileUtils.mkdir_p application_folder
|
37
|
+
FileUtils.mkdir_p dsym_folder
|
38
|
+
FileUtils.cp_r(file_path, application_folder)
|
39
|
+
Dir.glob("#{absolute_path.dirname}/*/*.dsym") do |filename|
|
40
|
+
UI.message("Found dSYM: #{Pathname.new(filename).basename}")
|
41
|
+
FileUtils.cp_r(filename, dsym_folder)
|
42
|
+
end
|
43
|
+
Xcodeproj::Plist.write_to_path({"NAME" => "Emerge Upload"}, "#{d}/archive.xcarchive/Info.plist")
|
44
|
+
file_path = "#{absolute_path.dirname}/archive.xcarchive.zip"
|
45
|
+
ZipAction.run(
|
46
|
+
path: "#{d}/archive.xcarchive",
|
47
|
+
output_path: file_path)
|
48
|
+
UI.message("Archive generated at #{file_path}")
|
49
|
+
end
|
50
|
+
elsif File.extname(file_path) == '.xcarchive'
|
51
|
+
zip_path = file_path + ".zip"
|
52
|
+
Actions::ZipAction.run(
|
53
|
+
path: file_path,
|
54
|
+
output_path: zip_path)
|
55
|
+
file_path = zip_path
|
56
|
+
elsif !File.extname(file_path) == '.zip'
|
17
57
|
UI.error("Invalid input file")
|
18
58
|
return
|
19
59
|
end
|
@@ -85,7 +125,7 @@ module Fastlane
|
|
85
125
|
FastlaneCore::ConfigItem.new(key: :file_path,
|
86
126
|
env_name: "EMERGE_FILE_PATH",
|
87
127
|
description: "Path to the zipped xcarchive or app to upload",
|
88
|
-
optional:
|
128
|
+
optional: true,
|
89
129
|
type: String),
|
90
130
|
FastlaneCore::ConfigItem.new(key: :pr_number,
|
91
131
|
description: "The PR number that triggered this upload",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-emerge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emerge Tools, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|