Skip to content

AppleAppBuilder doesn't embed test data from subdirectories #52104

Closed

Description

@filipnavara

Some test assemblies rely on test data being compiled into the published app. One example is System.Security.Cryptography.X509Certificates which copies several test certificates into the TestData directory.

AppleAppBuilder currently doesn't copy these data into the app bundle so the tests fail to find the data.

Notably, this code doesn't list files in subdirectories:

string[] resources = Directory.GetFiles(workspace)
.Where(f => !excludes.Any(e => f.EndsWith(e, StringComparison.InvariantCultureIgnoreCase)))
.Concat(Directory.GetFiles(binDir, "*.aotdata"))
.ToArray();

Fixing that is relatively easy but CMake still flattens out the resource structure in the output Xcode project.

Activity

  1. ghost added
    untriaged
    on Apr 30, 2021
  2. directhex commented on May 3, 2021

    @directhex
    Contributor

    As best I can determine, CMake isn't entirely to blame here. Xcode flattens all file references in Resources. If you want a directory structure, you need a folder reference, which is handled differently (and obviously means we can't filter the files the way we do in xcode.cs)

    Will run some experiments

  3. directhex commented on May 3, 2021

    @directhex
    Contributor

    OK, I've determined that RESOURCE in cmakelists always takes the flattening approach. It seems there's a slightly different MACOSX_PACKAGE_LOCATION which works with subdirectories. Gotta get the syntax right...

  4. directhex commented on May 3, 2021

    @directhex
    Contributor

    Xcode is cursed

  5. removed
    untriaged
    on May 5, 2021
  6. added this to the 6.0.0 milestone on May 5, 2021
  7. ghost added
    in-pr
    on May 6, 2021
  8. ghost removed
    in-pr
    on May 6, 2021
  9. added a commit that references this issue on May 6, 2021
    e795b06
  10. ghost locked as resolved and limited conversation to collaborators on Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions