The CocoaPods runtime exposes a few environment variables, two of the most common (that I know of) are:
PODS_ROOT: Defines the absolute path to the Pods/ directory that CocoaPods creates for storing and downloads pods.
PODS_TARGET_SRCROOT: Defines the absolute path to the current targets root directory (where its .podspec is defined)
Currently cocoapods-bazel does inject the value for PODS_TARGET_SRCROOT since this is just the : string (current directory in a BUILD file). However, PODS_ROOT is not injected which should typically resolve to //Pods. Furthermore, we do no injection of these variables in a schemes environment. The PODS_TARGET_SRCROOT env var is only injected when used within an xcconfig.
This PR fixes a few of these issues and should close #13.
The changes are:
Inject PODS_ROOT and PODS_TARGET_SRCROOT whenever they are used in xcconfig variables.
Inject PODS_ROOT and PODS_TARGET_SRCROOT whenever they are used in .env of a target's scheme.
Add a test case which uses these cocoapods vars in a test scheme.
Summary
The CocoaPods runtime exposes a few environment variables, two of the most common (that I know of) are:
PODS_ROOT
: Defines the absolute path to thePods/
directory that CocoaPods creates for storing and downloads pods.PODS_TARGET_SRCROOT
: Defines the absolute path to the current targets root directory (where its .podspec is defined)Currently
cocoapods-bazel
does inject the value forPODS_TARGET_SRCROOT
since this is just the:
string (current directory in a BUILD file). However,PODS_ROOT
is not injected which should typically resolve to//Pods
. Furthermore, we do no injection of these variables in a schemes environment. ThePODS_TARGET_SRCROOT
env var is only injected when used within an xcconfig.This PR fixes a few of these issues and should close #13.
The changes are:
PODS_ROOT
andPODS_TARGET_SRCROOT
whenever they are used in xcconfig variables.PODS_ROOT
andPODS_TARGET_SRCROOT
whenever they are used in.env
of a target's scheme.