This repository has been archived by the owner on Oct 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 21a4bc3
Showing
5 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
xcderiveddata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright 2019 Read Evaluate Press, LLC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a | ||
copy of this software and associated documentation files (the "Software"), | ||
to deal in the Software without restriction, including without limitation | ||
the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
and/or sell copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
SHELL = /bin/bash | ||
|
||
prefix ?= /usr/local | ||
bindir ?= $(prefix)/bin | ||
srcdir = src | ||
|
||
.DEFAULT_GOAL = all | ||
|
||
.PHONY: all | ||
all: xcderiveddata | ||
|
||
xcderiveddata: $(srcdir)/xcderiveddata.bash | ||
@cp $< $@ | ||
@chmod +x $@ | ||
|
||
.PHONY: install | ||
install: xcderiveddata | ||
@install -d "$(bindir)" | ||
@install xcderiveddata "$(bindir)" | ||
|
||
.PHONY: uninstall | ||
uninstall: | ||
@rm -rf "$(bindir)/xcderiveddata" | ||
|
||
.PHONY: clean | ||
clean: | ||
@rm -f xcderiveddata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# xcderiveddata | ||
|
||
A command-line utility that prints the path of the derived data directory | ||
for the current Xcode project. | ||
|
||
## Requirements | ||
|
||
- Xcode | ||
|
||
## Command-Line Usage | ||
|
||
The `xcderiveddata` executable can be run from the command line | ||
from any directory with an Xcode project: | ||
|
||
```terminal | ||
$ find . -name "*.xcodeproj" -maxdepth 1 | ||
MyApp.xcodeproj | ||
$ xcderiveddata | ||
~/Library/Developer/Xcode/DerivedData/MyApp-abcdefghijklmnopqr1234567890 | ||
``` | ||
|
||
Any additional arguments are passed to `xcodebuild`, | ||
which can be used to set the target, scheme, and any other other options | ||
for the specified project or workspace: | ||
|
||
```terminal | ||
$ find . -name "*.xc*" -maxdepth 1 | ||
MyApp.xcodeproj | ||
MyFramework.xcodeproj | ||
MyWorkspace.xcworkspace | ||
$ xcderiveddata -workspace MyWorkspace.xcworkspace \ | ||
-scheme MyFramework | ||
~/Library/Developer/Xcode/DerivedData/MyFramework-abcdefghijklmnopqr1234567890 | ||
``` | ||
|
||
> **Note** | ||
> This command fails if any `xcodebuild` options are passed | ||
> that are incompatible with the `-showBuildSettings` option. | ||
### Installation | ||
|
||
#### Homebrew | ||
|
||
Run the following command to install using [homebrew](https://brew.sh/): | ||
|
||
```terminal | ||
$ brew install nshipster/formulae/xcderiveddata | ||
``` | ||
|
||
#### Manually | ||
|
||
Run the following commands to build and install manually: | ||
|
||
```terminal | ||
$ git clone https://github.com/NSHipster/xcderiveddata.git | ||
$ cd xcderiveddata | ||
$ make install | ||
``` | ||
|
||
## License | ||
|
||
MIT | ||
|
||
## Contact | ||
|
||
Mattt ([@mattt](https://twitter.com/mattt)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
if ! [ -x "$(command -v xcodebuild)" ]; then | ||
echo 'Error: xcodebuild is not installed.' >&2 | ||
exit 1 | ||
fi | ||
|
||
xcodebuild -showBuildSettings $@ | | ||
grep -m 1 "BUILD_DIR" | | ||
grep -oEi "\/.*" | | ||
sed 's#/Build/Products##' |