Search Unity

Best practices when developing packages.

Discussion in 'Package Manager' started by Lobolopez, Jun 19, 2019.

  1. Lobolopez

    Lobolopez

    Joined:
    Feb 26, 2018
    Posts:
    15
    Hi there!
    So, when developing a package, how do you guys manage the data flow? The key issue if, for me, that repo-based packages will use the repo root as the package root, which means that, one way or the other, you'll need to point your package sub-dir to an external repo (which is what you'll share) That approach leaves you dealing with the development project being a repo around the package repo or some such.
    To the Collab guys: this would be simpler if we could just set a dir when linking, so I could do
    "the.company.product": "https://bitbucket.org/blah/bleh.git/Package" that would allow a single Git repo to do the job.


    But meanwhile, what I am considering:

    Collab + Git:
    The idea is, you develop your feature in a Collab project and, at the point of publication you create a Git repo from the package subdir and push that.
    -pros: simple to setup
    -cons: Collab doesn't know about the inner Git repo, so getting the project in a different computer means then linking manually the dir with the external Git. Which can or not be trivial. Pushing to external repo won't scale.

    Git Modules:
    Develop the feature in an Unity project that's hosted in Git and then set the package dir as a submodule
    -pros: easy to pull and push (git sub-module update --recursive 'ish)
    -cons: complicated to setup, plus I don't want to fix this other guy's merge issue (or mine) inside a sub-module. Submodules require special commands for pulling/pushing.


    Do those approaches sound kosher enough? What do you guys use?
     
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    575
    Hi @Lobolopez

    I know that, internally, some teams are planning to use two Git repositories. One private for hosting the package development project and another one public to share the package with external users (letting users use the package through Git URL dependencies). Managing two repositories for your package is not a great development workflow. We have on our roadmap a feature to support Git package dependencies inside a repository sub-folder. This will enable merging both repositories into one.

    But for now, any of the solutions you shared seems fine in my point of view. I believe this is more of personal preference. Hopefully, other users will pitch in to share their experience/workflow!

    Regards,

    Pascal
     
  3. Lobolopez

    Lobolopez

    Joined:
    Feb 26, 2018
    Posts:
    15
    That sounds about right to me.
    Yeah, being able to have a single repo and pointing the package manager at a dir would definitely ease things but, at that point it would seem relatively easy to merge the two repos.
    Cheers man! (and pass greetings to Andre, Dominic and so on, you guys keep on doing a bloody great job (ex-unity myself :)
    Salut!
     
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    575
    Will do! Cheers! :)