fastlane-plugin-unity_exporter 1.3.2 → 1.4.2

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: afb410cbd88818bbc233fce59e860ea4b1c9843f82ae366f75976cc19992543d
4
- data.tar.gz: 7bfc6834d17e4f2b1a689eb674e7fa0deca0d63d336b18e9f73c6869f35eff50
3
+ metadata.gz: a78f2efa225ab9d6b65a90491bfd7c54a903b52948048e66198971261ab385df
4
+ data.tar.gz: 5dd1d2122e109ce66f8be30b38946bb42b987c1fec23e2f8010a768ae34f559e
5
5
  SHA512:
6
- metadata.gz: c291c26afd9a16d71c6e286178077b8136e0651ba158cd503debd75009cd42fdef94107ec210caaca4fc9eff63cdeeb4148bd7fddc00d330e6ce9577cc62feb8
7
- data.tar.gz: 1a9488d77b3797ab7d3ea2131a965c4d934be4db2e6a5d773f856334796af17dc0a966b5a10712ea29f60d31b59f321bb8904b3b1b08cc81cf5675dea948df4c
6
+ metadata.gz: dbd77420b89dd5adcdc724c834ceb3e9b4075e3f3d937dbf1391123e6da51931518f3ab247639c1f00374f69727d5c6849fec2291643575455b52a871b0a425f
7
+ data.tar.gz: 824171bda6c2a3de02bffd0cc2fc5914c720db4356689ff2d3b3d0257580f07c5a81c26a9b41b9493f3f66a6aac7b96d32f64414c0a3dd04d18951422f47d45e
@@ -16,10 +16,13 @@ module Fastlane
16
16
 
17
17
  log_file = Helper::GenericHelper.instance_variable_get(:@git_log_path)
18
18
 
19
- # Thank you: https://linuxize.com/post/bash-redirect-stderr-stdout/#redirecting-stderr-to-stdout
20
- sh("echo 'UnityCommitVersionBumpAction: created file' > #{log_file} 2>&1")
21
- sh("git add '#{Helper::UnityEditorHelper.unity_project_path}ProjectSettings/ProjectSettings.asset' >> #{log_file} 2>&1")
22
- sh("git commit -m 'Version Bump' >> #{log_file} 2>&1")
19
+ # this changes the working directory for the code run between the do/end block
20
+ Dir.chdir(Helper::UnityEditorHelper.unity_project_path) do
21
+ # Thank you: https://linuxize.com/post/bash-redirect-stderr-stdout/#redirecting-stderr-to-stdout
22
+ sh("echo 'UnityCommitVersionBumpAction: created file' > #{log_file} 2>&1")
23
+ sh("git add 'ProjectSettings/ProjectSettings.asset' >> #{log_file} 2>&1")
24
+ sh("git commit -m 'Version Bump' >> #{log_file} 2>&1")
25
+ end
23
26
  end
24
27
 
25
28
  def self.description
@@ -8,7 +8,14 @@ module Fastlane
8
8
  class UnityExportAction < Action
9
9
  def self.run(params)
10
10
  if params[:arguments]
11
+ # UI.message("Passed arguments: '#{params[:arguments]}'")
11
12
  if params[:use_default_paths]
13
+ pp = params[:arguments].scan(/-projectPath ((\w|[[:punct:]])*)/)[0][0]
14
+ if pp != ""
15
+ UI.message("Parsed project path from passed arguments: '#{pp}'")
16
+ Helper::UnityEditorHelper.instance_variable_set(:@project_path, pp)
17
+ end
18
+
12
19
  invoke_unity(arguments: " #{params[:arguments]}")
13
20
  else
14
21
  # path to Unity is provided as part of 'arguments'
@@ -26,7 +33,7 @@ module Fastlane
26
33
  headless_args << " -batchmode -nographics -quit" # some arguments that are required when running Unity in headless-mode
27
34
  headless_args << " -accept-apiupdate -releaseCodeOptimization"
28
35
  headless_args << " -projectPath #{Helper::UnityEditorHelper.unity_project_path}"
29
- headless_args << " -logFile unity-export-logs/#{DateTime.now.strftime('%Y-%m-%d_%H-%M-%S-%L')}_#{params[:build_target]}_build.log" # logging; not specifying a path will print the log to the console
36
+ headless_args << " -logFile #{Helper::UnityEditorHelper.unity_project_path}/BuildExporter/#{DateTime.now.strftime('%Y-%m-%d_%H-%M-%S-%L')}_#{params[:build_target]}_build.log" # logging; not specifying a path will print the log to the console
30
37
 
31
38
  # following are custom arguments defined in 'UnityExporter.BuildUtility'
32
39
  # this script is part of the 'fastlane-plugin-unity-exporter-package'
@@ -34,15 +41,18 @@ module Fastlane
34
41
  headless_args << " -newVersion #{params[:new_version]}" if params[:new_version]
35
42
  headless_args << " -newVersionCode #{params[:new_version_code]}" if params[:new_version_code]
36
43
 
44
+ # NOTE: the different relative paths used in 'projectPath' and 'exportPath'
45
+ # while 'projectPath' is relative to the 'fastfile',
46
+ # 'exportPath' is relative to 'projectPath' aka the Unity project's root directory
37
47
  if params[:export_path]
38
48
  headless_args << " -exportPath #{params[:export_path]}"
39
49
  else
40
50
  headless_args << " -exportPath fastlane-build-exporter/#{params[:build_target]}/unity-export"
41
51
  end
42
52
 
43
- # NOTE: the different relative paths used in 'projectPath' and 'exportPath'
44
- # while 'projectPath' is relative to the 'fastfile',
45
- # 'exportPath' is relative to 'projectPath' aka the Unity project's root directory
53
+ unless Helper::UnityEditorHelper.verify_exporter_package
54
+ return
55
+ end
46
56
 
47
57
  invoke_unity(arguments: headless_args)
48
58
 
@@ -62,10 +72,6 @@ module Fastlane
62
72
  return
63
73
  end
64
74
 
65
- unless Helper::UnityEditorHelper.verify_exporter_package
66
- return
67
- end
68
-
69
75
  unity_path = Helper::UnityEditorHelper.unity_editor_path
70
76
  if unity_path == ""
71
77
  return
@@ -149,7 +155,7 @@ module Fastlane
149
155
  type: String,
150
156
  conflicting_options: [:arguments],
151
157
  verify_block: proc do |value|
152
- unless value == "major" || value == "minor" || value == "patch" || Gem::Version.new(value).correct?
158
+ unless value == "major" || value == "minor" || value == "patch" || Gem::Version.correct?(value)
153
159
  UI.user_error!("Please pass a valid version. For options see 'fastlane action unity_exporter'")
154
160
  end
155
161
  end),
@@ -6,7 +6,7 @@ module Fastlane
6
6
 
7
7
  module Helper
8
8
  class GenericHelper
9
- @git_log_path = "fastlane-unity-exporter/logs/#{DateTime.now.strftime('%Y-%m-%d_%H-%M-%S-%L')}_git.log"
9
+ @git_log_path = "BuildExporter/#{DateTime.now.strftime('%Y-%m-%d_%H-%M-%S-%L')}_git.log"
10
10
 
11
11
  def self.shellify(path)
12
12
  if FastlaneCore::Helper.is_mac?
@@ -9,12 +9,12 @@ module Fastlane
9
9
  module Helper
10
10
  class UnityEditorHelper
11
11
  # project path relative if following hierarchy is given: "root/{unity-project}/fastlane-build-exporter/{platform}-export/."
12
- # p File.expand_path("../../")
13
- @project_path_default = "../../"
12
+ # p File.expand_path("../..")
13
+ @project_path_default = "../.."
14
14
  @project_path = ""
15
15
 
16
16
  def self.unity_project_path
17
- project_path = @project_path == "" ? "../../" : @project_path
17
+ project_path = @project_path == "" ? @project_path_default : @project_path
18
18
 
19
19
  # we verify the path to the Unity project by looking for the 'manifest.json' file
20
20
  package_manifest_path = "#{project_path}/Packages/manifest.json"
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module UnityExporter
3
- VERSION = "1.3.2"
3
+ VERSION = "1.4.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-unity_exporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ar:met
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-13 00:00:00.000000000 Z
11
+ date: 2022-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler