Xcode Framework Reference Paths and Output Directory Assemblies

I have an Application.xcworkspace workspace that creates two frameworks and an executable file that uses these frameworks. Here's how they are laid out:

  • Framework_1 - Created and displayed on the ugly path DerivedData.

  • Framework_2 - depends on Framework_1, which is included in the scope of the projectโ€™s Framework and is listed in the "Binary link assembly with libraries" section and displayed on the ugly DerivedData path.

  • Application - depends on Framework_1 and Framework_2, which are included in the "Framework" area of โ€‹โ€‹the project and are indicated in the "Phase of the assembly of binary links with libraries". The output directory is again the wrong DerivedData path.

The problem is that the paths in the project file for reference frameworks are the ugly DerivedData path - they look like ../../ Library / Developer / XCode / DerivedData / Application-longuglyuniquestring / Build / Products / Release / Framework_1.framework.

If I copy the source to another directory or check it for version control and check it on another computer, these structure paths are no longer valid. They get regeneration. Related structures are displayed in the project as red.

Until then, when I want to create a workspace in another folder, the way to fix the problem is as follows:

  • Building a workspace - Framework_1.
  • Go to the โ€œProductsโ€ node for this structure and show it in Finder.
  • Copy the new ugly path.
  • Open the project files for Framework_2 and the application and correct the path for Framework_1 and Framework_2.
  • All red elements must be enabled and everything must be built.

This process is tedious, and I was lucky that the project file can be edited. This is worse for colleagues who do not understand what I know about project files, and just want to check the code and create it.

Is there something I need to do to build the output directory for the frameworks? I was inclined to change it, since an ugly path was recommended. Is there an option to copy files that I can use to place these frameworks in some predictable place compared to my workspace?

Any help would be greatly appreciated. I am sure that I am missing something simple - it does not make sense that the code extracted from the source or copied to another directory will not be simply created.

+6
source share
1 answer

There seems to be a way to set the DerivedData directory for each workspace - Xcode 4 - create an output directory

I just installed DerivedData relative to my workspace, and then edited the project files accordingly. The only drawback is that if I were to use one of these projects in a different workspace using the default DerivedData path, I would have to change them.

Many thanks to DaGaMs user - he got an advantage.

I still see bad behavior with Xcode 5: I have a project running on my machine. I copied it to a different, lower directory and confirmed that it was still working. Xcode came out and copied the contained directory to a network drive, and from there to another Mac. When I opened it on another Mac, it was as if I had not made some changes. Even worse, when I worked to fix this, Xcode staggered and added 6 extra "\" characters to each end of my FRAMEWORK_SEARCH_PATHS paths!

Part of the problem is that the subproject directories in my application are absolute, not relative. Projects are at the top of the "About group" workspace, so I changed the subprojects to the same attribute. This seems to have solved the problem, although for some reason, when I copy all the files to another machine, the Derived Data redirection does not go with it.

+2
source

Source: https://habr.com/ru/post/955681/


All Articles