Search Unity

Feedback Stop trying to make Java-style package naming happen, not even you are committed to it

Discussion in 'Package Manager' started by Awarisu, Jan 28, 2020.

  1. Awarisu

    Awarisu

    Joined:
    May 6, 2019
    Posts:
    215
    Roughly half of Unity's (first-party!) stuff uses the .NET/NuGet convention of package naming (Unity.Something or Unity*.Something). The official documentations suggest that you should be using Java style (based on your company's URL in reverse: com.unity.something).

    Given that multiple asset store vendors and even Unity is using .NET-style package names and that Unity is very much a software powered by .NET, consuming .NET libraries (which aren't getting renamed), etc. I'd like to suggest officially dropping the silly Java-style guidelines and standardizing on the naming convention actually used by the .NET world.
     
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hi @Lorash,

    It is important to make a distinction between package name, package display name and assembly name.

    The package name uses the reverse domain name notation (which is also used in the Java world as you mentioned). This name is not exposed to users in theory. This notation was chosen because it fulfills our requirements to make package names uniques and group package by domain/company. Only if you dig into the project manifest or when errors are reported you'll see this label.

    The user-friendly package display name is set in the
    displayName
    property of a package manifest. This is what we expose in the UI. All Unity published packages should have this attribute set. If not, please let us know, this is a bug!

    For both the name and display name, you can get more information in the Naming you package section of Unity User Manual

    Finally, assembly name guidelines to chose your package name is explained in Assembly definitions and packages section of the Unity user manual., In there, we recommended to use the .NET naming convention.

    Regards,

    Pascal
     
    Mauri likes this.
  3. Awarisu

    Awarisu

    Joined:
    May 6, 2019
    Posts:
    215
    Sure.

    upload_2020-1-29_13-16-8.png
     
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Ok. I see. I recall now this was the first naming pattern proposed. Since Cinemachine was one of the first packages, they are probably stuck to using this convention forever. But like I said in my previous answer, this is fixed and any new packages should use the .NET convention as you suggested.

    Thank you!

    Pascal
     
    ilmario and Awarisu like this.
  5. chao3

    chao3

    Joined:
    Sep 1, 2014
    Posts:
    11
    Hello,

    The Adding tests to a package page suggests naming editor test asmdef as MyPackage.EditorTests.asmdef while
    Assembly definition and packages suggests MyCompany.MyFeature.Editor.Tests.asmdef. I would like to know which one is the current recommended convention to follow. Thank you.

    Frank
     
    Awarisu likes this.
  6. chao3

    chao3

    Joined:
    Sep 1, 2014
    Posts:
    11
    Also,

    It seems newer Unity official packages like USD and SBP chose to omit .Runtime in the assembly definition file names under Runtime or Tests/Runtime folder. Is this another naming convention update?

    Frank
     
  7. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    It looks like you found a documentation bug :). The correct information is located in Assembly definition and packages. I'll ask the tech writer to fix the issue. Thank you for reporting!

    Regards,

    Pascal
     
  8. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Not that I'm aware of. I'll ask around.

    Regards,

    Pascal
     
    chao3 likes this.