Comments (46)
Hi @starikcetin
I released UpmGitExtension v1.0.0 with tag filter support.
This is just a short note to inform you. ;)
from zenject.
Just wanna chime in that I was able to install Extenject from
https://github.com/starikcetin/Extenject.git#b2746939227c47de4b00de2a0f772df3d7831e6
hey, you can just use https://github.com/starikcetin/Extenject.git#9.1.0
, tag names are also valid.
from zenject.
You can use path query parameter from unity2019.3.4f1 and unity2020.1a21.
https://forum.unity.com/threads/some-feedback-on-package-manager-git-support.743345/#post-5425311
Since package.json already exists, it can be set as follows.
{
"dependencies": {
"com.svermeulen.extenject": "https://github.com/svermeulen/Extenject.git?path=/UnityProject/Assets/Plugins/Zenject",
...
}
}
from zenject.
Hi @starikcetin
I released UpmGitExtension v1.0.0 with tag filter support.
This is just a short note to inform you. ;)
you know what? you are amazing. :)
from zenject.
Just wanna chime in that I was able to install Extenject from https://github.com/starikcetin/Extenject.git#b2746939227c47de4b00de2a0f772df3d7831e6
from zenject.
@starikcetin any progress? that warning is so obnoxious
from zenject.
Yes, it's a fork of Extenject, forked and maintained by starikcetin
from zenject.
Oh! That's quite cool! I never heard of it.
+1 for the idea.
And you can contribute if you like ;)
from zenject.
Yeah I recently discovered it as well, I will see what I can do.
from zenject.
Alright so here are my current results:
I followed this article: https://www.patreon.com/posts/25070968
The UPM branch is orphan. It is created by git subtree split
command.
But instead of leaving the split UPM branch as is, I soft reset to the first commit and squashed everything by amending the commit. This yielded a prettier result in my opinion.
UPM branch: https://github.com/starikcetin/Extenject/tree/upm
The problem is, all the other tags are showing up at the version select list, which are not compatible:
The reason they are not compatible is that, the UpmGitExtension plugin requires the package.json to be at the repository root, but we cannot just put it in there since we need to only publish the Plugins/Zenject folder as the package.
This is not a huge deal of course, since it rejects you from importing incompatible versions (i.e. when it cannot find the package.json at the repo root). But I think we should find a better way.
Maybe we can maintain a separate repository just for the UPM releases?
Or, maybe we can implement some tag-filtering mechanism in the UpmGitExtension plugin itself, so that it only shows compatible tags. I looked at it for a while but the code seems very complicated.
from zenject.
Alright, can you give me an orphan branch named "upm" here so I can send a pull request @svermeulen ?
from zenject.
@starikcetin Thanks for your contribution! It's much appreciated.
I like the fact that minor updates can be easily distributed to the users of Zenject.
UPM is an awesome thing for the future. However it's still in beta... If you've watched the Unite's Copenhagen there's a lot of new features coming to UPM. Like Asset Store Support, better Git support, etc. But the Package Developer tool is still not available.
The ultimate goal would be to have Zenject/Extenject in the UPM itself. And how cool would it be to have it in the Packages folder!
I am happy to create an UPM branch. But before that... could you enlighten me a bit more?
- The package installs into the same Plugins/Zenject directory?
- How does the GitHub link being advertised/registered? Does it automatically show up in the Package Manager? Is there any further action needed?
- Can updates be made simpler/automated?
- Does UPM automatically detects updates?
- Is there anything what can cause a bad user experience?
Don't want to be a pain but just want to get these stuff clear ;)
from zenject.
Btw the package validator gives an error:
Cannot perform upm operation: Unable to add package [https://github.com/starikcetin/Extenject/tree/upm]:
Package name 'https://github.com/starikcetin/Extenject/tree/upm' is invalid. [InvalidParameter]
from zenject.
@Mathijs-Bakker I'll write a detailed response when I get the chance. I've been very busy lately. But shortly, UPM is much better than any other asset sharing method I've used (and I used quite a lot of them). It keeps the assets folder clean of third party imports, provides version based updates with the click of a button, and it supports dependencies!
from zenject.
@Mathijs-Bakker
As this has been uncommented for a while let me try and address your questions:
* The package installs into the same Plugins/Zenject directory?
No, the plugin installs into a Package/Extenject directory. Since the plugin name is pulled from the package defintion this becomes the new diretory name. Also Unity handles upm packages differently and stores them outside the "Assets" directory.
* How does the GitHub link being advertised/registered? Does it automatically show up in the Package Manager? Is there any further action needed?
The package manager does by default not show existing third party projects. Users will need to add the link by themselves.
* Can updates be made simpler/automated?
Yes. I in fact did this via GitHub actions. The workflow implemented on my fork creates a new commit on an orphan upm branch and tags it with a separate upm version tag once a new version tag with the existing semantic versioning theme is pushed to the repo. This approach sadly discards any history as it creates an orphan branch and also creates the need to create separate upm tags but eliminates the need for a second repository compared to the subtree approach.
* Does UPM automatically detects updates?
If you just specify a branch it will always get the head version of that branch. If you use the upm-extension by @mob-sakai it should be able to detect the most recent version. In the newest version it would not detect earlier versions for some reason though (nvm, it detects them fine after adding it, you can downgrade to earlier versions). If you're not using the extension I think you have to manually delete the reference to the used version from the manifest.json.
* Is there anything what can cause a bad user experience?
As previously stated to use the ui you pretty much should use the upm-extension.
Please feel free to correct me if i missed something @starikcetin :)
from zenject.
Hi @umfahrem
Thank you for your reply.
There was a bug with UpmGitExtension. Which didn't allow me to install a git upm.
mob-sakai/UpmGitExtension#73
I will check it later if this has been resolved.
However. UPM should be supported. And actually I have a Zenject UPM version locally. Following Unity's package development recommendations.
I ended up with some optional packages.
- Zenject - DI framework
- Signals (from optional extras)
- Example demos (from optional extras)
- Moq Extension (from optional extras)
- NSubstitute Extension (from optional extras)
There are still some issues on Unity's side. Because they are still developing their UPM support. There's still something with the dependencies field in the package.js manifesto.
The last months of 2019 have been very busy for me to catch up with a lot of things. And this is one of them. I will see if I can get to it to push the local packages to the according tree.
Meanwhile just keep using the @starikcetin one.
from zenject.
I tried the upm package from @starikcetin but I keep getting spammed with the following warning:
A meta data file (.meta) exists but its asset 'Packages/com.svermeulen.extenject/OptionalExtras/TestFramework/Editor/AutoSubstitute/__MACOSX/AutoSubstitute/NSubstitute' can't be found. When moving or deleting files outside of Unity, please ensure that the corresponding .meta file is moved or deleted along with it.
from zenject.
Note these warnings are usually printed only once if the code is inside your project but in upm packages they keep getting printed over and over.
from zenject.
Note these warnings are usually printed only once if the code is inside your project but in upm packages they keep getting printed over and over.
Yes you right! that's annoying.
More reason to raise this issue on @starikcetin fork
from zenject.
@Mathijs-Bakker I can't, issues are disabled there, and he is not responding
from zenject.
@Mathijs-Bakker I can't, issues are disabled there, and he is not responding
That's bad. However... did you tried to delete the .meta file?
You only see them in your systems file browser window.
And you can open the current directory from right clicking on a file in Unity's project window.
Hope this helps.
from zenject.
Hey, sorry I have been very busy with work and school lately. I will look into it when I get the chance. @paulpach
from zenject.
@starikcetin Thank you for also pushing it to openupm :)
from zenject.
Getting 2 warnings when installing (via openupm) and every time Unity re-focuses:
A meta data file (.meta) exists but its asset 'Packages/com.svermeulen.extenject/OptionalExtras/TestFramework/Editor/AutoSubstitute/__MACOSX/AutoSubstitute/NSubstitute' can't be found. When moving or deleting files outside of Unity, please ensure that the corresponding .meta file is moved or deleted along with it
Couldn't delete Packages/com.svermeulen.extenject/OptionalExtras/TestFramework/Editor/AutoSubstitute/__MACOSX/AutoSubstitute/NSubstitute.meta because it's in an immutable folder.
from zenject.
Can you try 9.1.0-1.metaFileFix
version? The warning is gone on my machine.
openupm add [email protected]
@paulpach @MeikelLP
from zenject.
@starikcetin looks good to me
from zenject.
Another issue I have related to UPM:
I cannot use moq.dll
right now. I'm using Unity 2019.3.1f1
and set the assembly overrides manually:
But I cannot use moq
or NSubstitute
at all. This might not be an issue with Extenject itself but with the latest Unity package manager. I had a similar bug the other day with testables
in the new inputsystem: Unity-Technologies/InputSystem#989 (comment)
Can somebody confirm that this is not possible as of right now?
from zenject.
I can confirm that this is not related to Extenject. Unity generates wrong .csproj
files (?)
My references land inside MyProject.Items.csproj
instead of MyProject.Items.Tests.csproj
-_-
from zenject.
Maybe a dumb question: But does adding Zenject-usage.dll to the assembly refs help?
from zenject.
@Mathijs-Bakker seems to be (another) internal bug in Unity. It's related to
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
if this is not set the dll references work fine. I opened an issue at Unity (Case 1220959). Let's see how it goes.....
from zenject.
So apparently Moq.dll (which I want to use) is not supported in play mode (?).
Do you know if this is something this package can fix or is it an actual Unity issue?
from zenject.
When Extenject is installed from Package Manager using path query parameter, the following sample scene cannot be opened.
If you add a samples section to package.json like ShaderGraph, it will be expanded to Assets folder, but an error will occur because the script is duplicated.
https://github.com/Unity-Technologies/Graphics/blob/v7.2.1/com.unity.shadergraph/package.json#L11-L16
If you put sample projects in a hidden folder like Sample~
in upm, it works well, but it will not be included in unitypackage.
Do you have an idea that both unitypackage and upm work?
from zenject.
If you put sample projects in a hidden folder like Sample~ in upm, it works well, but it will not be included in unitypackage.
@shiena I made a PR #220 going right into that trap. Perhaps it could work to rename the folder removing the tilde from the .unitypackage build script?
from zenject.
Hello, is there any chance to release it on OpenUPM to make package installation easier? Releasing it as a package makes updating 1000x easier and more reliable.
I think Unity is also hosting a version of moq via UPM (I've seen it as a dependency in a tiny sample project recently) so adding dependencies like that could be done via UPM as well / OpenUPM
from zenject.
Correct me if I am wrong but isn't there already OpenUPM support?
https://openupm.com/packages/com.svermeulen.extenject/
Or is that another repo?
from zenject.
Is this still active?
I would really like the solution of a simple "git-link dependency" to this.
from zenject.
@chrPetry use https://openupm.com/packages/com.svermeulen.extenject/
from zenject.
@chrPetry use https://openupm.com/packages/com.svermeulen.extenject/
As I understand I would need to add OpenUPM with this solution, right?
I would rather not use OpenUPM but the built-in Unity Package Manager.
from zenject.
@chrPetry use https://openupm.com/packages/com.svermeulen.extenject/
As I understand I would need to add OpenUPM with this solution, right?
I would rather not use OpenUPM but the built-in Unity Package Manager.
OpenUPM is external, it doesn't replace UPM. It is just a tool that automates what you would be doing manually.
My fork is a little outdated however, I don't know when I would get the chance to update it, so be aware.
from zenject.
Unity Package Installer would be a more suitable name.
Unlike its name suggests wat it should do, Unity Package Manager (UPM) does not manage packages for you.
UPM only installs and uninstalls packages.
At Unite 2019 in Copenhagen, the UPM dev team presented the upcoming UPM feats. and their package developer tool. Then it took just a few months before the UPM project was canceled by the board. There are no exact reasons given why this happened (to the outside world). But it has to do something with the fact that UPM would become a competitor of the Unity Asset Store. And Unity needs to make money somewhere.
No other option than OpenUPM
If you want real package managing behavior, as auto update, revert back to earlier versions (tags) then OpenUPM is the only option.
To be continued
Stay tuned...
from zenject.
Alright, then thanks for this info!
from zenject.
upm can also be packaged in a tarball with npm pack
, so it can be published to releases as well as unitypackage.
https://docs.unity3d.com/Manual/upm-ui-tarball.html
for example
- https://developers.google.com/unity/archive
- https://github.com/ValveSoftware/unity-xr-plugin/releases/tag/v1.1.4
from zenject.
@Mathijs-Bakker I think the name is somewhat suited. As people can't host packages that are natively supported by UPM, OpenUPM is a free registry users can (with some work involved) upload packages which are free for everybody.
It is very sad that once again Unity is doing stuff very closed and not open to the public.
from zenject.
What's the status of this? The install documentation hints at UPM being an option, but using that installs 9.2.0 whereas we're now at 9.3.1.
from zenject.
What's the status of this? The install documentation hints at UPM being an option, but using that installs 9.2.0 whereas we're now at 9.3.1.
After modest tree won the lawsuit and got control of this repo, they basically just changed the branding and stopped maintaining the repo.
Instaling from @Mathijs-Bakker s maintained fork by git url seems like the best option https://github.com/Mathijs-Bakker/Extenject It's what I'm doing at least
from zenject.
Ah, sorry. I thought I was in the fork :D
It seems to have the same problem but I'll head over there instead.
from zenject.
Related Issues (20)
- ZenjectIntegrationTestFixture.Setup destroys objects that prevent UnityTests from running.
- Link Checker Report
- [Doc Bug] Broken link in Readme.md for example of using multiscene setups
- Failed to remove SceneContext from SceneContextRegistry HOT 1
- Circular Dependencies
- Unused sample zenject scripts in build (IL2CPP and Zenject)
- NullReferenceException when second time inject HOT 1
- working with additive scenes? HOT 1
- i need to declare many signals. is there a solution for that? HOT 1
- [Zenject 6 Upgrade] Not possible to bind multiple interfaces to the same implementation when using WithId anymore?
- There is no DisposableManager.RemoveLate method for removing previously registrated objects.
- Prefab installer ignore bind FromInstance
- Passing dynamic data + prefab through method Create (Factory) while that prefab has GameObjectContext HOT 1
- The type or namespace name 'ConstructorChoiceStrategy' could not be found while building NonUnityBuild solution
- "Re-injecting" dependencies into a prefab when it's spawned from a MemoryPool? HOT 1
- Project Context: "Null Installer" assert hit when using Prefab Variant only on built version
- MemoryPool<Param, Value> with CustomFactory HOT 1
- When using Container.Instantiate to create a new object in the Create method of the factory, IMemoryPool is not assigned.
- [question] Is generic installers possible?
- Inquiry Regarding IDisposable in Zenject
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zenject.