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

Unity integration with Package Manager #6

Open
Kronoxis opened this issue Aug 14, 2023 · 4 comments
Open

Unity integration with Package Manager #6

Kronoxis opened this issue Aug 14, 2023 · 4 comments
Labels
question Further information is requested

Comments

@Kronoxis
Copy link
Collaborator

The current setup of the git repository does not support pulling the code from git URL using the Unity Package Manager.

[Package Manager Window] Cannot perform upm operation: Unable to add package [https://github.com/Dreamteck/splines.git]:
[https://github.com/Dreamteck/splines.git] does not point to a valid package. No package manifest was found. [NotFound].

I think it would be best to convert this so that I can pull from any branch using the Package Manager git URLs, however I don't know how difficult this will be considering you have the Utilities in a separate repo.

Thoughts?

@Kronoxis Kronoxis added the question Further information is requested label Aug 15, 2023
@Kronoxis Kronoxis changed the title [Question] Unity integration with Package Manager Unity integration with Package Manager Aug 15, 2023
@f007ch
Copy link
Contributor

f007ch commented Aug 16, 2023

That's the reason we have it set up like that - the utilities being separated. We could remove the submodule but then managing updates to the utilities will become more challenging.

@Kronoxis
Copy link
Collaborator Author

I understand why it's separated and it would be ideal if it could stay that way, it's just that I don't know how well this works with Unity's package manager. I have no experience setting that up.

@Kronoxis
Copy link
Collaborator Author

I believe, based on the Unity documentation, it should be possible to add a package.json to both the utilities and splines repos, and make splines depend on the utilities. That way, the utilities package will be added to the project whenever splines is added through the package manager.

However, the structure of the git repo has to change significantly for package manager to work:

  • package.json must be available at root
  • /Assets/Dreamteck/Splines/ would move to /Runtime/
  • /Assets/Dreamteck/Splines/Editor/ would move to /Editor/
  • Assembly definitions may need to change to remain functional. Not sure
  • Tests are strongly recommended (if not required), available under /Tests/Runtime/ and /Tests/Editor/
  • Samples would have to be unpacked to /Samples~/
  • A dev branch would be preferable, so that all changes can be gathered on dev first, before eventually being pushed as a version on main, together with a changelog summary in README.md at root

@ErnSur
Copy link

ErnSur commented Nov 23, 2024

However, the structure of the git repo has to change significantly for package manager to work:

I'll clarify this since it's not entirely true.

  • package.json must be available at root
  • It doesn't have to be in the repository root.
  • It has to be in a folder that contains all of the package assets

Users are able to specify the package path when installing a package from git url. More info here

  • /Assets/Dreamteck/Splines/ would move to /Runtime/
  • /Assets/Dreamteck/Splines/Editor/ would move to /Editor/

While it would be nice to stick to the standard, it's not a requirement.

  • Assembly definitions may need to change to remain functional. Not sure

Assembly definitions are simply required, scripts that are not part of any assembly definition will simply not be compiled.

  • Tests are strongly recommended (if not required), available under /Tests/Runtime/ and /Tests/Editor/

Not required, it's up the the developer what they do with the tests.

  • Samples would have to be unpacked to /Samples~/

Same as above, would be nice to stick to the standard but it's not a requirement.

  • A dev branch would be preferable, so that all changes can be gathered on dev first, before eventually being pushed as a version on main, together with a changelog summary in README.md at root

This is also nice-to-have, users are able to install specific commit, branch or tag. More info here.

Summary

{
    "name": "io.dreamteck.splines",
    "displayName": "Dreamteck Splines",
    "version": "3.0.6",
    "dependencies": {
        "io.dreamteck.utils": "1.2.3"
    }
}
  • Any dependences would preferably also become UPM compliant to install them in the same manner
  • Package folder must be immutable. If any editor script is adding/removing/modifying assets inside the package folder then it's not compliant.
  • All absolute paths to the package assets must be updated to point to the new package location: "Packages/name.of.the.package/..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants