How do you reference the git repository root directory in Xcode build settings? - xcode

How do you reference the git repository root directory in Xcode build settings?
We have a project where our original source code comprises 39 modules (framework targets) spread around in various levels of subdirectories.
In addition we keep certain modules like Crashlytics in the repository root in a folder called "ThirdPartyFrameworks" and then we have "Carthage" also at the repository root.
Currently each framework references all third party dependencies through paths relative to each framework's project directory, e.g. $(PROJECT_DIR)/../../../Carthage/Build/iOS etc. However, if you want to reorganize the project, and move a project to a new spot, then all these kinds of links will break, since they're relative.
What I would greatly prefer to do is just have one shared config file that references these framework search paths like: $(GIT_ROOT)/Carthage and be done with it. However I don't see any way to reference the repo root or workspace root that way.
Does anyone know a way to do this...? Thanks.

Related

Maven not including class subfolder when changing build source directory

So I'm working on an old project that hasn't always been a Maven project, so the folder structure is not the Maven standard. Given this, in the POM was set that was not the folder that has all the source folders, but actually pointed directly at one of the source folders. This has been a pain since every Maven re-import I need to go change the project structure to have the sources be src/ and not src/folder1, src/folder2, src/folder3...
The fix was simple, to fix the path, but here comes the issue. In src/folder1/subfolder is Images folder, which contains images used by a class in subfolder. But now that no longer points to src/folder1 the Images folder no longer being included in the build output.
I can fix the issue by reverting the path and correcting it manually every time, but I'm here asking could I somehow keep the fix and still get the folder included too.

Which project files contain information that this is a maven project

There is a project on Spring. If I clone it from GitHub, then open it in IDEA, then it understands that this is a maven project, i.e. it highlights all the project folders with the right color - java, resources, etc. And if I just copy the source files of the project to another directory with all the folders, then IDEA does not perceive it as a maven project, but simply as a set of folders.
But on Github I don't see any other files except the source. And then where is all this information about the structure of the project stored?
That is, what files do I still need to copy so that the IDE recreates the entire folder structure as in the original project?
Usually, if it is a maven project, we use a pom.xml file. In case of gradle, we use build.gradle file.
Whenever a spring project is build, it reads one these files to get all dependancies.

Xcode Framework Search Paths not finding frameworks outside project directory

In a large monorepo of Cocoapod projects I have the following directory structure.
Project
Common
Foo.Framework
First Project
Project.Xcode
Second Project
Project.Xcode
The goal is that there are multiple Cocoapod projects and rather than have the same framework copied in multiple places within the First and Second project, I'd rather have it once in a Common folder in the parent directory, and then drag it into the project and set the framework search paths.
So I'm running into an issue where the linker cannot find the Foo.framework.
What should I set the framework search path to so that it correctly finds the framework.
If I include the framework inside the Project directories it doesn't run into any issues.
I had the same issue and solved it like following:
Go to Build Settings
Find the "Framework Search Paths"
Add $(PROJECT_DIR)/../your_directory
Use the recursive flag if the framework file isn't in the exact directory you selected)

Local non-mavenised SWC

I'm working on a project that requires a very complex maven build.
One swc we use is just for native Flash assets. All our assets are versioned separately in another git repo so I just want maven to include it as a local lib.
Until now we have been continuously uploading the swc to artifactory with each change and versioning it there. As all assets are versioned separately anyway this is a superphlues and arbitrary system.
I would just like to have it in a local 'lib' folder and not be versioned through maven. And I don't want to have to install to the .m2 folder either as this will not automatically pick up changes to the local file as far as I know. I just want the swc to be treated as the code is.
Is there a workaround for this?
Thanks in advance.
Apologies, I realise I never came back to this.
I eventually decided I was trying to do something that was not an intended use case.
In the end we just absorbed the code into the main project.

Location for 3rd party component that will be used during the build (gradle)

We have one project that reuses 3rd party war (it's shindig-server-2.0.2.war if anyone asks:). This war currently sits in project root and the current ant tasks unzips it into some temp folder, performs several changes (like applying fixes, modifies the web.xml etc.) and finally build the war from our sources and the war content. This 3rd party is checked into the source repo.
We are migrating to gradle. Where should we put this file in Maven directory structure?
It does not look it belongs to /src/main/resources as it is not packed withing the artifcat; also, imho it does not belong to /src, too. Should we have a /lib/resources folder in root where we could store such files?
I don't think the Maven directory structure defines a place for local dependencies, and since this is a Gradle build, it doesn't really matter either. I wouldn't put it under src, but lib sounds fine.

Resources