Search Unity

Different package versions

Discussion in 'Package Manager' started by pahe, May 21, 2019.

  1. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    Hey guys.

    I'm currently fiddling around with the package manager and the manifest files for my own package. My package shows up correctly in the PM window, but now I wonder how I can setup my manifest file that I can specify different version like the Unity packages. I want new version only to be available when I have something stable and not always the latest stuff.

    My manifest file looks like:

    Code (CSharp):
    1. {
    2.     "name": "com.nge.myeditortool",
    3.     "displayName": "NGE - Editor tool",
    4.     "version": "0.0.1",
    5.     "unity": "2019.1",
    6.     "description": "Generic editor tools for NGE",
    7.     "category": "Unity"
    8. }
    Now I would like to have not only version 0.0.1, but also 0.0.3,... just like other packages, but I haven't found anything in the docs:

    UnityPackages.png

    Thanks for help.
     
  2. jbourquin

    jbourquin

    Joined:
    Oct 18, 2017
    Posts:
    1
    Hello pahe,

    In your package.json file, just change "version": "0.0.1" for "version": "0.0.3" and publish your package.
    Then in Unity , you should see your new version (if not, just close and re-open the package window, so it will reload the list of available versions for the packages)
     
  3. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    I think I haven't made clear enough what I like to have :) I know how I change the version of my package, but I want to have all different versions available to upgrade/downgrade like I do with other Unity packages:

    Packages.png

    See, "Multiplayer HLAPI" has several versions I can select. For my "NGE PSDExporter Editor" package it is not working, as I don't know how to setup multiple versions in my package.manifest.
    I tried:

    Code (CSharp):
    1. {
    2.   "name": "com.nge.psdexportereditor",
    3.   "displayName": "NGE PSDExporter Editor",
    4.   "version": "0.0.1",
    5.   "unity": "2019.1",
    6.   "description": "NGE PSDExporter Editor",
    7.   "keywords": [
    8.     "maths",
    9.     "unity"
    10.   ],
    11.   "category": "Unity",
    12.   "dependencies": {
    13.   }
    14. },
    15. {
    16.   "name": "com.nge.psdexportereditor",
    17.   "displayName": "NGE PSDExporter Editor",
    18.   "version": "0.0.2",
    19.   "unity": "2019.1",
    20.   "description": "NGE PSDExporter Editor",
    21.   "keywords": [
    22.     "maths",
    23.     "unity"
    24.   ],
    25.   "category": "Unity",
    26.   "dependencies": {
    27.   }
    28. }
    But that game me only errors. So does anyone know how to achieve this?
     
  4. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,065
    There's no such thing as multiple versions inside a package.

    The versions you see in the package manager come from the repository server, to which multiple versions have been published and then makes them available to be installed.

    This is not possible for local packages. For git packages you can use tags but you'll have to edit the manifest manually.

    See the documentation for more information:
    https://docs.unity3d.com/Manual/upm-scoped.html
     
    pahe likes this.