Giter VIP home page Giter VIP logo

Comments (46)

mob-sakai avatar mob-sakai commented on July 17, 2024 3

Hi @starikcetin

I released UpmGitExtension v1.0.0 with tag filter support.
This is just a short note to inform you. ;)
uge_0_9_1-2
1_0_0_uge-2

from zenject.

starikcetin avatar starikcetin commented on July 17, 2024 2

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.

shiena avatar shiena commented on July 17, 2024 2

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.

starikcetin avatar starikcetin commented on July 17, 2024 1

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.

dustinlacewell avatar dustinlacewell commented on July 17, 2024 1

Just wanna chime in that I was able to install Extenject from https://github.com/starikcetin/Extenject.git#b2746939227c47de4b00de2a0f772df3d7831e6

from zenject.

paulpach avatar paulpach commented on July 17, 2024 1

@starikcetin any progress? that warning is so obnoxious

from zenject.

Mathijs-Bakker avatar Mathijs-Bakker commented on July 17, 2024 1

Yes, it's a fork of Extenject, forked and maintained by starikcetin

from zenject.

Mathijs-Bakker avatar Mathijs-Bakker commented on July 17, 2024

Oh! That's quite cool! I never heard of it.
+1 for the idea.
And you can contribute if you like ;)

from zenject.

starikcetin avatar starikcetin commented on July 17, 2024

Yeah I recently discovered it as well, I will see what I can do.

from zenject.

starikcetin avatar starikcetin commented on July 17, 2024

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:
Capture

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.

starikcetin avatar starikcetin commented on July 17, 2024

Alright, can you give me an orphan branch named "upm" here so I can send a pull request @svermeulen ?

from zenject.

Mathijs-Bakker avatar Mathijs-Bakker commented on July 17, 2024

@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.

Mathijs-Bakker avatar Mathijs-Bakker commented on July 17, 2024

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.

starikcetin avatar starikcetin commented on July 17, 2024

@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.

umfahrem avatar umfahrem commented on July 17, 2024

@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.

Mathijs-Bakker avatar Mathijs-Bakker commented on July 17, 2024

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.

  1. Zenject - DI framework
  2. Signals (from optional extras)
  3. Example demos (from optional extras)
  4. Moq Extension (from optional extras)
  5. 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.

paulpach avatar paulpach commented on July 17, 2024

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.

paulpach avatar paulpach commented on July 17, 2024

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.

Mathijs-Bakker avatar Mathijs-Bakker commented on July 17, 2024

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.

paulpach avatar paulpach commented on July 17, 2024

@Mathijs-Bakker I can't, issues are disabled there, and he is not responding

from zenject.

Mathijs-Bakker avatar Mathijs-Bakker commented on July 17, 2024

@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.

starikcetin avatar starikcetin commented on July 17, 2024

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.

MeikelLP avatar MeikelLP commented on July 17, 2024

@starikcetin Thank you for also pushing it to openupm :)

from zenject.

MeikelLP avatar MeikelLP commented on July 17, 2024

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.

starikcetin avatar starikcetin commented on July 17, 2024

Can you try 9.1.0-1.metaFileFix version? The warning is gone on my machine.
openupm add [email protected]
@paulpach @MeikelLP

from zenject.

MeikelLP avatar MeikelLP commented on July 17, 2024

@starikcetin looks good to me

from zenject.

MeikelLP avatar MeikelLP commented on July 17, 2024

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:

image

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.

MeikelLP avatar MeikelLP commented on July 17, 2024

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.

Mathijs-Bakker avatar Mathijs-Bakker commented on July 17, 2024

Maybe a dumb question: But does adding Zenject-usage.dll to the assembly refs help?

from zenject.

MeikelLP avatar MeikelLP commented on July 17, 2024

@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.

MeikelLP avatar MeikelLP commented on July 17, 2024

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.

shiena avatar shiena commented on July 17, 2024

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.

johanhelsing avatar johanhelsing commented on July 17, 2024

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.

marwie avatar marwie commented on July 17, 2024

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.

MeikelLP avatar MeikelLP commented on July 17, 2024

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.

chrPetry avatar chrPetry commented on July 17, 2024

Is this still active?
I would really like the solution of a simple "git-link dependency" to this.

from zenject.

MeikelLP avatar MeikelLP commented on July 17, 2024

@chrPetry use https://openupm.com/packages/com.svermeulen.extenject/

from zenject.

chrPetry avatar chrPetry commented on July 17, 2024

@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.

starikcetin avatar starikcetin commented on July 17, 2024

@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.

Mathijs-Bakker avatar Mathijs-Bakker commented on July 17, 2024

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.

chrPetry avatar chrPetry commented on July 17, 2024

Alright, then thanks for this info!

from zenject.

shiena avatar shiena commented on July 17, 2024

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

from zenject.

MeikelLP avatar MeikelLP commented on July 17, 2024

@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.

denravonska avatar denravonska commented on July 17, 2024

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.

johanhelsing avatar johanhelsing commented on July 17, 2024

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.

denravonska avatar denravonska commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.