fastlane-plugin-dynatrace 2.0.2 → 2.1.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: 4c4a6f8d1227ec74720d2e742f0d223851e5289b2b90bd3014c4e786e684ed1a
4
- data.tar.gz: a03496e08564907a0598c68e35ae4a91374b9430a10c7d3b52ff9341eef26342
3
+ metadata.gz: 8f9d82532307fde8ca1288b6bb467088f63e0a45da5933d1646e8dada2f57cd6
4
+ data.tar.gz: ccd706648e2f0ca713ad9f2210cf7693889f34c176c9eae18ea27358002244db
5
5
  SHA512:
6
- metadata.gz: 8b1a244982e3dbb67b333e45cc61f26d48c5caedae2f1b75bb46d1340e3163216891fda2bc1416e8f530af074604876dda906df1c3194e9718d3121ea50416f0
7
- data.tar.gz: efdbe03451df9edf0bab421ba3066c1d86bdceb777420a0ff9e450b3807847ad56a9ef1de8ab1b255079b232b337d20acf17eacd5fcdf6d784b3053d99e7f610
6
+ metadata.gz: 5743294ccc42bb2c63a47fd41b48bf320d49c2f9fe72907c35a23cc634fc4f85b5ea7d0630faad35db8ea334f075777ae5b284d027d0251512ab9834ba2fb40f
7
+ data.tar.gz: 04ec5397a2153f52e307b91539fa2295bec158da91d8db07fdbf067bac1479e778a8add0e8ac5c56310bcfe70f600bcf92e04bb1596d9f78477ada069fe2be86
data/README.md CHANGED
@@ -37,22 +37,24 @@ Now, when you run fastlane, the Dynatrace plugin will manage the symbol files of
37
37
 
38
38
 
39
39
  ## List of all Parameters
40
- | Key | Description | default value |
41
- |------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
42
- | action | *(iOS/tvOS only)* Action to be performed by DTXDssClient (`upload` or `decode`). | `upload` |
43
- | username | *(iOS/tvOS only)* The username/AppleID to use to download the dSYMs. Alternatively you can specify this in your AppFile as `apple_id`. | |
44
- | os | The type of the symbol files, either `ios`, `tvOS` or `android`. | |
45
- | apitoken | Dynatrace API token with mobile symbolication permissions. | |
46
- | appID | The application ID you get from your Dynatrace environment. | |
47
- | bundleId | The CFBundlebundleId (iOS, tvOS) / package (Android) of the application. Alternatively you can specify this in your AppFile as `app_identifier`. | |
48
- | versionStr | The CFBundleShortVersionString (iOS, tvOS) / versionName (Android) | |
49
- | version | The CFBundleVersion (iOS, tvOS) / versionCode (Android). Is also used for the dSYM download. | |
50
- | symbolsfile | Path to the dSYM or Android mapping file to be processed. *(Android only)*: If the file exceeds 10MiB and doesn't end with `*.zip` it's zipped before uploading. This can be disabled by setting `symbolsfileAutoZip` to false. | |
51
- | symbolsfileAutoZip | *(Android only)* Automatically zip symbolsfile if it exceeds 10MiB and doesn't already end with `*.zip`. | `true` |
52
- | server | The API endpoint for the Dynatrace environment (e.g. `https://environmentID.live.dynatrace.com` or `https://dynatrace-managed.com/e/environmentID`). | |
53
- | cleanBuildArtifacts | Clean build artifacts after processing. | `false` |
54
- | tempdir | (OPTIONAL) Custom temporary directory for the DTXDssClient. **The plugin does not take care of cleaning this directory.** | |
55
- | debugMode | Enable debug logging. | false |
40
+ | Key | Description | default value |
41
+ |-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
42
+ | action | *(iOS/tvOS only)* Action to be performed by DTXDssClient (`upload` or `decode`). | `upload` |
43
+ | username | *(iOS/tvOS only)* The username/AppleID to use to download the dSYMs. Alternatively you can specify this in your AppFile as `apple_id`. | |
44
+ | os | The type of the symbol files, either `ios`, `tvOS` or `android`. | |
45
+ | apitoken | Dynatrace API token with mobile symbolication permissions. | |
46
+ | appID | The application ID you get from your Dynatrace environment. | |
47
+ | bundleId | The CFBundlebundleId (iOS, tvOS) / package (Android) of the application. Alternatively you can specify this in your AppFile as `app_identifier`. | |
48
+ | versionStr | The CFBundleShortVersionString (iOS, tvOS) / versionName (Android) | |
49
+ | version | The CFBundleVersion (iOS, tvOS) / versionCode (Android). Is also used for the dSYM download. | |
50
+ | symbolsfile | Path to the dSYM or Android mapping file to be processed. *(Android only)*: If the file exceeds 10MiB and doesn't end with `*.zip` it's zipped before uploading. This can be disabled by setting `symbolsfileAutoZip` to false. | |
51
+ | symbolsfileAutoZip | *(Android only)* Automatically zip symbolsfile if it exceeds 10MiB and doesn't already end with `*.zip`. | `true` |
52
+ | server | The API endpoint for the Dynatrace environment (e.g. `https://environmentID.live.dynatrace.com` or `https://dynatrace-managed.com/e/environmentID`). | |
53
+ | cleanBuildArtifacts | Clean build artifacts after processing. | `false` |
54
+ | tempdir | (OPTIONAL) Custom temporary directory for the DTXDssClient. **The plugin does not take care of cleaning this directory.** | |
55
+ | debugMode | Enable debug logging. | `false` |
56
+ | customLLDBFrameworkPath | (OPTIONAL) Custom path to the LLDB framework used as runtime dependency by DTXDssClient (e.g. `/Users/test/Documents/LLDB.framework`). | |
57
+ | autoSymlinkLLDB | (OPTIONAL) Automatically find and create a symlink to the LLDB framework into the DTXDssClient's temporary folder. | `true` |
56
58
 
57
59
  ## Example
58
60
  Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
@@ -35,17 +35,18 @@ module Fastlane
35
35
 
36
36
  # https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/mobile-symbolication-api/put-files-app-version
37
37
  if response.code == '204'
38
- UI.success "API response: Success."
38
+ UI.success "API response: Success."
39
39
  else
40
- message = nil
41
- unless response.body.nil?
42
- message = JSON.parse(response.body)["error"]["message"]
43
- end
44
- if message.nil?
45
- UI.user_error! "API response: #{response.code}. Please try again in a few minutes or contact the Dynatrace support (https://www.dynatrace.com/services-support/)."
46
- else
47
- UI.user_error! "API response: #{message} (Response code: #{response.code})"
48
- end
40
+ message = nil
41
+ if response.class.body_permitted? and not response.body.nil?
42
+ message = JSON.parse(response.body)["error"]["message"]
43
+ end
44
+
45
+ if message.nil?
46
+ UI.user_error! "API response: #{response.code}. Please try again in a few minutes or contact Dynatrace support (https://support.dynatrace.com)."
47
+ else
48
+ UI.user_error! "API response: #{message} (Response code: #{response.code})"
49
+ end
49
50
  end
50
51
  return
51
52
  end
@@ -55,10 +56,30 @@ module Fastlane
55
56
  end
56
57
 
57
58
  # iOS/tvOS workflow
58
- dtxDssClientPath = Helper::DynatraceHelper.get_dss_client(params)
59
+ unless OS.mac?
60
+ UI.user_error! "A macOS machine is required to process iOS or tvOS symbols."
61
+ end
59
62
 
60
- if !OS.mac?
61
- UI.user_error! "A macOS machine is required to process iOS symbols."
63
+ dtxDssClientPath = Helper::DynatraceHelper.get_dss_client(params)
64
+ dtxDssClientDir = File.dirname(dtxDssClientPath)
65
+ Helper::DynatraceSymlinkHelper.delete_existing_lldb_symlinks(dtxDssClientDir)
66
+
67
+ customLLDBFrameworkPath = params[:customLLDBFrameworkPath]
68
+ if customLLDBFrameworkPath.nil?
69
+ UI.message "No custom LLDB framework path provided"
70
+ if params[:autoSymlinkLLDB]
71
+ UI.message "Automatic LLDB symlink creation enabled"
72
+ Helper::DynatraceSymlinkHelper.auto_symlink_lldb(dtxDssClientDir)
73
+ elsif
74
+ UI.message "Automatic LLDB symlink creation disabled"
75
+ end
76
+ else
77
+ if Helper::DynatraceSymlinkHelper.path_exists?(customLLDBFrameworkPath)
78
+ UI.message "Custom LLDB framework path `#{customLLDBFrameworkPath}` exists."
79
+ Helper::DynatraceSymlinkHelper.symlink_custom_lldb(customLLDBFrameworkPath, dtxDssClientDir)
80
+ else
81
+ UI.user_error! "Custom LLDB framework path `#{customLLDBFrameworkPath}` does not exist!"
82
+ end
62
83
  end
63
84
 
64
85
  # start constructing the command that will trigger the DTXDssClient
@@ -174,7 +195,7 @@ module Fastlane
174
195
  description: "Path to the dSYM or Android mapping file to be processed. Android only: If the file exceeds 10MiB and doesn't end with *.zip it's zipped before uploading. This can be disabled by setting `symbolsfileAutoZip` to false",
175
196
  verify_block: proc do |value|
176
197
  UI.user_error!("Please provide a value for the symbol files. Pass using `symbolsfile: 'symbolsfile'`") unless (value and not value.empty?)
177
- end),
198
+ end),
178
199
 
179
200
  FastlaneCore::ConfigItem.new(key: :symbolsfileAutoZip,
180
201
  env_name: "FL_UPLOAD_TO_DYNATRACE_SYM_FILE_AUTO_ZIP",
@@ -205,6 +226,18 @@ module Fastlane
205
226
  description: "Enable debug logging",
206
227
  default_value: false,
207
228
  is_string: false,
229
+ optional: true),
230
+
231
+ FastlaneCore::ConfigItem.new(key: :customLLDBFrameworkPath,
232
+ env_name: "FL_UPLOAD_TO_DYNATRACE_LLDB_PATH",
233
+ description: "Custom path to the LLDB framework used as runtime dependency by DTXDssClient",
234
+ optional: true),
235
+
236
+ FastlaneCore::ConfigItem.new(key: :autoSymlinkLLDB,
237
+ env_name: "FL_UPLOAD_TO_DYNATRACE_AUTO_LINK_LLDB",
238
+ description: "Automatically find and create a symlink to the LLDB framework into the DTXDssClient's temporary folder",
239
+ type: Boolean,
240
+ default_value: true,
208
241
  optional: true)
209
242
  ]
210
243
  end
@@ -0,0 +1,83 @@
1
+ module Fastlane
2
+ UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
3
+
4
+ module Helper
5
+ class DynatraceSymlinkHelper
6
+ def self.path_exists?(path)
7
+ unless path.nil?
8
+ return Dir.exist?(path) || File.exist?(path)
9
+ end
10
+ return false
11
+ end
12
+
13
+ def self.symlink_custom_lldb(lldb_path, destination_path)
14
+ require_path(destination_path)
15
+ require_path(lldb_path)
16
+ UI.message "Preparing to symlink custom LLDB framework path to: #{destination_path}"
17
+ symlink(lldb_path, destination_path)
18
+ end
19
+
20
+ def self.auto_symlink_lldb(destination_path)
21
+ require_path(destination_path)
22
+ UI.message "Preparing to automatically symlink LLDB framework path to: #{destination_path}"
23
+ current_xcode_path = %x(xcrun xcode-select --print-path).chomp
24
+ active_lldb_path = active_lldb_path(current_xcode_path)
25
+ if active_lldb_path.nil?
26
+ UI.important "Could not find active LLDB framework path!"
27
+ else
28
+ UI.message "LLDB framework found at: #{active_lldb_path}"
29
+ symlink(active_lldb_path, destination_path)
30
+ end
31
+ end
32
+
33
+ def self.delete_existing_lldb_symlinks(destination_path)
34
+ symlink_path = make_symlink_path_name(destination_path)
35
+ if File.symlink?(symlink_path)
36
+ UI.message "Deleting existing LLDB symlink: #{symlink_path}"
37
+ FileUtils.rm(symlink_path)
38
+ else
39
+ UI.message "No existing LLDB symlink at destination: #{symlink_path}"
40
+ end
41
+ end
42
+
43
+ def self.require_path(path)
44
+ if path.nil?
45
+ raise "Path should not be nil."
46
+ end
47
+
48
+ unless path.instance_of?(String)
49
+ raise "Path should be a string."
50
+ end
51
+
52
+ unless path_exists?(path)
53
+ raise "Path: #{path} does not exist."
54
+ end
55
+ end
56
+
57
+ def self.symlink(source, destination)
58
+ destination_absolute = File.expand_path(make_symlink_path_name(destination))
59
+ source_absolute = File.expand_path(source)
60
+ UI.message "Creating a symlink of #{source_absolute} at #{destination_absolute}"
61
+ FileUtils.symlink(source_absolute, destination_absolute)
62
+ end
63
+
64
+ def self.active_lldb_path(xcode_path)
65
+ unless xcode_path.end_with? "/Developer"
66
+ UI.important "Could not find proper Xcode path!"
67
+ UI.important "Output of `xcode-select --print-path` command is `#{xcode_path}`"
68
+ UI.important "Please make sure your developer path ends with `/Developer`"
69
+ return nil
70
+ end
71
+
72
+ parent_dir = File.dirname(xcode_path)
73
+ return File.join(parent_dir, "SharedFrameworks", "LLDB.framework")
74
+ end
75
+
76
+ def self.make_symlink_path_name(destination_path)
77
+ File.join(destination_path, "LLDB.framework")
78
+ end
79
+
80
+ private_class_method :require_path, :symlink, :make_symlink_path_name
81
+ end
82
+ end
83
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Dynatrace
3
- VERSION = "2.0.2"
3
+ VERSION = "2.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-dynatrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dynatrace LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-06 00:00:00.000000000 Z
11
+ date: 2024-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -245,6 +245,7 @@ files:
245
245
  - lib/fastlane/plugin/dynatrace.rb
246
246
  - lib/fastlane/plugin/dynatrace/actions/dynatrace_action.rb
247
247
  - lib/fastlane/plugin/dynatrace/helper/dynatrace_helper.rb
248
+ - lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb
248
249
  - lib/fastlane/plugin/dynatrace/version.rb
249
250
  homepage: https://github.com/Dynatrace/fastlane-plugin-dynatrace
250
251
  licenses: