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

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.

Hi @Awarisu ,

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

1 Like

Sure.

5420388--551076--upload_2020-1-29_13-16-8.png

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

2 Likes

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

1 Like

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

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

Not that I’m aware of. I’ll ask around.

Regards,

Pascal

1 Like