Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Addressables and git?

Discussion in 'Addressables' started by streeetwalker, Aug 23, 2022.

  1. streeetwalker

    streeetwalker

    Joined:
    Jun 4, 2013
    Posts:
    327
    I've read through the few threads in this forum about what parts of the Addressables builds to commit to git, and I still don't git it! (sorry, a bad pun should never go undone.)

    Is it possible to have one teammate build and upload only the Addressables to a server, and another teammate build and distribute only the Unity game app?

    What do we have to push through git to make that division of responsibility work?

    Our Addressables content bundles add up to over a gigabyte. Surely we don't have to commit those to git?

    Isn't there a file or files short of the entire bundle folder that can committed and pushed so that the app builder on the other end can build the Addressables on his/her side computer in order to test the app, and it will work with the Addressables content the other person uploaded?
     
  2. R1PFake

    R1PFake

    Joined:
    Aug 7, 2015
    Posts:
    507
    You could edit your gitignore file to ignore the directory which contains the content build and then use what ever other system you want to backup that directory.

    Additionally you can change the default content bundle build directory to a custom path in the Addressables profile:
    https://docs.unity3d.com/Packages/com.unity.addressables@1.9/manual/AddressableAssetsProfiles.html
     
    streeetwalker likes this.
  3. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    Our project has a similar setup, we divide our project into two separate Unity projects. One is for making assets and building bundles only, the other is for scripting only. The only thing we need to keep synchronizing is the Library/com.unity.addressables folder. Other files are all uploaded to remote server. You only have to upload your 1G of bundles to remote server once. Bundles are huge in number and size, they don't fit in the Git.
     
    streeetwalker likes this.
  4. streeetwalker

    streeetwalker

    Joined:
    Jun 4, 2013
    Posts:
    327
    they thank you so much for this reply!

    I did not know anything about this at all and, while I haven't been over the documentation as closely as I need to, i didn't see anything about the Library folder. Do you know where you found that? I need to learn more about Addressables

    I see the files in that Library folder are the addressables_content_state.bin files for each app platform I have built. When do those get updated?

    I mean, when I choose New Build > Default Build Script in the Addressables panel, addressables_content_state.bin is created in our assets folder. Do those get copied to the Library folder at some point?
     
    Last edited: Aug 25, 2022
  5. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    The doc doesn't mention it. I found it by reading through the source code. When executing New Build, BuildScriptPackedMode.cs is used to do the build, please take a look at the "DoBuild" method, this contains the entire build process. There you can find what Addressables is doing behind the scene. We do need to commit the files in the Assets/AddressableAssetsData to Git as well as the bin file. According to the "DoBuild" method, it also immediately backups the bin to the Library/com.unity.addressables folder as well.
    I would suggest that we just read the source code ourselves. The official response is a bit slow, it's understandable, they are always busy. The doc is a bit lacking, it's understandable as well..., Addressables' source code is very complex, there are so many important things hidden the source code, the doc will just become too long if they need to include all that.
     
    streeetwalker likes this.