u3d 1.2.2 → 1.2.3

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
- SHA256:
3
- metadata.gz: 80cbd75cc31f765c99ad5045c7bc4a4aedef530decb41e694554b8d85ad2ce36
4
- data.tar.gz: acf532a7231f8a75e2287f9c533feb71b4d8370c298f44bb8878041e7be91bec
2
+ SHA1:
3
+ metadata.gz: 9058c36484b4c4ef6bc42c07e6b0669ef89750a1
4
+ data.tar.gz: 26c8bc6675b4becf0bd01cf211754d3ca5b9d4ae
5
5
  SHA512:
6
- metadata.gz: c9fd958b3178ee339b2ed5dba30ffc83b0c03394dd6cab19e5885059bdddd7ec1e91ef33014fde1a1d2b45ef276db38df6a4d42f313111be8bf4322b8dd05ea5
7
- data.tar.gz: de18a2ef437ec324d85906b27e568315e5bf09144308cff7849f27ed14212258a2c10fee9a0a5ae78e3040f5127d200e45ac24e7978fe494fcfb4699824fe3bb
6
+ metadata.gz: e674a5a5dc6a8b33baefc3479ae5873ad18aa7bd55a005cf182a5a68fb7351ab7a09f7e6ae642f10b42c9deb7bfdc574f02ad60df32e30d178c276507ed74bfa
7
+ data.tar.gz: f4a4b91a842e1a90833e8e04b4b01c48c2d61090c9219330d51f33531bebd236a9bac7ddd20e2efbed3f340105fa8840a566434d5be81971b664954e1247dc34
@@ -1,4 +1,4 @@
1
- future-release=v1.2.2
1
+ future-release=v1.2.3
2
2
  since-tag=v0.9
3
3
  exclude_tags_regex=v0\.[0-8]\..*
4
4
  exclude-labels=nochangelog,question
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## [v1.2.3](https://github.com/DragonBox/u3d/tree/v1.2.3) (2020-02-26)
4
+ [Full Changelog](https://github.com/DragonBox/u3d/compare/v1.2.2...v1.2.3)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Allow to refresh the github changelog. Also fix them as we removed empty lines. [\#398](https://github.com/DragonBox/u3d/pull/398) ([lacostej](https://github.com/lacostej))
9
+ - Detect 2019 modules and allow to install 2019, skipping dmg install for now [\#392](https://github.com/DragonBox/u3d/pull/392) ([lacostej](https://github.com/lacostej))
10
+
3
11
  ## [v1.2.2](https://github.com/DragonBox/u3d/tree/v1.2.2) (2020-02-21)
4
12
  [Full Changelog](https://github.com/DragonBox/u3d/compare/v1.2.1...v1.2.2)
5
13
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- u3d (1.2.2)
4
+ u3d (1.2.3)
5
5
  colored (>= 1.2, < 2.0.0)
6
6
  commander (>= 4.4.0, < 5.0.0)
7
7
  file-tail (>= 1.2.0)
@@ -26,7 +26,7 @@ GEM
26
26
  byebug (10.0.2)
27
27
  coderay (1.1.2)
28
28
  colored (1.2)
29
- commander (4.5.0)
29
+ commander (4.4.7)
30
30
  highline (~> 2.0.0)
31
31
  concurrent-ruby (1.0.5)
32
32
  coveralls (0.8.21)
@@ -100,7 +100,7 @@ GEM
100
100
  ruby-progressbar (~> 1.7)
101
101
  unicode-display_width (~> 1.0, >= 1.0.1)
102
102
  ruby-progressbar (1.9.0)
103
- rubyzip (2.2.0)
103
+ rubyzip (2.0.0)
104
104
  sawyer (0.8.1)
105
105
  addressable (>= 2.3.5, < 2.6)
106
106
  faraday (~> 0.8, < 1.0)
data/Rakefile CHANGED
@@ -219,7 +219,7 @@ def parse_changelog
219
219
  buffer = version + "\n\n"
220
220
  else
221
221
  next unless version # skip first lines
222
- buffer += line if line != "\n"
222
+ buffer += line
223
223
  end
224
224
  end
225
225
  releases[version] = buffer
@@ -227,22 +227,25 @@ def parse_changelog
227
227
  end
228
228
 
229
229
  desc 'Create missing Github releases from changelog'
230
- task :create_missing_github_releases do
230
+ task :create_missing_github_releases, [:force] do |_t, args|
231
+ force = args[:force] || false
231
232
  releases = parse_changelog
232
233
 
233
234
  known_releases = `hub release`.split("\n")
234
235
 
235
236
  releases.keys.reverse.each do |version|
236
- if known_releases.include? version
237
+ exist = known_releases.include? version
238
+ if exist && !force
237
239
  puts "Skipping existing version #{version}"
238
240
  next
239
241
  end
242
+ action = exist ? "edit" : "create"
240
243
  changelog = releases[version]
241
- puts "Creating version #{version}"
244
+ puts "About to #{action} version #{version}"
242
245
  require "tempfile"
243
246
  Tempfile.create("githubchangelog") do |changelog_file|
244
247
  File.write(changelog_file, changelog)
245
- command = "hub release create #{version} -F #{changelog_file.path}"
248
+ command = "hub release #{action} #{version} --file #{changelog_file.path}"
246
249
  `#{command}`
247
250
  end
248
251
  end
data/lib/u3d.rb CHANGED
@@ -48,4 +48,15 @@ require 'u3d/unity_versions'
48
48
  module U3d
49
49
  Helper = U3dCore::Helper
50
50
  UI = U3dCore::UI
51
+
52
+ def self.const_missing(const_name)
53
+ deprecated = {
54
+ PlaybackEngineUtils: IvyPlaybackEngineUtils,
55
+ INIParser: INIModulesParser
56
+ }
57
+ super unless deprecated.keys.include? const_name
58
+ replacement = deprecated[const_name]
59
+ UI.deprecated "DEPRECATION WARNING: the class U3d::#{const_name} is deprecated. Use #{replacement} instead."
60
+ replacement
61
+ end
51
62
  end
@@ -342,9 +342,8 @@ module U3d
342
342
  UI.verbose "Version #{version} of Unity is not installed yet"
343
343
  else
344
344
  UI.verbose "Unity #{version} is installed at #{unity.root_path}"
345
- return unity
346
345
  end
347
- nil
346
+ unity
348
347
  end
349
348
 
350
349
  # rubocop:disable Metrics/BlockNesting
@@ -33,7 +33,7 @@ module U3d
33
33
  # Regex to get the name of a localization asset
34
34
  UNITY_LANGUAGE_FILE_REGEX = %r{\/\d+/[0-9\.]+\/([\w-]+)$}
35
35
  # Regex to get the name of a package out of its file name
36
- UNITY_MODULE_FILE_REGEX = %r{\/([\w\-_\.\+]+\.(?:pkg|exe|zip|sh|deb|msi|xz))[^\/]*$}
36
+ UNITY_MODULE_FILE_REGEX = %r{\/([\w\-_\.\+]+\.(?:pkg|dmg|exe|zip|sh|deb|msi|xz))[^\/]*$}
37
37
 
38
38
  class << self
39
39
  def download_directory
@@ -25,30 +25,6 @@ require 'u3d/utils'
25
25
  require 'u3d_core/helper'
26
26
 
27
27
  module U3d
28
- # Backwards compatibility
29
- module INIParser
30
- class << self
31
- def method_missing(method_name, *arguments, &block)
32
- UI.deprecated 'INIParser is obsolete, Use INIModulesParser instead'
33
- if INIModulesParser.respond_to?(method_name)
34
- INIModulesParser.send(method_name, *arguments, &block)
35
- else
36
- super
37
- end
38
- end
39
-
40
- def respond_to?(method_name, include_private = false)
41
- UI.deprecated 'INIParser is obsolete, Use INIModulesParser instead'
42
- INIModulesParser.respond_to?(method_name, include_private)
43
- end
44
-
45
- def respond_to_missing?(method_name, include_private = false)
46
- UI.deprecated 'INIParser is obsolete, Use INIModulesParser instead'
47
- INIModulesParser.respond_to_missing?(method_name, include_private)
48
- end
49
- end
50
- end
51
-
52
28
  # Load and parse INI files
53
29
  module INIModulesParser
54
30
  #####################################################
@@ -105,7 +105,7 @@ module U3d
105
105
  end
106
106
  end
107
107
 
108
- class PlaybackEngineUtils
108
+ class IvyPlaybackEngineUtils
109
109
  def self.list_module_configs(playbackengine_parent_path)
110
110
  Dir.glob("#{playbackengine_parent_path}/PlaybackEngines/*/ivy.xml")
111
111
  end
@@ -127,6 +127,32 @@ module U3d
127
127
  end
128
128
  end
129
129
 
130
+ class ModulePlaybackEngineUtils
131
+ def self.list_module_configs(playbackengine_parent_path)
132
+ # this should work on all platforms, non existing paths being ignored...
133
+ Dir.glob("#{playbackengine_parent_path}/PlaybackEngines/*/modules.asset") |
134
+ Dir.glob("#{playbackengine_parent_path}/Unity.app/Contents/PlaybackEngines/*/modules.asset")
135
+ end
136
+
137
+ def self.module_name(config_path)
138
+ File.basename(File.dirname(config_path)).gsub("Support", "")
139
+ end
140
+ end
141
+
142
+ class InstallationUtils
143
+ def self.read_version_from_unity_builtin_extra(file)
144
+ File.open(file, "rb") do |f|
145
+ f.seek(20)
146
+ s = ""
147
+ while (c = f.read(1))
148
+ break if c == "\x00"
149
+ s += c
150
+ end
151
+ s
152
+ end
153
+ end
154
+ end
155
+
130
156
  class MacInstallation < Installation
131
157
  require 'plist'
132
158
 
@@ -154,9 +180,13 @@ module U3d
154
180
 
155
181
  def packages
156
182
  pack = []
157
- PlaybackEngineUtils.list_module_configs(root_path).each do |mpath|
158
- pack << PlaybackEngineUtils.module_name(mpath)
183
+ IvyPlaybackEngineUtils.list_module_configs(root_path).each do |mpath|
184
+ pack << IvyPlaybackEngineUtils.module_name(mpath)
185
+ end
186
+ ModulePlaybackEngineUtils.list_module_configs(root_path).each do |mpath|
187
+ pack << ModulePlaybackEngineUtils.module_name(mpath)
159
188
  end
189
+
160
190
  NOT_PLAYBACKENGINE_PACKAGES.each do |module_name|
161
191
  pack << module_name unless Dir[module_name_pattern(module_name)].empty?
162
192
  end
@@ -236,15 +266,8 @@ module U3d
236
266
 
237
267
  class LinuxInstallation < Installation
238
268
  def version
239
- # I don't find an easy way to extract the version on Linux
240
- path = "#{root_path}/Editor/Data/"
241
- package = PlaybackEngineUtils.list_module_configs(path).first
242
- raise "Couldn't find a module under #{path}" unless package
243
- version = PlaybackEngineUtils.unity_version(package)
244
- if (m = version.match(/^(.*)x(.*)Linux$/))
245
- version = "#{m[1]}#{m[2]}"
246
- end
247
- version
269
+ path = "#{root_path}/Editor/Data/Resources/unity_builtin_extra"
270
+ InstallationUtils.read_version_from_unity_builtin_extra(path)
248
271
  end
249
272
 
250
273
  def build_number
@@ -267,8 +290,11 @@ module U3d
267
290
  def packages
268
291
  path = "#{root_path}/Editor/Data/"
269
292
  pack = []
270
- PlaybackEngineUtils.list_module_configs(path).each do |mpath|
271
- pack << PlaybackEngineUtils.module_name(mpath)
293
+ IvyPlaybackEngineUtils.list_module_configs(path).each do |mpath|
294
+ pack << IvyPlaybackEngineUtils.module_name(mpath)
295
+ end
296
+ ModulePlaybackEngineUtils.list_module_configs(root_path).each do |mpath|
297
+ pack << ModulePlaybackEngineUtils.module_name(mpath)
272
298
  end
273
299
  NOT_PLAYBACKENGINE_PACKAGES.each do |module_name|
274
300
  pack << module_name unless Dir[module_name_pattern(module_name)].empty?
@@ -368,9 +394,9 @@ module U3d
368
394
  return version unless version.nil?
369
395
 
370
396
  path = "#{root_path}/Editor/Data/"
371
- package = PlaybackEngineUtils.list_module_configs(path).first
397
+ package = IvyPlaybackEngineUtils.list_module_configs(path).first
372
398
  raise "Couldn't find a module under #{path}" unless package
373
- PlaybackEngineUtils.unity_version(package)
399
+ IvyPlaybackEngineUtils.unity_version(package)
374
400
  end
375
401
 
376
402
  def build_number
@@ -403,8 +429,11 @@ module U3d
403
429
  def packages
404
430
  path = "#{root_path}/Editor/Data/"
405
431
  pack = []
406
- PlaybackEngineUtils.list_module_configs(path).each do |mpath|
407
- pack << PlaybackEngineUtils.module_name(mpath)
432
+ IvyPlaybackEngineUtils.list_module_configs(path).each do |mpath|
433
+ pack << IvyPlaybackEngineUtils.module_name(mpath)
434
+ end
435
+ ModulePlaybackEngineUtils.list_module_configs(root_path).each do |mpath|
436
+ pack << ModulePlaybackEngineUtils.module_name(mpath)
408
437
  end
409
438
  NOT_PLAYBACKENGINE_PACKAGES.each do |module_name|
410
439
  pack << module_name unless Dir[module_name_pattern(module_name)].empty?
@@ -191,12 +191,14 @@ module U3d
191
191
  def install(file_path, version, installation_path: nil, info: nil)
192
192
  # rubocop:enable UnusedMethodArgument
193
193
  extension = File.extname(file_path)
194
- raise "Installation of #{extension} files is not supported on Mac" unless %w[.zip .po .pkg].include? extension
194
+ raise "Installation of #{extension} files is not supported on Mac" unless %w[.zip .po .pkg .dmg].include? extension
195
195
  path = installation_path || DEFAULT_MAC_INSTALL
196
196
  if extension == '.po'
197
197
  install_po(file_path, version, info: info)
198
198
  elsif extension == '.zip'
199
199
  install_zip(file_path, version, info: info)
200
+ elsif extension == '.dmg'
201
+ UI.important "Skipping installation of #{file_path} for now"
200
202
  else
201
203
  install_pkg(file_path, version: version, target_path: path)
202
204
  end
@@ -21,7 +21,7 @@
21
21
  ## --- END LICENSE BLOCK ---
22
22
 
23
23
  module U3d
24
- VERSION = '1.2.2'.freeze
24
+ VERSION = '1.2.3'.freeze
25
25
  DESCRIPTION = 'Provides numerous tools for installing, managing and running the Unity game engine from command line.'.freeze
26
26
  UNITY_VERSIONS_NOTE = "Unity uses the following version formatting: 0.0.0x0. The \'x\' can takes different values:\n"\
27
27
  "\t. 'f' are the main release candidates for Unity\n"\
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: u3d
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerome Lacoste
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-02-21 00:00:00.000000000 Z
12
+ date: 2020-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colored
@@ -452,7 +452,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
452
452
  - !ruby/object:Gem::Version
453
453
  version: '0'
454
454
  requirements: []
455
- rubygems_version: 3.1.2
455
+ rubyforge_project:
456
+ rubygems_version: 2.6.14
456
457
  signing_key:
457
458
  specification_version: 4
458
459
  summary: U3d