fastlane-plugin-ios_flavors 0.1.0 → 0.1.1

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: 28a44252cab2b7b429517fb5a0e9bbc64361df31d2557d552aa493245648069a
4
- data.tar.gz: 88b2a8c4ced277b1e599a8cd416c8d10d26871ae5cf95895f6af2f40714ee4ec
3
+ metadata.gz: 6ea1c7ef7a9f97ff5063240782c7604f9a878dc38fda49786bad2fd2894f5c08
4
+ data.tar.gz: ca5b4a000de607fe18ce953ec9a9c9cb485b23a6237d001eb5eda4b182a43d72
5
5
  SHA512:
6
- metadata.gz: 8781f677ff598471a5b8e4047e9d04d0ca3f9254cd1a2bd4128e28c2dea99bbc0dbd6e3b808804c4dfffbef601c1f48be31dce1395a6ee379672ade77ccc4220
7
- data.tar.gz: e2ea35a5c95fb943e5adadf932ceb27a486fc3d1c722ab4dc4d6cb20b731d45c38af289bbd571d08d95fcb22ac35feb458cd64c99c594f592a10acdfc1c0952c
6
+ metadata.gz: c6d5a92ad5ef2ebf3178a9ba8da39d628dc5901ca44d044ba4907653e3edd0edc3d1b2fd45eab723d746385957e21b1bcf0d0cf9a42c25a663bc713d72adeae0
7
+ data.tar.gz: e509d535c089a1498b60df41a6cd85bc81877753fbc61f84c54189198af7dbf2fb0f9749584a56b178f3de13f18bd17e418e87181de9039697a037aeae5dfa30
data/README.md CHANGED
@@ -23,7 +23,7 @@ Create multiple build flavors of an iOS .ipa file using a directory of .plist fi
23
23
  output_directory: 'path/to/desired/output/directory', # [Optional] Directory to place flavors in. (default: 'fastlane/build_output/flavors')
24
24
  target_plist: 'MyConfig.plist', # [Optional] .plist to replace with each flavor. (default: 'Info.plist')
25
25
  signing_identity: 'Apple Distribution: Gem Technologies Limited (XXXXXXXXXXX)', # Signing identity with which to sign your flavor .ipa's
26
- provisioning_profile: 'path/to/my/provisioning/profile', # [Optional if using `sigh`] Provisioning profile with which to sign your flavor .ipa's
26
+ provisioning_profile: 'path/to/my/provisioning/profile', # [Optional, will attempt to automatically detect] Provisioning profile with which to sign your flavor .ipa's
27
27
  )
28
28
  ```
29
29
 
@@ -51,7 +51,7 @@ module Fastlane
51
51
 
52
52
  FastlaneCore::ConfigItem.new(key: :output_directory,
53
53
  env_name: "IOS_FLAVORS_OUTPUT",
54
- description: "The output flavors directory.",
54
+ description: "The output flavors directory",
55
55
  default_value: "fastlane/build_output/flavors",
56
56
  optional: true,
57
57
  type: String),
@@ -1,5 +1,7 @@
1
1
  require 'fastlane_core/ui/ui'
2
2
  require 'fileutils'
3
+ require 'ipa_utilities'
4
+ require 'digest'
3
5
 
4
6
  module Fastlane
5
7
  UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
@@ -16,13 +18,13 @@ module Fastlane
16
18
  output_directory = params[:output_directory] || 'build_output/flavors'
17
19
  target_plist = params[:target_plist] || 'Info.plist'
18
20
  signing_identity = params[:signing_identity]
19
- provisioning_profile = params[:provisioning_profile] || Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATH]
21
+ provisioning_profile = params[:provisioning_profile] || locate_installed_provisioning_profile_for_ipa(params[:ipa]) || Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATH]
20
22
 
21
23
  raise "You must supply an :ipa (can be omitted if using 'ipa')" unless ipa
22
24
  raise 'You must supply a :flavors directory of .plist files.' unless flavors
23
25
  raise 'You must supply a :target_plist to be replaced in the :ipa.' unless flavors
24
26
  raise 'You must supply a :signing_identity' unless signing_identity
25
- raise "You must supply a :provisioning_profile (can be omitted if using 'sigh')" unless provisioning_profile
27
+ raise "Could not locate a :provisioning_profile for the :ipa provided." unless provisioning_profile
26
28
 
27
29
  raise "#{ipa} not found." unless File.file?(ipa)
28
30
  raise "#{flavors} not found." unless Dir.exist?(flavors)
@@ -42,6 +44,25 @@ module Fastlane
42
44
  provisioning_profile: provisioning_profile
43
45
  }
44
46
  end
47
+
48
+ def self.locate_installed_provisioning_profile_for_ipa(path)
49
+
50
+ working_directory = Dir.pwd
51
+ ipa = IpaParser.new(path)
52
+ embedded_profile_path = File.expand_path(ipa.provision_profile.provision_path)
53
+ Dir.chdir(working_directory) # IpaParser changes directory while doing its work.
54
+
55
+ installed_profiles_dir = File.expand_path('~/Library/MobileDevice/Provisioning Profiles/')
56
+ desired_profile = Dir["#{installed_profiles_dir}/*.mobileprovision"].detect do |installed_profile|
57
+ embedded_data = File.read(embedded_profile_path)
58
+ installed_data = File.read(installed_profile)
59
+ Digest::MD5.hexdigest(embedded_data) == Digest::MD5.hexdigest(installed_data)
60
+ end
61
+
62
+ UI.important "Located provisioning profile used to sign .ipa: #{desired_profile}"
63
+
64
+ return desired_profile
65
+ end
45
66
  end
46
67
  end
47
68
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module IosFlavors
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-ios_flavors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Davison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-16 00:00:00.000000000 Z
11
+ date: 2021-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ipa_utilities
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: pry
15
29
  requirement: !ruby/object:Gem::Requirement