{
if (projectName.isEmpty()) projectName="root";
if (bundleId.isEmpty()) bundleId="org.doxygen.Project";
if (feedName.isEmpty()) feedName="FeedName";
if (publisherId.isEmpty()) publisherId="PublisherId";
if (publisherName.isEmpty()) publisherName="PublisherName";
if (projectNumber.isEmpty()) projectNumber="ProjectNumber";
{
QFile makefile(mfName);
if (!makefile.open(IO_WriteOnly))
{
err(
"Could not open file %s for writing\n",mfName.data());
exit(1);
}
ts << "DOCSET_NAME=" << bundleId << ".docset\n"
"DOCSET_CONTENTS=$(DOCSET_NAME)/Contents\n"
"DOCSET_RESOURCES=$(DOCSET_CONTENTS)/Resources\n"
"DOCSET_DOCUMENTS=$(DOCSET_RESOURCES)/Documents\n"
"DESTDIR=~/Library/Developer/Shared/Documentation/DocSets\n"
"XCODE_INSTALL=\"$(shell xcode-select -print-path)\"\n"
"\n"
"all: docset\n"
"\n"
"docset:\n"
"\tmkdir -p $(DOCSET_DOCUMENTS)\n"
"\tcp Nodes.xml $(DOCSET_RESOURCES)\n"
"\tcp Tokens.xml $(DOCSET_RESOURCES)\n"
"\tcp Info.plist $(DOCSET_CONTENTS)\n"
"\ttar --exclude $(DOCSET_NAME) \\\n"
"\t --exclude Nodes.xml \\\n"
"\t --exclude Tokens.xml \\\n"
"\t --exclude Info.plist \\\n"
"\t --exclude Makefile -c -f - . \\\n"
"\t | (cd $(DOCSET_DOCUMENTS); tar xvf -)\n"
"\t$(XCODE_INSTALL)/usr/bin/docsetutil index $(DOCSET_NAME)\n"
"\trm -f $(DOCSET_DOCUMENTS)/Nodes.xml\n"
"\trm -f $(DOCSET_DOCUMENTS)/Info.plist\n"
"\trm -f $(DOCSET_DOCUMENTS)/Makefile\n"
"\trm -f $(DOCSET_RESOURCES)/Nodes.xml\n"
"\trm -f $(DOCSET_RESOURCES)/Tokens.xml\n"
"\n"
"clean:\n"
"\trm -rf $(DOCSET_NAME)\n"
"\n"
"install: docset\n"
"\tmkdir -p $(DESTDIR)\n"
"\tcp -R $(DOCSET_NAME) $(DESTDIR)\n"
"\n"
"uninstall:\n"
"\trm -rf $(DESTDIR)/$(DOCSET_NAME)\n"
"\n"
"always:\n";
}
{
QFile plist(plName);
if (!plist.open(IO_WriteOnly))
{
err(
"Could not open file %s for writing\n",plName.data());
exit(1);
}
ts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"\n"
"\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
"<plist version=\"1.0\">\n"
"<dict>\n"
" <key>CFBundleName</key>\n"
" <string>" << projectName << "</string>\n"
" <key>CFBundleIdentifier</key>\n"
" <string>" << bundleId << "</string>\n"
" <key>CFBundleVersion</key>\n"
" <string>" << projectNumber << "</string>\n"
" <key>DocSetFeedName</key>\n"
" <string>" << feedName << "</string>\n"
" <key>DocSetPublisherIdentifier</key>\n"
" <string>" << publisherId << "</string>\n"
" <key>DocSetPublisherName</key>\n"
" <string>" << publisherName << "</string>\n"
" <key>DashDocSetFamily</key>\n"
" <string>doxy</string>\n"
" <key>DocSetPlatformFamily</key>\n"
" <string>doxygen</string>\n"
"</dict>\n"
"</plist>\n";
}
if (!
m_nf->open(IO_WriteOnly))
{
err(
"Could not open file %s for writing\n",notes.data());
exit(1);
}
QCString indexName="index";
m_nts <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" <<
endl;
m_nts <<
"<DocSetNodes version=\"1.0\">" <<
endl;
m_tf =
new QFile(tokens);
if (!
m_tf->open(IO_WriteOnly))
{
err(
"Could not open file %s for writing\n",tokens.data());
exit(1);
}
m_tts <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" <<
endl;
}