Closed robbiehanson closed 8 years ago
Just curious, why isn't the --project-directory
option used by commands such as install
and update
sufficient?
If I understand correctly, the --project-directory
is to specify where the project itself resides. The --output-directory
says where to put the generated .h/.m files.
For example, let's say I have a project here: ~/Foo/Foo.xcworkspace
Normally then, running the pod keys generate
command will create the following files:
But if I instead run pod keys generate --output-directory=/Users/robbie/Foo/Temp/
, it will instead create:
This allows me to execute the following in a build script (executed as part of the Pods/Keys Target, and run BEFORE compiling the source files):
pod keys generate --output-directory=/Users/robbie/Foo/Temp/
cp
, and replace the official filesSide note: the --project-directory
option doesn't seem to be working for pod keys
commands. See issue #145
Hmm, I don't really see the benefit to this? It installs where it does now because that's the directory the generated pod needs to have its source files in
Motivation:
We're using cocoapods-keys in a project, and we automatically generate the .h/.m files during the build process (via a build script). This allows the developer to change key/value pairs as needed, and a simple "Build-and-Run" will automatically "do the right thing".
I.E. if they've changed a key/value pair, then simply compiling in Xcode, will automatically re-generate the corresponding XKeys.m file with the updated value. This helps reduce the cognitive overhead of using the system for the development team:
Steps before:
Steps after:
Although this currently works, it's less than optimal, as modifying the .h/.m files everytime results in recompiling several files every build. This added feature allows the user to direct the generated .h/.m files elsewhere. Which enables use of diff tool, and thus can avoid overwriting files unnecessarily.
Once this pull request is merged, I can also add a wiki page that demonstrates: