Search Unity

official name restriction question

Discussion in 'Package Manager' started by Baste, May 6, 2019.

  1. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,336
    From the docs:

    "...The name must:

    Start with com.<company-name>. For example, one of the official Unity packages is “com.unity.timeline”. ..."

    If I'm releasing an open source project under my own name rather than my company's, what am I supposed to do? Name it com.baste.myPackage?
     
    M_R and alexzzzz like this.
  2. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    555
    The naming uses "reverse domain name notation", and in the best cases, the matching domain name belongs to the same entity as the package author (i.e. "baste.com" should not belong to someone else than you), but this is convention, not a strong requirement.

    Strictly speaking, "com.baste" is a valid option. However for an open-source projects it's common to see the domain names end with ".org", so it might make more sense to use "org.baste" (or any other name you think would fit the "organization" that will end up owning the project).
     
  3. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    What if there is no domain name and/or organization?

    Let's say I publish a package "Abc" at github/bitbucket mostly for personal use but don't mind if other people use it too. What its name should be?

    - com.alexzzzz.abc (alexzzzz.com domain doesn't exist)
    - alexzzzz.abc
    - abc
    - ...?

    Is it like a namespace in C# where the name is just an identifier that better be unique, but doesn't really mean anything?
     
    Last edited: May 6, 2019
  4. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    559
    maybe
    com.github.alexzzzz.abc
    (if it's hosted on github)

    the difference with c# namespaces is that you cannot ever have 2 packages with the same name in a given project or registry, while you can handle conflicting namespaces (in different assemblies) with
    extern alias