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: 0f542abe602fdc9595e71d1b8a4b8e8bf9bee55a54331a51c33e8636fd1eef71
4
- data.tar.gz: 10a41705f7a6d28043adb141731da2b7a9ec4a6da1bc45923a07fcbb4f7c7ac5
3
+ metadata.gz: 147f6fba27728c230b0cda85c93253b75eeff200722eeb8bfad811ed4f5dc8ba
4
+ data.tar.gz: 4d0cdd42690b1b140506467d2957e7a080a207cab05ebfd1dd8973e17085d7b2
5
5
  SHA512:
6
- metadata.gz: 0e0f04590f3dc09a384e5368f76beb7e4841e14996536d49bdd1730bf4c20bf8e9d852f308a2f93df51ef729a3f90561e91169868a64ef6648f0d00544434f57
7
- data.tar.gz: f98a707293e57a51b5a85bef78cbfa737320e4d1fb051f1bac04014225ebea807e8bad5cf2018e6f30b8e89805e6a71663dd18807d860a5f8c771d3479ff4aa0
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
- if !File.exist?(file_path) || !File.extname(file_path) == '.zip'
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: false,
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",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Emerge
3
- VERSION = "0.1.3"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
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.1.3
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-03-27 00:00:00.000000000 Z
11
+ date: 2021-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday