u3d 0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.licenses.json +19 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +43 -0
  6. data/Gemfile +5 -0
  7. data/Gemfile.lock +98 -0
  8. data/LICENSE +21 -0
  9. data/LICENSE.fastlane +22 -0
  10. data/LOG_RULES.md +170 -0
  11. data/README.md +72 -0
  12. data/Rakefile +28 -0
  13. data/TODO.md +15 -0
  14. data/build.sh +5 -0
  15. data/config/log_rules.json +230 -0
  16. data/examples/Example1/.gitignore +19 -0
  17. data/examples/Example1/Assets/Editor.meta +9 -0
  18. data/examples/Example1/Assets/Editor/EditorRun.cs +23 -0
  19. data/examples/Example1/Assets/Editor/EditorRun.cs.meta +12 -0
  20. data/examples/Example1/Assets/Editor/FileSystemUtil.cs +26 -0
  21. data/examples/Example1/Assets/Editor/FileSystemUtil.cs.meta +12 -0
  22. data/examples/Example1/Assets/Scene1.unity +264 -0
  23. data/examples/Example1/Assets/Scene1.unity.meta +8 -0
  24. data/examples/Example1/Gemfile +8 -0
  25. data/examples/Example1/Gemfile.lock +165 -0
  26. data/examples/Example1/ProjectSettings/AudioManager.asset +16 -0
  27. data/examples/Example1/ProjectSettings/ClusterInputManager.asset +6 -0
  28. data/examples/Example1/ProjectSettings/DynamicsManager.asset +18 -0
  29. data/examples/Example1/ProjectSettings/EditorBuildSettings.asset +7 -0
  30. data/examples/Example1/ProjectSettings/EditorSettings.asset +14 -0
  31. data/examples/Example1/ProjectSettings/GraphicsSettings.asset +61 -0
  32. data/examples/Example1/ProjectSettings/InputManager.asset +295 -0
  33. data/examples/Example1/ProjectSettings/NavMeshAreas.asset +89 -0
  34. data/examples/Example1/ProjectSettings/NetworkManager.asset +8 -0
  35. data/examples/Example1/ProjectSettings/Physics2DSettings.asset +35 -0
  36. data/examples/Example1/ProjectSettings/ProjectSettings.asset +591 -0
  37. data/examples/Example1/ProjectSettings/ProjectVersion.txt +1 -0
  38. data/examples/Example1/ProjectSettings/QualitySettings.asset +180 -0
  39. data/examples/Example1/ProjectSettings/TagManager.asset +43 -0
  40. data/examples/Example1/ProjectSettings/TimeManager.asset +9 -0
  41. data/examples/Example1/ProjectSettings/UnityConnectSettings.asset +32 -0
  42. data/examples/Example1/README.md +5 -0
  43. data/examples/Example1/Rakefile +5 -0
  44. data/examples/Example1/fastlane/Fastfile +4 -0
  45. data/examples/Example1/fastlane/Pluginfile +1 -0
  46. data/examples/Example1/run.sh +1 -0
  47. data/examples/Example2/.gitignore +20 -0
  48. data/examples/Example2/Assets/Editor.meta +9 -0
  49. data/examples/Example2/Assets/Editor/EditorRun.cs +33 -0
  50. data/examples/Example2/Assets/Editor/EditorRun.cs.meta +12 -0
  51. data/examples/Example2/Assets/Editor/PostprocessBuildPlayer.cs +92 -0
  52. data/examples/Example2/Assets/Editor/PostprocessBuildPlayer.cs.meta +8 -0
  53. data/examples/Example2/Assets/Editor/PostprocessBuildPlayer_log.sh +31 -0
  54. data/examples/Example2/Assets/Editor/PostprocessBuildPlayer_log.sh.meta +8 -0
  55. data/examples/Example2/Assets/Editor/SimpleBuildSetup.cs +20 -0
  56. data/examples/Example2/Assets/Editor/SimpleBuildSetup.cs.meta +12 -0
  57. data/examples/Example2/Assets/Scene.unity +278 -0
  58. data/examples/Example2/Assets/Scene.unity.meta +8 -0
  59. data/examples/Example2/Gemfile +8 -0
  60. data/examples/Example2/Gemfile.lock +165 -0
  61. data/examples/Example2/ProjectSettings/AudioManager.asset +17 -0
  62. data/examples/Example2/ProjectSettings/ClusterInputManager.asset +6 -0
  63. data/examples/Example2/ProjectSettings/DynamicsManager.asset +19 -0
  64. data/examples/Example2/ProjectSettings/EditorBuildSettings.asset +10 -0
  65. data/examples/Example2/ProjectSettings/EditorSettings.asset +14 -0
  66. data/examples/Example2/ProjectSettings/GraphicsSettings.asset +63 -0
  67. data/examples/Example2/ProjectSettings/InputManager.asset +295 -0
  68. data/examples/Example2/ProjectSettings/NavMeshAreas.asset +89 -0
  69. data/examples/Example2/ProjectSettings/NetworkManager.asset +8 -0
  70. data/examples/Example2/ProjectSettings/Physics2DSettings.asset +36 -0
  71. data/examples/Example2/ProjectSettings/ProjectSettings.asset +591 -0
  72. data/examples/Example2/ProjectSettings/ProjectVersion.txt +1 -0
  73. data/examples/Example2/ProjectSettings/QualitySettings.asset +193 -0
  74. data/examples/Example2/ProjectSettings/TagManager.asset +43 -0
  75. data/examples/Example2/ProjectSettings/TimeManager.asset +9 -0
  76. data/examples/Example2/ProjectSettings/UnityConnectSettings.asset +34 -0
  77. data/examples/Example2/README.md +10 -0
  78. data/examples/Example2/fastlane/Fastfile +4 -0
  79. data/examples/Example2/fastlane/Pluginfile +1 -0
  80. data/exe/u3d +7 -0
  81. data/fastlane-plugin-u3d/.gitignore +10 -0
  82. data/fastlane-plugin-u3d/.licenses.json +9 -0
  83. data/fastlane-plugin-u3d/.rspec +3 -0
  84. data/fastlane-plugin-u3d/.rubocop.yml +253 -0
  85. data/fastlane-plugin-u3d/.travis.yml +4 -0
  86. data/fastlane-plugin-u3d/Gemfile +6 -0
  87. data/fastlane-plugin-u3d/LICENSE +21 -0
  88. data/fastlane-plugin-u3d/README.md +52 -0
  89. data/fastlane-plugin-u3d/Rakefile +9 -0
  90. data/fastlane-plugin-u3d/circle.yml +9 -0
  91. data/fastlane-plugin-u3d/fastlane-plugin-u3d.gemspec +31 -0
  92. data/fastlane-plugin-u3d/fastlane/Fastfile +3 -0
  93. data/fastlane-plugin-u3d/fastlane/Pluginfile +1 -0
  94. data/fastlane-plugin-u3d/lib/fastlane/plugin/u3d.rb +38 -0
  95. data/fastlane-plugin-u3d/lib/fastlane/plugin/u3d/actions/u3d_action.rb +80 -0
  96. data/fastlane-plugin-u3d/lib/fastlane/plugin/u3d/helper/u3d_helper.rb +34 -0
  97. data/fastlane-plugin-u3d/lib/fastlane/plugin/u3d/version.rb +27 -0
  98. data/fastlane-plugin-u3d/spec/spec_helper.rb +32 -0
  99. data/lib/u3d.rb +33 -0
  100. data/lib/u3d/cache.rb +120 -0
  101. data/lib/u3d/commands.rb +307 -0
  102. data/lib/u3d/commands_generator.rb +163 -0
  103. data/lib/u3d/downloader.rb +363 -0
  104. data/lib/u3d/iniparser.rb +83 -0
  105. data/lib/u3d/installer.rb +445 -0
  106. data/lib/u3d/log_analyzer.rb +221 -0
  107. data/lib/u3d/unity_version_number.rb +71 -0
  108. data/lib/u3d/unity_versions.rb +207 -0
  109. data/lib/u3d/utils.rb +121 -0
  110. data/lib/u3d/version.rb +31 -0
  111. data/lib/u3d_core.rb +30 -0
  112. data/lib/u3d_core/command_executor.rb +134 -0
  113. data/lib/u3d_core/command_runner.rb +93 -0
  114. data/lib/u3d_core/credentials.rb +116 -0
  115. data/lib/u3d_core/globals.rb +84 -0
  116. data/lib/u3d_core/helper.rb +149 -0
  117. data/lib/u3d_core/ui/disable_colors.rb +40 -0
  118. data/lib/u3d_core/ui/implementations/shell.rb +157 -0
  119. data/lib/u3d_core/ui/interface.rb +182 -0
  120. data/lib/u3d_core/ui/ui.rb +49 -0
  121. data/local_gem_install.sh +6 -0
  122. data/scripts/be +14 -0
  123. data/u3d.gemspec +41 -0
  124. metadata +388 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9ce28b96ca380357d267e20c4e6d5543bc7153cb
4
+ data.tar.gz: ce303b2b7406098130e359602a8a68970149fd67
5
+ SHA512:
6
+ metadata.gz: 346aeb6ded1b7c6f2bf24cdd99b16110a837984317209a9780b3c0a1521c061108097558d1d9ec9f497ebded3b2ceb58f9122dee2ab12310aef6642f30d087a4
7
+ data.tar.gz: f6dc8b3879d146592e595fe8ee13850e3a78d6a46fdcc8bf847a1e66891ea93d4f8d57561e4addad99e79e4437824a1fb171d09aa911308ffa2627443d511eb7
@@ -0,0 +1,2 @@
1
+ pkg/
2
+ coverage/
@@ -0,0 +1,19 @@
1
+ [
2
+ {
3
+ "license": "LICENSE.fastlane",
4
+ "paths": [
5
+ "lib/u3d_core/ui/{disable_colors,interface,ui}.rb",
6
+ "lib/u3d_core/ui/implementations/shell.rb",
7
+ "lib/u3d_core/{command_executor,command_runner,credentials,globals,helper}.rb",
8
+ "spec/u3d_core/command_executor_spec.rb"
9
+ ]
10
+ },
11
+ {
12
+ "license": "LICENSE",
13
+ "paths": [
14
+ "{lib,spec}/**/*.rb",
15
+ "Rakefile"
16
+ ]
17
+ }
18
+ ]
19
+
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color --require spec_helper --format d
@@ -0,0 +1,43 @@
1
+ #
2
+ # File.chmod(0777, f)
3
+ #
4
+ # is easier to read than
5
+ #
6
+ # File.chmod(0o777, f)
7
+ #
8
+ AllCops:
9
+ #Include:
10
+ # - '**/fastlane/Fastfile'
11
+ Exclude:
12
+ - './fastlane-plugin-u3d/**/*'
13
+
14
+
15
+ Style/NumericLiteralPrefix:
16
+ Enabled: false
17
+
18
+ Style/StringLiterals:
19
+ Enabled: false # we're not there yet
20
+
21
+ Metrics/AbcSize:
22
+ Enabled: false
23
+
24
+ Metrics/BlockLength:
25
+ Enabled: false
26
+
27
+ Metrics/CyclomaticComplexity:
28
+ Enabled: false
29
+
30
+ Metrics/MethodLength:
31
+ Enabled: false
32
+
33
+ # Configuration parameters: AllowURI, URISchemes.
34
+ Metrics/LineLength:
35
+ Max: 370
36
+
37
+ # We're not there yet
38
+ Style/Documentation:
39
+ Enabled: false
40
+
41
+ # Better too much 'return' than one missing
42
+ Style/RedundantReturn:
43
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ source "https://rubygems.org"
3
+
4
+ gemspec
5
+ # gem "rails"
@@ -0,0 +1,98 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ u3d (0.9)
5
+ colored (>= 1.2, < 2.0.0)
6
+ commander (>= 4.4.0, < 5.0.0)
7
+ file-tail (>= 1.2.0)
8
+ filesize (>= 0.1.1)
9
+ inifile (>= 3.0.0, < 4.0.0)
10
+ plist (>= 3.1.0, < 4.0.0)
11
+ security (= 0.1.3)
12
+
13
+ GEM
14
+ remote: https://rubygems.org/
15
+ specs:
16
+ ast (2.3.0)
17
+ builder (3.2.3)
18
+ coderay (1.1.1)
19
+ colored (1.2)
20
+ commander (4.4.3)
21
+ highline (~> 1.7.2)
22
+ coveralls (0.8.21)
23
+ json (>= 1.8, < 3)
24
+ simplecov (~> 0.14.1)
25
+ term-ansicolor (~> 1.3)
26
+ thor (~> 0.19.4)
27
+ tins (~> 1.6)
28
+ diff-lcs (1.3)
29
+ docile (1.1.5)
30
+ file-tail (1.2.0)
31
+ tins (~> 1.0)
32
+ filesize (0.1.1)
33
+ highline (1.7.8)
34
+ inifile (3.0.0)
35
+ json (2.1.0)
36
+ method_source (0.8.2)
37
+ parser (2.4.0.0)
38
+ ast (~> 2.2)
39
+ plist (3.3.0)
40
+ powerpack (0.1.1)
41
+ pry (0.10.4)
42
+ coderay (~> 1.1.0)
43
+ method_source (~> 0.8.1)
44
+ slop (~> 3.4)
45
+ rainbow (2.2.2)
46
+ rake
47
+ rake (10.5.0)
48
+ rspec (3.1.0)
49
+ rspec-core (~> 3.1.0)
50
+ rspec-expectations (~> 3.1.0)
51
+ rspec-mocks (~> 3.1.0)
52
+ rspec-core (3.1.7)
53
+ rspec-support (~> 3.1.0)
54
+ rspec-expectations (3.1.2)
55
+ diff-lcs (>= 1.2.0, < 2.0)
56
+ rspec-support (~> 3.1.0)
57
+ rspec-mocks (3.1.3)
58
+ rspec-support (~> 3.1.0)
59
+ rspec-support (3.1.2)
60
+ rspec_junit_formatter (0.2.3)
61
+ builder (< 4)
62
+ rspec-core (>= 2, < 4, != 2.12.0)
63
+ rubocop (0.44.1)
64
+ parser (>= 2.3.1.1, < 3.0)
65
+ powerpack (~> 0.1)
66
+ rainbow (>= 1.99.1, < 3.0)
67
+ ruby-progressbar (~> 1.7)
68
+ unicode-display_width (~> 1.0, >= 1.0.1)
69
+ ruby-progressbar (1.8.1)
70
+ security (0.1.3)
71
+ simplecov (0.14.1)
72
+ docile (~> 1.1.0)
73
+ json (>= 1.8, < 3)
74
+ simplecov-html (~> 0.10.0)
75
+ simplecov-html (0.10.1)
76
+ slop (3.6.0)
77
+ term-ansicolor (1.6.0)
78
+ tins (~> 1.0)
79
+ thor (0.19.4)
80
+ tins (1.15.0)
81
+ unicode-display_width (1.3.0)
82
+
83
+ PLATFORMS
84
+ ruby
85
+ x86-mingw32
86
+
87
+ DEPENDENCIES
88
+ bundler (~> 1.13)
89
+ coveralls
90
+ pry
91
+ rake (~> 10.0)
92
+ rspec (~> 3.1.0)
93
+ rspec_junit_formatter (~> 0.2.3)
94
+ rubocop (~> 0.44.0)
95
+ u3d!
96
+
97
+ BUNDLED WITH
98
+ 1.15.2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016-present WeWantToKnow AS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Original work Copyright (c) 2015-present the fastlane authors
4
+ Modified work Copyright 2016-present WeWantToKnow AS
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,170 @@
1
+ # Log Analyzer rules
2
+
3
+ The Log Prettifier processes both Unity output and existing log files thanks to a set of JSON rules. These rules are under ./config/log_rules.json. They are meant to be customizable to fit as best as possible your logging specifications.
4
+
5
+ This document explains how to customize the ruleset.
6
+
7
+ ## I - Foreword
8
+
9
+ ### A - Log Prettifying Philosophy
10
+
11
+ The main thing to understand behind our rule system is that it is based on a whitelist approach: anything coming in the analyzer will be ignored unless it matches a rule, in which case it will be processed accordingly.
12
+
13
+ The reason behind this approach is that Unity generates a lot of unwanted noise that would have been complicated to filter out. By filtering in, only relevant and/or expected information will be logged, allowing for a much clearer output, and better understanding of what is happening during Unity's runtime.
14
+
15
+ ### B - Patterns
16
+
17
+ The log analyzer relies heavily on 'patterns' to follow the Unity output and extract information. These patterns are regular expressions which will be used to parse the returned lines. They are declared as regular `string` in the rules file, but are parsed to standard Ruby Regexp later on, and therefore follow their syntax.
18
+
19
+ For more information on how to use patterns, please refer to [Ruby's Regexp Documentation](https://ruby-doc.org/core-2.3.1/Regexp.html).
20
+
21
+ ## II - Phases
22
+
23
+ ### A - Phased behaviour of the prettifier
24
+
25
+ As Unity usually goes through different phases during running, compilation or whichever action you want it to perform, the information (and its processing) that it will output will most likely be dependent on the action being performed.
26
+ Therefore, our log prettifier behaves in a phased fashion. It has an inner memory keeping track of the active 'phase' Unity is going through, the ruleset it applies depends on it.
27
+
28
+ A phase is started when a given pattern is encountered in the logs, and ends in two different ways: either a terminating pattern is met, or another phase starts.
29
+
30
+ Because there are rules that you may want to apply throughout the whole analysis, there is a peculiar phase: the 'GENERAL' one. It contains a generic set of rules which will be applied in parallel to the active phase's ruleset, and allows for not having to repeat rules in different phases. The main use which this phase was designed for is to catch exceptions, warnings and errors no matter the active phase, but it is obviously not limited to that.
31
+
32
+ ### B - Phase syntax
33
+
34
+ The syntax of phases is as follows:
35
+
36
+ ```json
37
+ "PHASE_NAME": {
38
+ "active": true,
39
+ "silent": false,
40
+ "comment": "This is an optional comment for clarity purpose",
41
+ "phase_start_pattern": "This pattern ends the phase",
42
+ "phase_end_pattern": "This pattern ends the phase",
43
+ "rules": {
44
+ "rule_1": {},
45
+ "rule_2": {}
46
+ }
47
+ }
48
+ ```
49
+ * `active`: controls whether or not the phase should be active. If the phase is not active the analyzer will never try to start it, nor applying its rules.
50
+ * __[OPTIONAL]__ `silent`: the phase will start and end normally, it will nonetheless never try to apply its rules, resulting in the phase being logically present, even though silent. More or less an alternative to toggling off every rule in its ruleset.
51
+ * __[OPTIONAL]__ `comment`: short description of the phase. This section is only for readability purpose and will be ignored during parsing as it does not contain logic.
52
+ * `phase_start_pattern`: this is a mandatory pattern that controls the condition under which the phase will start.
53
+ * __[OPTIONAL]__ `phase_end_pattern`: this patterns specifies when the phase should end. It is optional because a phase will also end when another one begins, as stated in II A. This is used when you know exactly when the phase has finished.
54
+ * `rules`: contains a set of rules. See III for further information on rule declaration.
55
+
56
+ ## Rules
57
+
58
+ ### A - Rule declaration
59
+
60
+ The information contained in Unity's log can be formatted differently: it can be contained in a single line, spread on several, the lines can contain exactly what you want or be way too verbose for your liking.
61
+
62
+ In consequence, the rule syntax is pretty loose to cover as many cases as possible, and below is describe syntax for some of archetypal rules.
63
+
64
+ They contain nonetheless two mandatory sections and a recurring one:
65
+
66
+ ```json
67
+ "rule_name": {
68
+ "active": true,
69
+ "start_pattern": "This pattern will start the rule"
70
+ }
71
+ ```
72
+ Similarly to phases, `active` will control whether or not the rule should be applied, and the `start_pattern` will trigger the rule.
73
+
74
+ ### B - One line parsing
75
+
76
+ The most basic rule is when you want to extract a single line without having to do any processing on it. Here is an example:
77
+
78
+ ```json
79
+ "asset_DB_loading": {
80
+ "active": true,
81
+ "start_pattern": "Loading Asset Database ?... {,2}\\d+\\.?\\d*"
82
+ }
83
+ ```
84
+ This example rule extracts the line stating whether the asset database has successfully loaded, and the time and logs it as is.
85
+
86
+ ### C - One line parsing with data extraction
87
+
88
+ When the line formatting does not suit your needs, you may want to process it rather than simply logging it. Here is an example which occurs at the beginning of the compile phase:
89
+ ```json
90
+ "target": {
91
+ "active": true,
92
+ "start_pattern": "- starting compile (?<path>.+), for buildtarget (?<target>.+)",
93
+ "start_message": "Target: %{path} (buildtarget %{target})"
94
+ }
95
+ ```
96
+ Simple rewording of the base log, by extracting the meaningful information and putting it back where it was needed.
97
+
98
+ ### D - Multi-line parsing and displaying
99
+
100
+ The following rule illustrates when you want to log a chunk of lines as they appear in Unity at the same time. This structure is useful when you know exactly where the block begins and end. If not, please check section F.
101
+ ```json
102
+ "percentage": {
103
+ "active": true,
104
+ "start_pattern": "Textures\\s+\\d+\\.?\\d* .b\\s+\\d{1,3}\\.?\\d*%",
105
+ "end_pattern": "Complete size\\s+\\d+\\.?\\d* .b\\s+\\d{1,3}\\.?\\d*%",
106
+ "store_lines": true
107
+ }
108
+ ```
109
+ `start_pattern` and `end_pattern` are the limits in between which the lines will be parsed. `store_lines` indicates that we want these lines stored, and displayed later.
110
+
111
+ ### E - Multi-line parsing and displaying with line filtering and data extraction
112
+
113
+ This example illustrates several additional functionalities in comparison to the previous sections.
114
+ ```json
115
+ "fail": {
116
+ "active": true,
117
+ "start_pattern": "^(?<fail>Failed to .+)\\n",
118
+ "end_pattern": "Filename: (?:[\\w/:]+/(?<file>\\w+\\.\\w+))? Line: (?<line>-?\\d+)",
119
+ "start_message": false,
120
+ "end_message": "%{file}(line %{line}): %{fail}",
121
+ "store_lines": true,
122
+ "ignore_lines": [
123
+ "UnityEditor",
124
+ "UnityEngine",
125
+ "^\\n"
126
+ ]
127
+ }
128
+ ```
129
+ * `start_message` set to `false` allows for silent rule start. It will start to parse the log, without logging neither the original line nor a reworded version of it. Useful here not to log twice the information. It is not the case here, but this can be applied to the `end_message` in the same fashion to allow for a silent rule ending.
130
+ * `ignore_lines` must be used alongside `store_lines` set to `true`. It will filter the lines so that unwanted lines are not logged. This is really useful here in the case of a fail to log only your applicative stack and not the Unity message logging one, by making the fail message cleaner.
131
+ * This example illustrates also that you can extract data on the first line and use it upon rule termination. The rule has a 'context' which keeps track of extracted data.
132
+
133
+ _Note_: this is a modified version of the actual rule, for example purposes.
134
+
135
+ ### F - Multi-line with no clear entry point (memory fetching)
136
+
137
+ This section illustrates how a rule will fetch lines from the previously logged lines. It is used when you want to log several lines, but the fixed point is not at the beginning of the block.
138
+ ```json
139
+ "log": {
140
+ "active": true,
141
+ "start_pattern": "UnityEngine\\.Debug:Log\\(Object\\)",
142
+ "fetch_first_line_not_matching": [
143
+ "UnityEngine\\.",
144
+ "^\\n"
145
+ ],
146
+ "fetched_line_pattern": "(?<message>.*)\\n",
147
+ "fetched_line_message": false,
148
+ "start_message": false,
149
+ "end_pattern": "Filename: (?:[\\w/:]+/(?<file>\\w+\\.\\w+))? Line: (?<line>-?\\d+)",
150
+ "end_message": "[LOG] %{file}(line %{line}): %{message}"
151
+ }
152
+ ```
153
+ The key feature here is the `fetch_first_line_not_matching` pattern. The last lines will be fetched from memory, from the most recent to the oldest, and the first one not matching the specified patterns will be fetched. The `fetched_line_pattern` then extracts data from the fetched line.
154
+
155
+ This previous rule is used to keep tracks of the Debug.Log messages. Because they log the messages first and you probably don't know it or don't want to create a specific rule for every single message, backtracking is necessary. As the full stack isn't necessary either, the `store_lines` is absent (default is `false`) so the full stack is not displayed.
156
+
157
+ ### G - Logging color code
158
+
159
+ You can specify the color of the message created by your rules by specifying a type:
160
+ ```json
161
+ "target": {
162
+ "active": true,
163
+ "type": "warning"
164
+ }
165
+ ```
166
+ It will output it differently based on this type. Correct types are:
167
+ * __[DEFAULT]__ `message`: normal logging
168
+ * `warning`: yellow
169
+ * `error`: red
170
+ * `success`: green
@@ -0,0 +1,72 @@
1
+ # U3D
2
+
3
+ U3d is a set of tools to interact with Unity3D from command line. It is available on Linux, Macintosh and Windows.
4
+
5
+ ## What can it do?
6
+
7
+ U3d provides help for running and installing unity from CLI. Available commands are:
8
+
9
+ * `u3d available`: List versions available to download
10
+
11
+ * `u3d install`: Download (and install) Unity
12
+
13
+ * `u3d list`: List installed versions
14
+
15
+ * `u3d local_install`: Install already downloaded packages
16
+
17
+ * `u3d run`: Run Unity
18
+
19
+ ## Installation
20
+
21
+ The gem isn't yet on a public repository, so do
22
+ ```shell
23
+ ./local_gem_install.sh
24
+ ```
25
+ ## Security
26
+
27
+ When you install Unity with this tool, you will have to grant it higher privileges so it can perfrom the installation. It means that under MacOS and Linux, you will be asked for your sudo password.
28
+
29
+ On Windows, you must launch a administrative command interface to be able to run `local_install` and `install` (only if you install for the latter).
30
+
31
+ ## Examples
32
+
33
+ * List installed versions on your computer:
34
+
35
+ ```shell
36
+ u3d list
37
+ ```
38
+
39
+ * List versions you can download and install from Unity, as well as their packages, on Mac:
40
+
41
+ ```shell
42
+ u3d available -p -o mac
43
+ ```
44
+
45
+ * Download and install version 5.6.0f3 of Unity with its documentation and the WebPlayer package:
46
+
47
+ ```shell
48
+ u3d install 5.6.0f3 -p Unity,Documentation,WebPlayer
49
+ ```
50
+ * Run a CLI on the current project given the configured unity version:
51
+
52
+ ```shell
53
+ u3d run -- -batchmode -quit -logFile `pwd`/editor.log -executeMethod "WWTK.SimpleBuild.PerformAndroidBuild"
54
+ ```
55
+
56
+ You can get further information on how to use U3d by running `u3d --help` (or `u3d -h`).
57
+
58
+ ## SSL Error
59
+
60
+ If you face an issue similar to this one
61
+
62
+ SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
63
+
64
+ your ruby setup to work with OpenSSL may want to be fixed.
65
+
66
+ * __On MacOS:__
67
+
68
+ Your version of OpenSSL may be be outdated, make sure you are using the last one.
69
+
70
+ * __On Windows:__
71
+
72
+ A fix to the issue stated above has been found on [StackOverflow](http://stackoverflow.com/questions/5720484/how-to-solve-certificate-verify-failed-on-windows). If you follow the steps described in this topic, you will most likely get rid of this issue.