Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Tell UPM to look for package.json in given folder/path of a given branch of a given git url

Discussion in 'Package Manager' started by rdmtechcraft, Jun 16, 2022.

  1. rdmtechcraft

    rdmtechcraft

    Joined:
    May 14, 2022
    Posts:
    2
    I am developing and maintaining a personal-use-only custom-package "com.a" by testing it in regular unity project "TestProjectA" and then push everything to git at url https://github.com/TestProjectA

    Structure of git branch named "package_ver1" as below:
    TestProjectA/TestProjectA.sln
    TestProjectA/Assets/TestScene.unity
    TestProjectA/Assets/TestScript.cs
    TestProjectA/Packages/manifest.json
    TestProjectA/Packages/package-lock.json
    TestProjectA/Packages/com.a/package.json
    TestProjectA/Packages/com.a/Runtime/Sample.cs
    TestProjectA/Packages/com.a/Runtime/com.a.asmdef

    With above, I've imported "com.a" as a local-dependency in TestProjectA, currently I'm able to edit and test Sample.cs and push whole project to git.

    Question:
    When I import "com.a" package in live projects, like LiveProject1 or LiveProject2, is there a way to tell UPM to search of package.json in folder/path like "./Packages/com.a/' on branch "package_ver1" of git url https://github.com/TestProjectA ?
     
  2. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,076
     
    rdmtechcraft likes this.
  3. rdmtechcraft

    rdmtechcraft

    Joined:
    May 14, 2022
    Posts:
    2
    thanks @KirillKuzyk.. while I tried this previously through this same documentation, it wasn't working. I found the issue though; my global git config credential.helper = osxkeychain did not work. Later I tried git-credential-manager and it worked with unity showing the login pop-up. Now I'm able to use https://github.com/TestProjectA?path=/myFolder1/myPkg#myBranchName and it works!