modesttree / Projeny

A project and package manager for Unity
MIT License
694 stars 87 forks source link

Incorporate Unity 2017.3b assembly definition files into projeny logic #77

Open svermeulen opened 6 years ago

svermeulen commented 6 years ago

This seems like it could be very interesting for use in Projeny:

https://blogs.unity3d.com/2017/11/22/unity-2017-3b-feature-preview-assembly-definition-files-and-transform-tool/

Gravetow commented 6 years ago

Hey @svermeulen! Any updates on this?

svermeulen commented 6 years ago

Not yet no, but I really want to do this. It would fit in perfectly with the way projeny is designed. I am hoping to have more time soon

Gravetow commented 6 years ago

Thank you for the quick reply! Would you mind sharing what parts would fit in about where? I would like to delve into it myself as well, but wouldn't know where to start at the moment.

michael-jennings commented 6 years ago

I can help with this.

What I'd love to see is a hybrid where Projeny still dynamically swaps in/out packages with dependencies taken into account, but also generates .asmdef files for imported packages.

I recommend this approach: Create a .asmdef file at the root of the package folder Create a .asmdef file at the sub-Editor folder, and, importantly, from here move any other deeper Editor folders in the tree to be children of that first root Editor folder. Mirror the original directory structure for clarity. Why? Because A) Generating a separate assembly for every sub-editor-folder would defeat a lot of performance gains, and B) I've seen two Editor folders in completely different directory branches reference classes in eachother. Since you can't have circular dependencies, this seems like the way to go.

If there are no editor folders, fine, that's the end of it. If the user ever adds any, then gen the stuff above.

Another awesome feature would be to search for matching file guids in existing projeny packages when you import a new one, and weld together already-imported stuff to avoid duplication and losing references to stuff.

Gravetow commented 6 years ago

B) I've seen two Editor folders in completely different directory branches reference classes in eachother. Since you can't have circular dependencies, this seems like the way to go.

I second this. I've seen something very similar just a couple days back.

svermeulen commented 6 years ago

The problem right now is that I want to make a big change first before doing smaller changes like this one or others. The big change is that I want to port all the python to C# to simplify the implementation and also to make it cross platform. This project started as literally just a simple python script that set up directory junctions and then just grew over time from there, so the C# unity editor functionality was added later, and now it's very clunky the way the python and the C# interact

So it might be a bit pointless to do work on this bug now since any work would have to be done again after this larger refactor is completed.

My free time for projects outside of work is spent on the next version of Zenject at the moment, so I can't start on this refactor yet until that's finished. But if either of you or anyone else want to help with the C# refactor that would work

svermeulen commented 6 years ago

Actually, depending on how much work it is to generate those asmdef files, it might not be such a bad idea to just add it to the current python implementation. So if you want to take a look at doing that, that would work too. Since it will probably be a couple months before the refactor to c# is ready