Search Unity

Question Addressables and git?

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

  1. Gordon_G

    Gordon_G

    Joined:
    Jun 4, 2013
    Posts:
    372
    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:
    542
    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
     
    Gordon_G 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.
     
    Gordon_G likes this.
  4. Gordon_G

    Gordon_G

    Joined:
    Jun 4, 2013
    Posts:
    372
    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.
     
    Gordon_G likes this.
  6. unity-pro-3

    unity-pro-3

    Joined:
    Apr 7, 2021
    Posts:
    2
    Is there any official update documentation-wise?
    We are also setting up the addressable system for a workflow involving ci and multiple developers.
    Now we also have the question which files to track in git in order to have a properly synchronized version.

    The problem we are presently facing is that if we create an addressable build in project 1 and push it to git, and the other project pulls from git and updates the previous addressable build (using addressables_content_state.bin) , the content catalog is changed and new bundles are generated. To the best of our knowledge, the desired behavior should be that nothing new is created since the previous addressable build should be identical and nothing has changed.
    If we copy the entire library folder to the new project, we have the expected behavior and no explicit catalog update is carried-out. Same behavior can be observed in project 1 locally.

    However, tracking the entire library folder is not an option at all.
    We presently track everything in Assets, Library/com.unity.addressables, as well as AddressablesConfig.dat, as well as the generated "ServerData".

    Did you encounter a similar behavior?