Skip to content
This repository
Browse code

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

…nt it in the Readme
  • Loading branch information...
commit c591960e19ba7f75cbea258dd0e2c17a1d5003a5 1 parent a483bbe
Stig Brautaset authored
34 Scripts/InstallDocumentation.sh → InstallDocumentation.sh
... ... @@ -1,29 +1,35 @@
1 1 #!/bin/sh
2   -# See also http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
  2 +#
  3 +# Running this script installs the SBJson documentation so that it
  4 +# integrates with Xcode. It requires Doxygen to be installed.
  5 +#
  6 +# See also:
  7 +# http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
  8 +#
3 9
4 10 set -x
5 11
6 12 VERSION=$(agvtool mvers -terse1)
7   -
8   -DOXYFILE=$DERIVED_FILES_DIR/doxygen.config
  13 +TMPDIR=$(mktemp -d /tmp/$(basename $0).XXXXXX) || exit 1
  14 +DOXYFILE=$TMPDIR/doxygen.config
9 15 DOXYGEN=/Applications/Doxygen.app/Contents/Resources/doxygen
  16 +PROJECT=$(echo *.xcodeproj | cut -d. -f1)
10 17
11 18 if ! test -x $DOXYGEN ; then
12 19 echo "*** Install Doxygen to get documentation generated for you automatically ***"
13 20 exit 1
14 21 fi
15 22
16   -mkdir -p $DERIVED_FILES_DIR || exit 1
17   -
18   -# Create a doxygen configuration file with only the settings we care about
  23 +# Create a doxygen configuration file with only the settings we care
  24 +# about
19 25 $DOXYGEN -g - > $DOXYFILE
20 26
21 27 cat <<EOF >> $DOXYFILE
22 28
23   -PROJECT_NAME = $FULL_PRODUCT_NAME
  29 +PROJECT_NAME = $PROJECT
24 30 PROJECT_NUMBER = $VERSION
25   -OUTPUT_DIRECTORY = $DERIVED_FILES_DIR
26   -INPUT = $SOURCE_ROOT/Classes
  31 +OUTPUT_DIRECTORY = $TMPDIR
  32 +INPUT = Classes
27 33 FILE_PATTERNS = *.h *.m
28 34
29 35 HIDE_UNDOC_MEMBERS = YES
@@ -38,7 +44,7 @@ GENERATE_LATEX = NO
38 44 SEARCHENGINE = NO
39 45 GENERATE_HTML = YES
40 46 GENERATE_DOCSET = YES
41   -DOCSET_FEEDNAME = "$PROJECT.framework API Documentation"
  47 +DOCSET_FEEDNAME = "$PROJECT API Documentation"
42 48 DOCSET_BUNDLE_ID = org.brautaset.$PROJECT
43 49
44 50 EOF
@@ -48,16 +54,16 @@ EOF
48 54 $DOXYGEN $DOXYFILE
49 55
50 56 # make will invoke docsetutil. Take a look at the Makefile to see how this is done.
51   -make -C $DERIVED_FILES_DIR/html install
  57 +make -C $TMPDIR/html install
52 58
53 59 # Construct a temporary applescript file to tell Xcode to load a docset.
54   -rm -f $TEMP_DIR/loadDocSet.scpt
  60 +rm -f $TMPDIR/loadDocSet.scpt
55 61
56   -cat <<EOF > $TEMP_DIR/loadDocSet.scpt
  62 +cat <<EOF > $TMPDIR/loadDocSet.scpt
57 63 tell application "Xcode"
58 64 load documentation set with path "/Users/$USER/Library/Developer/Shared/Documentation/DocSets/org.brautaset.${PROJECT}.docset/"
59 65 end tell
60 66 EOF
61 67
62 68 # Run the load-docset applescript command.
63   -osascript $TEMP_DIR/loadDocSet.scpt
  69 +osascript $TMPDIR/loadDocSet.scpt
73 JSON.xcodeproj/project.pbxproj
@@ -7,17 +7,6 @@
7 7 objects = {
8 8
9 9 /* Begin PBXAggregateTarget section */
10   - BCC047160FB651AF00F9F2D3 /* DocSet */ = {
11   - isa = PBXAggregateTarget;
12   - buildConfigurationList = BCC047190FB651CD00F9F2D3 /* Build configuration list for PBXAggregateTarget "DocSet" */;
13   - buildPhases = (
14   - BCC047150FB651AF00F9F2D3 /* Run Script */,
15   - );
16   - dependencies = (
17   - );
18   - name = DocSet;
19   - productName = Documentation;
20   - };
21 10 BCF6393B12F5FD3B0094F9AE /* RefreshOnlineDocs */ = {
22 11 isa = PBXAggregateTarget;
23 12 buildConfigurationList = BCF6394012F5FD6E0094F9AE /* Build configuration list for PBXAggregateTarget "RefreshOnlineDocs" */;
@@ -25,7 +14,6 @@
25 14 BCF6393A12F5FD3B0094F9AE /* ShellScript */,
26 15 );
27 16 dependencies = (
28   - BCF6393F12F5FD4F0094F9AE /* PBXTargetDependency */,
29 17 );
30 18 name = RefreshOnlineDocs;
31 19 productName = "Refresh Online Docs";
@@ -127,13 +115,6 @@
127 115 remoteGlobalIDString = BC8778D9136CDE4400549A6D;
128 116 remoteInfo = JSON;
129 117 };
130   - BCF6393E12F5FD4F0094F9AE /* PBXContainerItemProxy */ = {
131   - isa = PBXContainerItemProxy;
132   - containerPortal = 53D229730C9611FF00276605 /* Project object */;
133   - proxyType = 1;
134   - remoteGlobalIDString = BCC047160FB651AF00F9F2D3;
135   - remoteInfo = "Generate DocSet";
136   - };
137 118 /* End PBXContainerItemProxy section */
138 119
139 120 /* Begin PBXFileReference section */
@@ -778,7 +759,6 @@
778 759 projectDirPath = "";
779 760 projectRoot = "";
780 761 targets = (
781   - BCC047160FB651AF00F9F2D3 /* DocSet */,
782 762 BCF6393B12F5FD3B0094F9AE /* RefreshOnlineDocs */,
783 763 BC8778D9136CDE4400549A6D /* JSON */,
784 764 BC8778ED136CDE4400549A6D /* JSONTests */,
@@ -842,25 +822,6 @@
842 822 shellPath = /bin/sh;
843 823 shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
844 824 };
845   - BCC047150FB651AF00F9F2D3 /* Run Script */ = {
846   - isa = PBXShellScriptBuildPhase;
847   - buildActionMask = 2147483647;
848   - files = (
849   - );
850   - inputPaths = (
851   - "$(SRCROOT)/Classes/*.h",
852   - "$(SRCROOT)/JSON-Info.plist",
853   - "$(SRCROOT)/Classes/*.m",
854   - );
855   - name = "Run Script";
856   - outputPaths = (
857   - "$(DERIVED_FILE_DIR)/doxygen.config",
858   - );
859   - runOnlyForDeploymentPostprocessing = 0;
860   - shellPath = /bin/sh;
861   - shellScript = "exec \"$SOURCE_ROOT/Scripts/InstallDocumentation.sh\"";
862   - showEnvVarsInLog = 0;
863   - };
864 825 BCF6393A12F5FD3B0094F9AE /* ShellScript */ = {
865 826 isa = PBXShellScriptBuildPhase;
866 827 buildActionMask = 2147483647;
@@ -958,11 +919,6 @@
958 919 target = BC8778D9136CDE4400549A6D /* JSON */;
959 920 targetProxy = BC8778F0136CDE4400549A6D /* PBXContainerItemProxy */;
960 921 };
961   - BCF6393F12F5FD4F0094F9AE /* PBXTargetDependency */ = {
962   - isa = PBXTargetDependency;
963   - target = BCC047160FB651AF00F9F2D3 /* DocSet */;
964   - targetProxy = BCF6393E12F5FD4F0094F9AE /* PBXContainerItemProxy */;
965   - };
966 922 /* End PBXTargetDependency section */
967 923
968 924 /* Begin PBXVariantGroup section */
@@ -1222,26 +1178,6 @@
1222 1178 };
1223 1179 name = Release;
1224 1180 };
1225   - BCC047170FB651AF00F9F2D3 /* Debug */ = {
1226   - isa = XCBuildConfiguration;
1227   - buildSettings = {
1228   - COPY_PHASE_STRIP = NO;
1229   - GCC_DYNAMIC_NO_PIC = NO;
1230   - PRODUCT_NAME = Documentation;
1231   - };
1232   - name = Debug;
1233   - };
1234   - BCC047180FB651AF00F9F2D3 /* Release */ = {
1235   - isa = XCBuildConfiguration;
1236   - buildSettings = {
1237   - COPY_PHASE_STRIP = YES;
1238   - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
1239   - GCC_ENABLE_FIX_AND_CONTINUE = NO;
1240   - PRODUCT_NAME = Documentation;
1241   - ZERO_LINK = NO;
1242   - };
1243   - name = Release;
1244   - };
1245 1181 BCF6393C12F5FD3B0094F9AE /* Debug */ = {
1246 1182 isa = XCBuildConfiguration;
1247 1183 buildSettings = {
@@ -1310,15 +1246,6 @@
1310 1246 defaultConfigurationIsVisible = 0;
1311 1247 defaultConfigurationName = Release;
1312 1248 };
1313   - BCC047190FB651CD00F9F2D3 /* Build configuration list for PBXAggregateTarget "DocSet" */ = {
1314   - isa = XCConfigurationList;
1315   - buildConfigurations = (
1316   - BCC047170FB651AF00F9F2D3 /* Debug */,
1317   - BCC047180FB651AF00F9F2D3 /* Release */,
1318   - );
1319   - defaultConfigurationIsVisible = 0;
1320   - defaultConfigurationName = Release;
1321   - };
1322 1249 BCF6394012F5FD6E0094F9AE /* Build configuration list for PBXAggregateTarget "RefreshOnlineDocs" */ = {
1323 1250 isa = XCConfigurationList;
1324 1251 buildConfigurations = (
7 Readme.md
Source Rendered
@@ -17,6 +17,13 @@ Features
17 17 * Optional sorted dictionary keys in JSON output.
18 18 * Configurable recursion depth limit for added security.
19 19
  20 +
  21 +
  22 +Install API documentation into Xcode
  23 +------------------------------------
  24 +
  25 +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.
  26 +
20 27 Links
21 28 -----
22 29

0 comments on commit c591960

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