Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

u3d/installer: Enable the download/installation of modules from Unity Hub #375

Merged
merged 33 commits into from
Nov 15, 2019

Conversation

niezbop
Copy link
Member

@niezbop niezbop commented Nov 8, 2019

Pull Request Checklist

  • My pull request has been rebased on master
  • I ran bundle exec rspec to make sure that my PR didn't break any test
  • I ran bundle exec rubocop to make sure that my PR is inline with our code style
  • I have read the code of conduct

Pull Request Description

Some new modules available through the Unity Hub are not accessible through the previous .ini standard.

This PR standardizes the concept of module by introducing the UnityModule class, which can be generated from INIModulesParser (previously INIparser) or HubModulesParser. This is a rather large PR since this concept was quite widely spread across the application.

Fixes #359 by making the SKD/NDK packages accessible

@niezbop niezbop requested a review from lacostej November 8, 2019 13:30
@niezbop niezbop self-assigned this Nov 8, 2019
@niezbop
Copy link
Member Author

niezbop commented Nov 8, 2019

Still WIP, the specs are broken since the mocking is haywire. Plus some additional specs are needed

Copy link
Member

@lacostej lacostej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup + new feature.

UI.verbose "Loading modules for several versions: #{version}"
load_versions_modules(version, cached_versions, os, offline)
else
UI.verbose "Loading modules for version #{version}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we reuse the same load_versions_modules method and pass [version] to reduce code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would change the interface though.

load_version_module returns an array of modules, while load_versions_module returns an hash of version, array of modules.
Maybe we want to clean that up though.

lib/u3d/unity_module.rb Outdated Show resolved Hide resolved
lib/u3d/unity_versions.rb Outdated Show resolved Hide resolved
lib/u3d/unity_module.rb Show resolved Hide resolved
lib/u3d/unity_module.rb Show resolved Hide resolved
@niezbop niezbop force-pushed the feature/installer/sdk_ndk branch 2 times, most recently from d774ba4 to 002e2a3 Compare November 12, 2019 12:33
@niezbop niezbop changed the title [WIP] u3d/installer: Enable the download/installation of modules from Unity Hub u3d/installer: Enable the download/installation of modules from Unity Hub Nov 12, 2019
Copy link
Member

@lacostej lacostej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very close to merge to me.

lib/u3d/unity_module.rb Outdated Show resolved Hide resolved
lib/u3d/installer.rb Show resolved Hide resolved
lib/u3d/installer.rb Show resolved Hide resolved
lib/u3d/installer.rb Show resolved Hide resolved
lib/u3d/unity_module.rb Outdated Show resolved Hide resolved
lib/u3d/utils.rb Outdated Show resolved Hide resolved
@niezbop niezbop force-pushed the feature/installer/sdk_ndk branch 2 times, most recently from f3f8ab8 to 2b698d3 Compare November 13, 2019 14:40
end
end

def detect_installed_packages(packages, unity)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These methods could be moved inside the Unity Installation class

lib/u3d/utils.rb Outdated Show resolved Hide resolved
def [](key)
return nil unless @ini
@ini[key]
def ini
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@lacostej lacostej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document and test the chmod change then OK for me!

@lacostej
Copy link
Member

Great that you kept the backward compatibility as much as possible. 💯 👍

lib/u3d/utils.rb Outdated Show resolved Hide resolved
@niezbop niezbop merged commit 972ce18 into DragonBox:master Nov 15, 2019
@niezbop niezbop deleted the feature/installer/sdk_ndk branch November 15, 2019 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2019.x Android package: Install SDK & NDK Tools
2 participants