Search Unity

Addressable Path to copy assets

Discussion in 'Unity Build Automation' started by c_andrews, Jan 6, 2021.

  1. c_andrews

    c_andrews

    Joined:
    Jan 26, 2015
    Posts:
    106
    Hi, I've got a shell script running which is meant to copy the compiled updated Addressable assets and upload them to S3. My script was working but in Cloud Build it can no longer seem to find the compiled Addressable assets in the Post Build.

    I was using the details provided in the "Copying Addressables content with a post-build script" section here: https://docs.unity3d.com/Manual/UnityCloudBuildAddressables.html

    Could you tell me if the path has changed or if I am missing something?

    Code (CSharp):
    1.  
    2. # set the path based on the first argument
    3. path="${WORKSPACE}/.build/last/${BUILD_TARGET}/extra_data/addrs/"
    4.  
    5. # loop through the folder path and upload each file
    6. for f in "$path"/*
    7. do
    8.     # get the file
    9.     file="${f##*/}"
    10.  
    11.    # build the file path
    12.    filePath="$path/$file"
    13.  
    14.    echo "Uploading File: $file"
    15. // $file is .../.build/last/iOS/extra_data/addrs//*
    16. done
    17.  
     
    Last edited: Jan 6, 2021
  2. victorw

    victorw

    Joined:
    Sep 14, 2016
    Posts:
    459
    Did you update your version of Unity or the Addressables package? As far as I know, nothing has changed on our side - particularly due to the code freeze over the holiday period.
     
  3. c_andrews

    c_andrews

    Joined:
    Jan 26, 2015
    Posts:
    106
    Nope, I don't think I have. The path seems to have changed to: ${WORKSPACE}/.build/last/${BUILD_TARGET}/extra_data/addrs/ServerData/iOS

    Adding on ServerData/iOS to the path
     
  4. victorw

    victorw

    Joined:
    Sep 14, 2016
    Posts:
    459
    From taking a quick look it seems as if this change was triggered by switching to Xcode 12.2.0 in your new project - I guess that's not entirely surprising though it is a little confusing and frustrating. I'll talk to the Addressables and Documentation team about this.
     
  5. c_andrews

    c_andrews

    Joined:
    Jan 26, 2015
    Posts:
    106
    Ah interesting, thanks for letting me know the reason. Is there an environment variable that points to the Addressable content path?
     
  6. victorw

    victorw

    Joined:
    Sep 14, 2016
    Posts:
    459
    Not currently, no. Although in this case it wouldn't really help since the only part we control is the
    /extra_data/addrs
    part, the extra stuff on the end is being added by processes outside of our direct control and we're just using
    **/*
    to pick up those files for upload anyway.
     
  7. c_andrews

    c_andrews

    Joined:
    Jan 26, 2015
    Posts:
    106
    Are the Addressable not compiled with the Unity compiler? The addressable path for Android is the same structure:
    ${WORKSPACE}/.build/last/${BUILD_TARGET}/extra_data/addrs/ServerData/Android
     
  8. victorw

    victorw

    Joined:
    Sep 14, 2016
    Posts:
    459
    The Unity compiler is only a small part of the UCB build process and it's the part which we don't have direct control over since it's reliant on which Unity version and Addressables package you are using. We do have some improvements planned for how we structure the build process and artifact manifest but it will probably be several months before those are available.
     
  9. c_andrews

    c_andrews

    Joined:
    Jan 26, 2015
    Posts:
    106
    Cool thanks for clearing it up.
     
  10. victorw

    victorw

    Joined:
    Sep 14, 2016
    Posts:
    459
    What were you comparing against, actually? I just had a look at your projects and as far as I can see your projects have always copied the addressables data into subfolders of the
    extra_data/addrs
    path. As well as the
    ServerData
    there's also the
    Library
    folder in there which stores your content state.
     
  11. c_andrews

    c_andrews

    Joined:
    Jan 26, 2015
    Posts:
    106
    Is was originally developed for use in a Guest Project it could have been that it was using Unity 2020.x instead of 2019.