Skip to content

Fix modules install path #119

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

Merged
merged 1 commit into from
Nov 1, 2019
Merged

Fix modules install path #119

merged 1 commit into from
Nov 1, 2019

Conversation

Larusso
Copy link
Owner

@Larusso Larusso commented Nov 1, 2019

Description

I realized that some of the installpath and install_location returns were incorrect when compared to the offical modules.json files coming from Unity.

Example:

macOS android-sdk-build-tools

"destination": "{UNITY_PATH}/PlaybackEngines/AndroidPlayer/SDK/build-tools",
"renameTo": "{UNITY_PATH}/PlaybackEngines/AndroidPlayer/SDK/build-tools/28.0.3",
"renameFrom": "{UNITY_PATH}/PlaybackEngines/AndroidPlayer/SDK/build-tools/android-9"

windows android-sdk-build-tools

"destination": "{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayer/SDK",
"renameTo": "{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/platforms/android-28",
"renameFrom": "{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/android-9"

The difference is marginal and yields a similar installation path. But I made a mistake coping the macOS values over to windows and adjusted some values based on the expected windows output path. Classic problem. Never trust your own fixtures.

Since I want to produce the same modules.json files as Unity Hub and the modules in questions are not part of the older ini manifest files I had to fix this.

I also took this chance of adjusting the install_location return types slightly. In most cases the install path and install_location is the same and or unique enough to just probe for the existence of the directory to determine if something is installed or not. In case of android it is not. The destination field points in some cases to a shared location (PlaybackEngines/AndroidPlayer/SDK) even though the final resources are located in a subdirectory. This was never a problem
because modules always had a unique install path. I took the liberty to manually adjust this path for installation checks for now.
Means:

macOS android-sdk-build-tools:

  • installpath -> {UNITY_PATH}/PlaybackEngines/AndroidPlayer/SDK
  • install_location -> {UNITY_PATH}/PlaybackEngines/AndroidPlayer/SDK/build-tools

I hope this solution works until I have time to implement a check to ask the modules.json if a given module is installed or not.

Changes

  • FIX WINDOWS module install path
  • IMPROVE module install_location path

Description
===========

I realized that some of the installpath and install_location returns
were incorrect when compared to the offical `modules.json` files coming
from Unity.

Example:

_macOS android-sdk-build-tools_

```json
    "destination": "{UNITY_PATH}/PlaybackEngines/AndroidPlayer/SDK/build-tools",
    "renameTo": "{UNITY_PATH}/PlaybackEngines/AndroidPlayer/SDK/build-tools/28.0.3",
    "renameFrom": "{UNITY_PATH}/PlaybackEngines/AndroidPlayer/SDK/build-tools/android-9"
```

_windows android-sdk-build-tools_

```json
    "destination": "{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayer/SDK",
    "renameTo": "{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/platforms/android-28",
    "renameFrom": "{UNITY_PATH}/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/android-9"
```

The difference is marginal and yields a similar installation path. But I
made a mistake coping the macOS values over to windows and adjusted some
values based on the expected windows output path. Classic problem. Never
trust your own fixtures.

Since I want to produce the same `modules.json` files as Unity Hub and
the modules in questions are not part of the older `ini` manifest files
I had to fix this.

I also took this chance of adjusting the `install_location` return types
slightly. In most cases the install path and `install_location` is the
same and or unique enough to just probe for the existence of the
directory to determine if something is installed or not. In case of
`android` it is not. The `destination` field points in some cases to a
shared location (`PlaybackEngines/AndroidPlayer/SDK`) even though the
final resources are located in a subdirectory. This was never a problem
because modules always had a unique install path. I took the liberty to
manually adjust this path for installation checks for now.
Means:

macOS _android-sdk-build-tools_:
* installpath `->` `{UNITY_PATH}/PlaybackEngines/AndroidPlayer/SDK`
* install_location `->` `{UNITY_PATH}/PlaybackEngines/AndroidPlayer/SDK/build-tools`

I hope this solution works until I have time to implement a check to ask
the `modules.json` if a given module is installed or not.

Changes
=======

* ![FIX] ![WINDOWS] module install path
* ![IMPROVE] module `install_location` path
@Larusso Larusso added this to the Unity Hub install parity milestone Nov 1, 2019
@Larusso Larusso self-assigned this Nov 1, 2019
@Larusso Larusso merged commit a32b7ff into master Nov 1, 2019
@Larusso Larusso deleted the fix/module_installpath branch November 1, 2019 17:39
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.

1 participant