Skip to content
Browse files

Make the InstallDocumentation.sh script run outside Xcode, and docume…

…nt it in the Readme
  • Loading branch information...
1 parent a483bbe commit c591960e19ba7f75cbea258dd0e2c17a1d5003a5 @stig committed May 29, 2011
Showing with 27 additions and 87 deletions.
  1. +20 −14 {Scripts → }/InstallDocumentation.sh
  2. +0 −73 JSON.xcodeproj/project.pbxproj
  3. +7 −0 Readme.md
View
34 Scripts/InstallDocumentation.sh → InstallDocumentation.sh
@@ -1,29 +1,35 @@
#!/bin/sh
-# See also http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+#
+# Running this script installs the SBJson documentation so that it
+# integrates with Xcode. It requires Doxygen to be installed.
+#
+# See also:
+# http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+#
set -x
VERSION=$(agvtool mvers -terse1)
-
-DOXYFILE=$DERIVED_FILES_DIR/doxygen.config
+TMPDIR=$(mktemp -d /tmp/$(basename $0).XXXXXX) || exit 1
+DOXYFILE=$TMPDIR/doxygen.config
DOXYGEN=/Applications/Doxygen.app/Contents/Resources/doxygen
+PROJECT=$(echo *.xcodeproj | cut -d. -f1)
if ! test -x $DOXYGEN ; then
echo "*** Install Doxygen to get documentation generated for you automatically ***"
exit 1
fi
-mkdir -p $DERIVED_FILES_DIR || exit 1
-
-# Create a doxygen configuration file with only the settings we care about
+# Create a doxygen configuration file with only the settings we care
+# about
$DOXYGEN -g - > $DOXYFILE
cat <<EOF >> $DOXYFILE
-PROJECT_NAME = $FULL_PRODUCT_NAME
+PROJECT_NAME = $PROJECT
PROJECT_NUMBER = $VERSION
-OUTPUT_DIRECTORY = $DERIVED_FILES_DIR
-INPUT = $SOURCE_ROOT/Classes
+OUTPUT_DIRECTORY = $TMPDIR
+INPUT = Classes
FILE_PATTERNS = *.h *.m
HIDE_UNDOC_MEMBERS = YES
@@ -38,7 +44,7 @@ GENERATE_LATEX = NO
SEARCHENGINE = NO
GENERATE_HTML = YES
GENERATE_DOCSET = YES
-DOCSET_FEEDNAME = "$PROJECT.framework API Documentation"
+DOCSET_FEEDNAME = "$PROJECT API Documentation"
DOCSET_BUNDLE_ID = org.brautaset.$PROJECT
EOF
@@ -48,16 +54,16 @@ EOF
$DOXYGEN $DOXYFILE
# make will invoke docsetutil. Take a look at the Makefile to see how this is done.
-make -C $DERIVED_FILES_DIR/html install
+make -C $TMPDIR/html install
# Construct a temporary applescript file to tell Xcode to load a docset.
-rm -f $TEMP_DIR/loadDocSet.scpt
+rm -f $TMPDIR/loadDocSet.scpt
-cat <<EOF > $TEMP_DIR/loadDocSet.scpt
+cat <<EOF > $TMPDIR/loadDocSet.scpt
tell application "Xcode"
load documentation set with path "/Users/$USER/Library/Developer/Shared/Documentation/DocSets/org.brautaset.${PROJECT}.docset/"
end tell
EOF
# Run the load-docset applescript command.
-osascript $TEMP_DIR/loadDocSet.scpt
+osascript $TMPDIR/loadDocSet.scpt
View
73 JSON.xcodeproj/project.pbxproj
@@ -7,25 +7,13 @@
objects = {
/* Begin PBXAggregateTarget section */
- BCC047160FB651AF00F9F2D3 /* DocSet */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = BCC047190FB651CD00F9F2D3 /* Build configuration list for PBXAggregateTarget "DocSet" */;
- buildPhases = (
- BCC047150FB651AF00F9F2D3 /* Run Script */,
- );
- dependencies = (
- );
- name = DocSet;
- productName = Documentation;
- };
BCF6393B12F5FD3B0094F9AE /* RefreshOnlineDocs */ = {
isa = PBXAggregateTarget;
buildConfigurationList = BCF6394012F5FD6E0094F9AE /* Build configuration list for PBXAggregateTarget "RefreshOnlineDocs" */;
buildPhases = (
BCF6393A12F5FD3B0094F9AE /* ShellScript */,
);
dependencies = (
- BCF6393F12F5FD4F0094F9AE /* PBXTargetDependency */,
);
name = RefreshOnlineDocs;
productName = "Refresh Online Docs";
@@ -127,13 +115,6 @@
remoteGlobalIDString = BC8778D9136CDE4400549A6D;
remoteInfo = JSON;
};
- BCF6393E12F5FD4F0094F9AE /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 53D229730C9611FF00276605 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = BCC047160FB651AF00F9F2D3;
- remoteInfo = "Generate DocSet";
- };
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
@@ -778,7 +759,6 @@
projectDirPath = "";
projectRoot = "";
targets = (
- BCC047160FB651AF00F9F2D3 /* DocSet */,
BCF6393B12F5FD3B0094F9AE /* RefreshOnlineDocs */,
BC8778D9136CDE4400549A6D /* JSON */,
BC8778ED136CDE4400549A6D /* JSONTests */,
@@ -842,25 +822,6 @@
shellPath = /bin/sh;
shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
};
- BCC047150FB651AF00F9F2D3 /* Run Script */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- "$(SRCROOT)/Classes/*.h",
- "$(SRCROOT)/JSON-Info.plist",
- "$(SRCROOT)/Classes/*.m",
- );
- name = "Run Script";
- outputPaths = (
- "$(DERIVED_FILE_DIR)/doxygen.config",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "exec \"$SOURCE_ROOT/Scripts/InstallDocumentation.sh\"";
- showEnvVarsInLog = 0;
- };
BCF6393A12F5FD3B0094F9AE /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -958,11 +919,6 @@
target = BC8778D9136CDE4400549A6D /* JSON */;
targetProxy = BC8778F0136CDE4400549A6D /* PBXContainerItemProxy */;
};
- BCF6393F12F5FD4F0094F9AE /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = BCC047160FB651AF00F9F2D3 /* DocSet */;
- targetProxy = BCF6393E12F5FD4F0094F9AE /* PBXContainerItemProxy */;
- };
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@@ -1222,26 +1178,6 @@
};
name = Release;
};
- BCC047170FB651AF00F9F2D3 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- PRODUCT_NAME = Documentation;
- };
- name = Debug;
- };
- BCC047180FB651AF00F9F2D3 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- PRODUCT_NAME = Documentation;
- ZERO_LINK = NO;
- };
- name = Release;
- };
BCF6393C12F5FD3B0094F9AE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -1310,15 +1246,6 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- BCC047190FB651CD00F9F2D3 /* Build configuration list for PBXAggregateTarget "DocSet" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- BCC047170FB651AF00F9F2D3 /* Debug */,
- BCC047180FB651AF00F9F2D3 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
BCF6394012F5FD6E0094F9AE /* Build configuration list for PBXAggregateTarget "RefreshOnlineDocs" */ = {
isa = XCConfigurationList;
buildConfigurations = (
View
7 Readme.md
@@ -17,6 +17,13 @@ Features
* Optional sorted dictionary keys in JSON output.
* Configurable recursion depth limit for added security.
+
+
+Install API documentation into Xcode
+------------------------------------
+
+From the top-level project directory, run the `./InstallDocumentation.sh` program. This compiles the documentation and installs it so it integrates with Xcode. Now open Xcode documentation and search for SBJson. You should see a lot of the classes.
+
Links
-----

0 comments on commit c591960

Please sign in to comment.
Something went wrong with that request. Please try again.