From c2289914a144ad9a700e54c2baf7104382490010 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 6 Feb 2024 08:09:42 -0800 Subject: [PATCH] build: add an initial CMake based build system for DocC Using this (along with its dependencies) allows us to significantly reduce the build times for the Swift toolchain (~7% of the overall build time in local testing). --- CMakeLists.txt | 33 ++ Sources/CMakeLists.txt | 13 + Sources/SwiftDocC/CMakeLists.txt | 489 ++++++++++++++++++++++ Sources/SwiftDocCUtilities/CMakeLists.txt | 74 ++++ Sources/docc/CMakeLists.txt | 16 + 5 files changed, 625 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 Sources/CMakeLists.txt create mode 100644 Sources/SwiftDocC/CMakeLists.txt create mode 100644 Sources/SwiftDocCUtilities/CMakeLists.txt create mode 100644 Sources/docc/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..d8e32e49da --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,33 @@ +#[[ +This source file is part of the swift-format open source project + +Copyright (c) 2024 Apple Inc. and the DocC project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See https://swift.org/LICENSE.txt for license information +#]] + +cmake_minimum_required(VERSION 3.24) + +project(docc + LANGUAGES Swift) + +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift) +set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY MultiThreadedDLL) + +include(GNUInstallDirs) + +find_package(ArgumentParser CONFIG) +find_package(SwiftCrypto CONFIG) +find_package(SwiftMarkdown CONFIG) +find_package(LMDB CONFIG) +find_package(SymbolKit CONFIG) +find_package(cmark-gfm CONFIG) + +add_compile_options("$<$:-package-name;SwiftDocC>") + +add_subdirectory(Sources) diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt new file mode 100644 index 0000000000..8bcee6d68a --- /dev/null +++ b/Sources/CMakeLists.txt @@ -0,0 +1,13 @@ +#[[ +This source file is part of the swift-format open source project + +Copyright (c) 2024 Apple Inc. and the DocC project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See https://swift.org/LICENSE.txt for license information +#]] + +add_subdirectory(SwiftDocC) +add_subdirectory(SwiftDocCUtilities) +add_subdirectory(docc) + diff --git a/Sources/SwiftDocC/CMakeLists.txt b/Sources/SwiftDocC/CMakeLists.txt new file mode 100644 index 0000000000..892c11a9eb --- /dev/null +++ b/Sources/SwiftDocC/CMakeLists.txt @@ -0,0 +1,489 @@ +#[[ +This source file is part of the swift-format open source project + +Copyright (c) 2024 Apple Inc. and the DocC project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See https://swift.org/LICENSE.txt for license information +#]] + +add_library(SwiftDocC + Benchmark/Benchmark.swift + Benchmark/BenchmarkResults.swift + Benchmark/Metrics.swift + Benchmark/Metrics/Duration.swift + Benchmark/Metrics/ExternalTopicsHash.swift + Benchmark/Metrics/OutputSize.swift + Benchmark/Metrics/PeakMemory.swift + Benchmark/Metrics/TopicAnchorHash.swift + Benchmark/Metrics/TopicGraphHash.swift + "Catalog Processing/GeneratedCurationWriter.swift" + Checker/Checker.swift + Checker/Checkers/AbstractContainsFormattedTextOnly.swift + Checker/Checkers/DuplicateTopicsSection.swift + Checker/Checkers/InvalidAdditionalTitle.swift + Checker/Checkers/MissingAbstract.swift + Checker/Checkers/NonInclusiveLanguageChecker.swift + Checker/Checkers/NonOverviewHeadingChecker.swift + Checker/Checkers/SeeAlsoInTopicsHeadingChecker.swift + Converter/DocumentationContextConverter.swift + Converter/DocumentationNodeConverter.swift + Converter/RenderNode+Coding.swift + Converter/Rewriter/RemoveAutomaticallyCuratedSeeAlsoSectionsTransformation.swift + Converter/Rewriter/RemoveHierarchyTransformation.swift + Converter/Rewriter/RemoveUnusedReferencesTransformation.swift + Converter/Rewriter/RenderNodeTransformationComposition.swift + Converter/Rewriter/RenderNodeTransformationContext.swift + Converter/Rewriter/RenderNodeTransformer.swift + Converter/Rewriter/RenderNodeTransforming.swift + Converter/TopicRenderReferenceEncoder.swift + Coverage/DocumentationCoverageOptions.swift + DocumentationService/Convert/ConvertService.swift + DocumentationService/Convert/ConvertService+DataProvider.swift + "DocumentationService/Convert/Fallback Link Resolution/ConvertServiceFallbackResolver.swift" + "DocumentationService/Convert/Symbol Link Resolution/AbsoluteSymbolLink.swift" + "DocumentationService/Convert/Symbol Link Resolution/DocCSymbolRepresentable.swift" + "DocumentationService/Convert/Symbol Link Resolution/LinkCompletionTools.swift" + DocumentationService/DocumentationServer+createDefaultServer.swift + DocumentationService/ExternalReferenceResolverServiceClient.swift + DocumentationService/Models/DocumentationServer.swift + DocumentationService/Models/DocumentationServer+Message.swift + DocumentationService/Models/DocumentationServer+MessageType.swift + DocumentationService/Models/DocumentationServerError.swift + DocumentationService/Models/DocumentationServerProtocol.swift + DocumentationService/Models/DocumentationService.swift + DocumentationService/Models/Services/Convert/ConvertRequest.swift + DocumentationService/Models/Services/Convert/ConvertRequestContextWrapper.swift + DocumentationService/Models/Services/Convert/ConvertResponse.swift + DocumentationService/Models/Services/Convert/ConvertServiceError.swift + Indexing/Indexable.swift + Indexing/IndexingError.swift + Indexing/IndexingRecord.swift + Indexing/Navigator/AvailabilityIndex.swift + Indexing/Navigator/AvailabilityIndex+Ext.swift + Indexing/Navigator/NavigatorIndex.swift + Indexing/Navigator/NavigatorIndex+Ext.swift + Indexing/Navigator/NavigatorItem.swift + Indexing/Navigator/NavigatorTree.swift + Indexing/Navigator/RenderNode+NavigatorIndex.swift + Indexing/RenderBlockContent+TextIndexing.swift + Indexing/RenderIndexJSON/RenderIndex.swift + Indexing/RenderInlineContent+TextIndexing.swift + Indexing/RenderNode+Indexable.swift + Indexing/RenderNode+Relationships.swift + Indexing/RenderSection+TextIndexing.swift + Indexing/TutorialSectionsRenderSection+Indexable.swift + "Infrastructure/Bundle Assets/BundleData.swift" + "Infrastructure/Bundle Assets/DataAssetManager.swift" + "Infrastructure/Bundle Assets/SVGIDExtractor.swift" + "Infrastructure/Communication/Code colors/CodeColors.swift" + "Infrastructure/Communication/Code colors/CodeColorsPreferenceKey.swift" + "Infrastructure/Communication/Code colors/SRGBColor.swift" + Infrastructure/Communication/CommunicationBridge.swift + Infrastructure/Communication/Foundation/AnyCodable.swift + Infrastructure/Communication/Foundation/JSON.swift + Infrastructure/Communication/Message.swift + Infrastructure/Communication/Message+Codable.swift + Infrastructure/Communication/MessageType.swift + Infrastructure/Communication/WebKitCommunicationBridge.swift + Infrastructure/ContentCache.swift + Infrastructure/Context/Deprecated/DocumentationContext+Deprecated.swift + Infrastructure/Context/DocumentationContext+Configuration.swift + Infrastructure/ConvertActionConverter.swift + Infrastructure/ConvertOutputConsumer.swift + Infrastructure/CoverageDataEntry.swift + Infrastructure/Diagnostics/ANSIAnnotation.swift + Infrastructure/Diagnostics/Diagnostic.swift + Infrastructure/Diagnostics/DiagnosticConsoleWriter.swift + Infrastructure/Diagnostics/DiagnosticConsumer.swift + Infrastructure/Diagnostics/DiagnosticEngine.swift + Infrastructure/Diagnostics/DiagnosticFile.swift + Infrastructure/Diagnostics/DiagnosticFileWriter.swift + Infrastructure/Diagnostics/DiagnosticFormattingOptions.swift + Infrastructure/Diagnostics/DiagnosticNote.swift + Infrastructure/Diagnostics/DiagnosticSeverity.swift + Infrastructure/Diagnostics/ParseDirectiveArguments.swift + Infrastructure/Diagnostics/Problem.swift + Infrastructure/Diagnostics/Replacement.swift + Infrastructure/Diagnostics/Solution.swift + Infrastructure/Diagnostics/SourcePosition.swift + Infrastructure/Diagnostics/TerminalHelper.swift + Infrastructure/DocumentationBundle.swift + Infrastructure/DocumentationBundle+Identifier.swift + Infrastructure/DocumentationBundleFileTypes.swift + Infrastructure/DocumentationContext.swift + Infrastructure/DocumentationContext+Breadcrumbs.swift + Infrastructure/DocumentationConverter.swift + Infrastructure/DocumentationCurator.swift + Infrastructure/Extensions/KindIdentifier+Curation.swift + Infrastructure/Extensions/SymbolGraph.Symbol.Location+URL.swift + "Infrastructure/External Data/ExternalDocumentationSource.swift" + "Infrastructure/External Data/ExternalMetadata.swift" + "Infrastructure/External Data/GlobalExternalSymbolResolver.swift" + "Infrastructure/External Data/OutOfProcessReferenceResolver.swift" + "Infrastructure/Input Discovery/DataProvider.swift" + "Infrastructure/Input Discovery/DocumentationInputsProvider.swift" + "Infrastructure/Link Resolution/ExternalPathHierarchyResolver.swift" + "Infrastructure/Link Resolution/LinkResolver.swift" + "Infrastructure/Link Resolution/PathHierarchy.swift" + "Infrastructure/Link Resolution/PathHierarchy+DisambiguatedPaths.swift" + "Infrastructure/Link Resolution/PathHierarchy+Dump.swift" + "Infrastructure/Link Resolution/PathHierarchy+Error.swift" + "Infrastructure/Link Resolution/PathHierarchy+Find.swift" + "Infrastructure/Link Resolution/PathHierarchy+PathComponent.swift" + "Infrastructure/Link Resolution/PathHierarchy+Serialization.swift" + "Infrastructure/Link Resolution/PathHierarchy+TypeSignature.swift" + "Infrastructure/Link Resolution/PathHierarchy+TypeSignatureDisambiguation.swift" + "Infrastructure/Link Resolution/PathHierarchyBasedLinkResolver.swift" + "Infrastructure/Link Resolution/PathHierarchyBasedLinkResolver+Breadcrumbs.swift" + "Infrastructure/Link Resolution/PathHierarchyBasedLinkResolver+Overloads.swift" + Infrastructure/NodeURLGenerator.swift + "Infrastructure/Symbol Graph/AccessControl+Comparable.swift" + "Infrastructure/Symbol Graph/ExtendedTypeFormatExtension.swift" + "Infrastructure/Symbol Graph/ExtendedTypeFormatTransformation.swift" + "Infrastructure/Symbol Graph/GeneratedDocumentationTopics.swift" + "Infrastructure/Symbol Graph/ResolvedTopicReference+Symbol.swift" + "Infrastructure/Symbol Graph/SymbolGraphConcurrentDecoder.swift" + "Infrastructure/Symbol Graph/SymbolGraphLoader.swift" + "Infrastructure/Symbol Graph/SymbolGraphRelationshipsBuilder.swift" + "Infrastructure/Symbol Graph/SymbolReference.swift" + "Infrastructure/Symbol Graph/UnresolvedTopicReference+Symbol.swift" + "Infrastructure/Topic Graph/AutomaticCuration.swift" + "Infrastructure/Topic Graph/TopicGraph.swift" + Infrastructure/Workspace/DefaultAvailability.swift + Infrastructure/Workspace/DocumentationBundle+Info.swift + Infrastructure/Workspace/DocumentationWorkspace.swift + Infrastructure/Workspace/DocumentationWorkspaceDataProvider.swift + Infrastructure/Workspace/FeatureFlags+Info.swift + Infrastructure/Workspace/FileSystemProvider.swift + Infrastructure/Workspace/GeneratedDataProvider.swift + Infrastructure/Workspace/LocalFileSystemDataProvider.swift + Infrastructure/Workspace/LocalFileSystemDataProvider+BundleDiscovery.swift + Infrastructure/Workspace/PrebuiltLocalFileSystemDataProvider.swift + LinkTargets/LinkDestinationSummary.swift + Model/AnchorSection.swift + Model/AvailabilityParser.swift + Model/BuildMetadata.swift + Model/Content/AttributedCodeListing.swift + Model/DocumentationMarkup.swift + Model/DocumentationNode.swift + Model/Identifier.swift + Model/Kind.swift + Model/Markup+parsing.swift + Model/Name.swift + Model/ParametersAndReturnValidator.swift + Model/Rendering/Content/Extensions/RenderTermLists.swift + Model/Rendering/Content/RenderBlockContent.swift + Model/Rendering/Content/RenderBlockContent+Capitalization.swift + Model/Rendering/Content/RenderContentMetadata.swift + Model/Rendering/Content/RenderInlineContent.swift + Model/Rendering/Diffing/AnyRenderReference.swift + Model/Rendering/Diffing/AnyRenderSection.swift + Model/Rendering/Diffing/DifferenceBuilder.swift + Model/Rendering/Diffing/Differences.swift + Model/Rendering/Diffing/RenderNode+Diffable.swift + Model/Rendering/DocumentationContentRenderer.swift + Model/Rendering/LinkTitleResolver.swift + "Model/Rendering/Navigation Tree/RenderHierarchy.swift" + "Model/Rendering/Navigation Tree/RenderHierarchyChapter.swift" + "Model/Rendering/Navigation Tree/RenderHierarchyLandmark.swift" + "Model/Rendering/Navigation Tree/RenderHierarchyTranslator.swift" + "Model/Rendering/Navigation Tree/RenderHierarchyTutorial.swift" + "Model/Rendering/Navigation Tree/RenderReferenceHierarchy.swift" + "Model/Rendering/Navigation Tree/RenderTutorialsHierarchy.swift" + Model/Rendering/PresentationURLGenerator.swift + Model/Rendering/References/AssetReferences.swift + Model/Rendering/References/FileReference.swift + Model/Rendering/References/ImageReference.swift + Model/Rendering/References/LinkReference.swift + Model/Rendering/References/MediaReference.swift + Model/Rendering/References/RenderReference.swift + Model/Rendering/References/TopicColor.swift + Model/Rendering/References/TopicImage.swift + Model/Rendering/References/TopicRenderReference.swift + Model/Rendering/References/UnresolvedReference.swift + Model/Rendering/References/VideoReference.swift + Model/Rendering/RenderContentCompiler.swift + Model/Rendering/RenderContentConvertible.swift + Model/Rendering/RenderContext.swift + Model/Rendering/RenderNode.swift + Model/Rendering/RenderNode.Tag.swift + Model/Rendering/RenderNode/AnyMetadata.swift + Model/Rendering/RenderNode/CodableContentSection.swift + Model/Rendering/RenderNode/CodableRenderReference.swift + Model/Rendering/RenderNode/CodableRenderSection.swift + Model/Rendering/RenderNode/RenderMetadata.swift + Model/Rendering/RenderNode/RenderNode+Codable.swift + Model/Rendering/RenderNodeTranslator.swift + Model/Rendering/RenderNodeVariant.swift + Model/Rendering/RenderReferenceStore.swift + Model/Rendering/RenderSection.swift + Model/Rendering/RenderSectionTranslator/AttributesSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/DeclarationsSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/DictionaryKeysSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/DiscussionSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/HTTPBodySectionTranslator.swift + Model/Rendering/RenderSectionTranslator/HTTPEndpointSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/HTTPParametersSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/HTTPResponsesSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/MentionsSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/ParametersSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/PlistDetailsSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/PossibleValuesSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/RenderSectionTranslator.swift + Model/Rendering/RenderSectionTranslator/ReturnsSectionTranslator.swift + Model/Rendering/SemanticVersion.swift + Model/Rendering/Symbol/AttributesRenderSection.swift + Model/Rendering/Symbol/AvailabilityRenderMetadataItem.swift + Model/Rendering/Symbol/AvailabilitySortOrder.swift + Model/Rendering/Symbol/ConformanceSection.swift + Model/Rendering/Symbol/ContentRenderSection.swift + Model/Rendering/Symbol/DeclarationRenderSection+SymbolGraph.swift + Model/Rendering/Symbol/DeclarationsRenderSection.swift + Model/Rendering/Symbol/DiffAvailability.swift + Model/Rendering/Symbol/MentionsRenderSection.swift + Model/Rendering/Symbol/ParameterRenderSection.swift + Model/Rendering/Symbol/PossibleValuesRenderSection.swift + Model/Rendering/Symbol/PropertiesRenderSection.swift + Model/Rendering/Symbol/PropertyListDetailsRenderSection.swift + Model/Rendering/Symbol/RelationshipsRenderSection.swift + Model/Rendering/Symbol/RESTBodyRenderSection.swift + Model/Rendering/Symbol/RESTEndpointRenderSection.swift + Model/Rendering/Symbol/RESTExampleRenderSection.swift + Model/Rendering/Symbol/RESTParametersRenderSection.swift + Model/Rendering/Symbol/RESTResponseRenderSection.swift + Model/Rendering/Symbol/SampleDownloadSection.swift + Model/Rendering/Symbol/TaskGroupRenderSection.swift + Model/Rendering/TopicsSectionStyle.swift + "Model/Rendering/Tutorial Article/TutorialArticleSection.swift" + "Model/Rendering/Tutorials Overview/Resources/RenderTile.swift" + "Model/Rendering/Tutorials Overview/Sections/CallToActionSection.swift" + "Model/Rendering/Tutorials Overview/Sections/ContentAndMediaGroupSection.swift" + "Model/Rendering/Tutorials Overview/Sections/ContentAndMediaSection.swift" + "Model/Rendering/Tutorials Overview/Sections/ResourcesRenderSection.swift" + "Model/Rendering/Tutorials Overview/Sections/VolumeRenderSection.swift" + Model/Rendering/Tutorial/LineHighlighter.swift + Model/Rendering/Tutorial/References/DownloadReference.swift + Model/Rendering/Tutorial/References/XcodeRequirementReference.swift + Model/Rendering/Tutorial/Sections/IntroRenderSection.swift + Model/Rendering/Tutorial/Sections/TutorialAssessmentsRenderSection.swift + Model/Rendering/Tutorial/Sections/TutorialSectionsRenderSection.swift + Model/Rendering/Variants/JSONPatchApplier.swift + Model/Rendering/Variants/JSONPatchOperation.swift + Model/Rendering/Variants/JSONPointer.swift + Model/Rendering/Variants/PatchOperation.swift + Model/Rendering/Variants/RenderNodeVariantOverridesApplier.swift + Model/Rendering/Variants/VariantCollection.swift + Model/Rendering/Variants/VariantCollection+Coding.swift + Model/Rendering/Variants/VariantCollection+Symbol.swift + Model/Rendering/Variants/VariantCollection+Variant.swift + Model/Rendering/Variants/VariantContainer.swift + Model/Rendering/Variants/VariantOverride.swift + Model/Rendering/Variants/VariantOverrides.swift + Model/Rendering/Variants/VariantPatchOperation.swift + Model/Section/Section.swift + Model/Section/Sections/Abstract.swift + Model/Section/Sections/AutomaticTaskGroupSection.swift + Model/Section/Sections/DefaultImplementations.swift + Model/Section/Sections/DeprecatedSection.swift + Model/Section/Sections/DictionaryKeysSection.swift + Model/Section/Sections/Discussion.swift + Model/Section/Sections/GroupedSection.swift + Model/Section/Sections/HTTPBodySection.swift + Model/Section/Sections/HTTPEndpointSection.swift + Model/Section/Sections/HTTPParametersSection.swift + Model/Section/Sections/HTTPResponsesSection.swift + Model/Section/Sections/ParametersSection.swift + Model/Section/Sections/PropertyListPossibleValuesSection.swift + Model/Section/Sections/Relationships.swift + Model/Section/Sections/ReturnsSection.swift + Model/Section/Sections/SeeAlso.swift + Model/Section/Sections/Topics.swift + Model/Semantics/DictionaryKey.swift + Model/Semantics/HTTPBody.swift + Model/Semantics/HTTPParameter.swift + Model/Semantics/HTTPResponse.swift + Model/Semantics/LegacyTag.swift + Model/Semantics/Parameter.swift + Model/Semantics/Return.swift + Model/Semantics/Throw.swift + Model/SourceLanguage.swift + Model/TaskGroup.swift + Semantics/Abstracted.swift + Semantics/Article/Article.swift + Semantics/Article/ArticleSymbolMentions.swift + Semantics/Article/MarkupConvertible.swift + Semantics/Comment.swift + Semantics/ContentAndMedia.swift + Semantics/DirectiveConvertable.swift + Semantics/DirectiveInfrastructure/AutomaticDirectiveConvertible.swift + Semantics/DirectiveInfrastructure/ChildDirectiveWrapper.swift + Semantics/DirectiveInfrastructure/ChildMarkdownWrapper.swift + Semantics/DirectiveInfrastructure/DirectiveArgumentValueConvertible.swift + Semantics/DirectiveInfrastructure/DirectiveArgumentWrapper.swift + Semantics/DirectiveInfrastructure/DirectiveIndex.swift + Semantics/DirectiveInfrastructure/DirectiveMirror.swift + Semantics/DirectiveInfrastructure/MarkupContaining.swift + Semantics/DirectiveParser.swift + Semantics/ExternalLinks/ExternalMarkupReferenceWalker.swift + Semantics/ExternalLinks/ExternalReferenceWalker.swift + "Semantics/General Purpose Analyses/DeprecatedArgument.swift" + "Semantics/General Purpose Analyses/Extract.swift" + "Semantics/General Purpose Analyses/HasArgumentOfType.swift" + "Semantics/General Purpose Analyses/HasAtLeastOne.swift" + "Semantics/General Purpose Analyses/HasAtMostOne.swift" + "Semantics/General Purpose Analyses/HasContent.swift" + "Semantics/General Purpose Analyses/HasExactlyOne.swift" + "Semantics/General Purpose Analyses/HasOnlyKnownArguments.swift" + "Semantics/General Purpose Analyses/HasOnlyKnownDirectives.swift" + "Semantics/General Purpose Analyses/HasOnlySequentialHeadings.swift" + Semantics/Graph/SymbolKind.Swift.swift + Semantics/Intro.swift + Semantics/Landmark.swift + Semantics/Layout.swift + Semantics/MarkupContainer.swift + Semantics/MarkupReferenceResolver.swift + Semantics/Media/ImageMedia.swift + Semantics/Media/Media.swift + Semantics/Media/VideoMedia.swift + Semantics/Metadata/AlternateRepresentation.swift + Semantics/Metadata/Availability.swift + Semantics/Metadata/CallToAction.swift + Semantics/Metadata/CustomMetadata.swift + Semantics/Metadata/DisplayName.swift + Semantics/Metadata/DocumentationExtension.swift + Semantics/Metadata/Metadata.swift + Semantics/Metadata/PageColor.swift + Semantics/Metadata/PageImage.swift + Semantics/Metadata/PageKind.swift + Semantics/Metadata/SupportedLanguage.swift + Semantics/Metadata/TechnologyRoot.swift + Semantics/Metadata/TitleHeading.swift + Semantics/Options/AutomaticArticleSubheading.swift + Semantics/Options/AutomaticSeeAlso.swift + Semantics/Options/AutomaticTitleHeading.swift + Semantics/Options/Options.swift + Semantics/Options/TopicsVisualStyle.swift + Semantics/Redirect.swift + Semantics/Redirected.swift + Semantics/Reference/Links.swift + Semantics/Reference/Row.swift + Semantics/Reference/Small.swift + Semantics/Reference/TabNavigator.swift + Semantics/ReferenceResolver.swift + Semantics/Semantic.swift + Semantics/SemanticAnalysis.swift + Semantics/SemanticAnalyzer.swift + Semantics/Snippets/Snippet.swift + Semantics/Symbol/DeprecationSummary.swift + Semantics/Symbol/DocumentationDataVariants.swift + Semantics/Symbol/DocumentationDataVariants+SymbolGraphSymbol.swift + Semantics/Symbol/PlatformName.swift + Semantics/Symbol/Relationship.swift + Semantics/Symbol/Symbol.swift + Semantics/Symbol/UnifiedSymbol+Extensions.swift + Semantics/Technology/Resources/Resources.swift + Semantics/Technology/Resources/Tile.swift + Semantics/Technology/TutorialTableOfContents.swift + Semantics/Technology/Volume/Chapter/Chapter.swift + Semantics/Technology/Volume/Chapter/TutorialReference.swift + Semantics/Technology/Volume/Volume.swift + Semantics/TechnologyBound.swift + Semantics/Timed.swift + Semantics/Titled.swift + "Semantics/Tutorial/Assessments/Multiple Choice/Choice/Choice.swift" + "Semantics/Tutorial/Assessments/Multiple Choice/Choice/Justification.swift" + "Semantics/Tutorial/Assessments/Multiple Choice/MultipleChoice.swift" + Semantics/Tutorial/Assessments/Assessments.swift + Semantics/Tutorial/Tasks/Steps/Code.swift + Semantics/Tutorial/Tasks/Steps/Step.swift + Semantics/Tutorial/Tasks/Steps/Steps.swift + Semantics/Tutorial/Tasks/TutorialSection.swift + Semantics/Tutorial/Tutorial.swift + Semantics/Tutorial/XcodeRequirement.swift + Semantics/TutorialArticle/Stack.swift + Semantics/TutorialArticle/TutorialArticle.swift + Semantics/Visitor/SemanticVisitor.swift + Semantics/Walker/SemanticWalker.swift + Semantics/Walker/Walkers/SemanticTreeDumper.swift + Servers/DocumentationSchemeHandler.swift + Servers/FileServer.swift + SourceRepository/SourceRepository.swift + Utility/Checksum.swift + Utility/Collection+ConcurrentPerform.swift + Utility/CollectionChanges.swift + Utility/DataStructures/BidirectionalMap.swift + Utility/DataStructures/GroupedSequence.swift + Utility/DispatchGroup+Async.swift + Utility/Errors/DescribedError.swift + Utility/Errors/ErrorWithProblems.swift + Utility/ExternalIdentifier.swift + Utility/FeatureFlags.swift + Utility/FileManagerProtocol.swift + Utility/FileManagerProtocol+FilesSequence.swift + Utility/FoundationExtensions/Array+baseType.swift + Utility/FoundationExtensions/AutoreleasepoolShim.swift + Utility/FoundationExtensions/CharacterSet.swift + Utility/FoundationExtensions/Collection+indexed.swift + Utility/FoundationExtensions/Dictionary+TypedValues.swift + Utility/FoundationExtensions/NoOpSignposterShim.swift + Utility/FoundationExtensions/Optional+baseType.swift + Utility/FoundationExtensions/PlainTextShim.swift + Utility/FoundationExtensions/RangeReplaceableCollection+Group.swift + Utility/FoundationExtensions/Sequence+Categorize.swift + Utility/FoundationExtensions/Sequence+FirstMap.swift + Utility/FoundationExtensions/Sequence+RenderBlockContentElemenet.swift + Utility/FoundationExtensions/SortByKeyPath.swift + Utility/FoundationExtensions/String+Capitalization.swift + Utility/FoundationExtensions/String+Hashing.swift + Utility/FoundationExtensions/String+Path.swift + Utility/FoundationExtensions/String+SingleQuoted.swift + Utility/FoundationExtensions/String+Splitting.swift + Utility/FoundationExtensions/String+Whitespace.swift + Utility/FoundationExtensions/StringCollection+List.swift + Utility/FoundationExtensions/URL+IsAbsoluteWebURL.swift + Utility/FoundationExtensions/URL+Relative.swift + Utility/FoundationExtensions/URL+WithFragment.swift + Utility/FoundationExtensions/URL+WithoutHostAndPortAndScheme.swift + Utility/Graphs/DirectedGraph.swift + Utility/Graphs/DirectedGraph+Cycles.swift + Utility/Graphs/DirectedGraph+Paths.swift + Utility/Graphs/DirectedGraph+Traversal.swift + Utility/Language/EnglishLanguage.swift + Utility/Language/NativeLanguage.swift + Utility/ListItemUpdatable.swift + Utility/LMDB/LMDB.swift + Utility/LMDB/LMDB+Database.swift + Utility/LMDB/LMDB+Environment.swift + Utility/LMDB/LMDB+Error.swift + Utility/LMDB/LMDB+Transaction.swift + Utility/LogHandle.swift + Utility/MarkupExtensions/AnyLink.swift + Utility/MarkupExtensions/BlockDirectiveExtensions.swift + Utility/MarkupExtensions/DocumentExtensions.swift + Utility/MarkupExtensions/ImageExtensions.swift + Utility/MarkupExtensions/ListItemExtractor.swift + Utility/MarkupExtensions/MarkupChildrenExtensions.swift + Utility/MarkupExtensions/SourceRangeExtensions.swift + Utility/NearMiss.swift + Utility/RenderNodeDataExtractor.swift + Utility/SemanticVersion+Comparable.swift + Utility/SimpleLog.swift + Utility/SymbolGraphAvailability+Filter.swift + Utility/Synchronization.swift + Utility/ValidatedURL.swift + Utility/Version.swift) +target_link_libraries(SwiftDocC PUBLIC + SwiftMarkdown::Markdown + DocC::SymbolKit + LMDB::CLMDB + Crypto) +# FIXME(compnerd) workaround leaking dependencies +target_link_libraries(SwiftDocC PUBLIC + libcmark-gfm + libcmark-gfm-extensions) + +install(TARGETS SwiftDocC + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Sources/SwiftDocCUtilities/CMakeLists.txt b/Sources/SwiftDocCUtilities/CMakeLists.txt new file mode 100644 index 0000000000..4513a83491 --- /dev/null +++ b/Sources/SwiftDocCUtilities/CMakeLists.txt @@ -0,0 +1,74 @@ +#[[ +This source file is part of the swift-format open source project + +Copyright (c) 2024 Apple Inc. and the DocC project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See https://swift.org/LICENSE.txt for license information +#]] + +add_library(SwiftDocCUtilities STATIC + Action/Action.swift + Action/ActionResult.swift + Action/Actions/Action+MoveOutput.swift + Action/Actions/Convert/ConvertAction.swift + Action/Actions/Convert/ConvertFileWritingConsumer.swift + Action/Actions/Convert/CoverageDataEntry+generateSummary.swift + Action/Actions/Convert/Indexer.swift + Action/Actions/Convert/JSONEncodingRenderNodeWriter.swift + Action/Actions/CoverageAction.swift + Action/Actions/EmitGeneratedCurationAction.swift + Action/Actions/IndexAction.swift + Action/Actions/Init/CatalogTemplate.swift + Action/Actions/Init/CatalogTemplateKind.swift + Action/Actions/Init/InitAction.swift + Action/Actions/Merge/MergeAction.swift + Action/Actions/Merge/MergeAction+SynthesizedLandingPage.swift + Action/Actions/PreviewAction.swift + Action/Actions/TransformForStaticHostingAction.swift + ArgumentParsing/ActionExtensions/Action+performAndHandleResult.swift + ArgumentParsing/ActionExtensions/ConvertAction+CommandInitialization.swift + ArgumentParsing/ActionExtensions/EmitGeneratedCurationAction+CommandInitialization.swift + ArgumentParsing/ActionExtensions/IndexAction+CommandInitialization.swift + ArgumentParsing/ActionExtensions/InitAction+CommandInitialization.swift + ArgumentParsing/ActionExtensions/PreviewAction+CommandInitialization.swift + ArgumentParsing/ActionExtensions/TransformForStaticHostingAction+CommandInitialization.swift + ArgumentParsing/ArgumentValidation/URLArgumentValidator.swift + ArgumentParsing/Options/DirectoryPathOption.swift + ArgumentParsing/Options/DocumentationArchiveOption.swift + ArgumentParsing/Options/DocumentationBundleOption.swift + ArgumentParsing/Options/DocumentationCoverageOptionsArgument.swift + ArgumentParsing/Options/InitOptions.swift + ArgumentParsing/Options/OutOfProcessLinkResolverOption.swift + ArgumentParsing/Options/PreviewOptions.swift + "ArgumentParsing/Options/Source Repository/SourceRepositoryArguments.swift" + ArgumentParsing/Options/TemplateOption.swift + ArgumentParsing/Subcommands/Convert.swift + ArgumentParsing/Subcommands/EmitGeneratedCuration.swift + ArgumentParsing/Subcommands/Index.swift + ArgumentParsing/Subcommands/Init.swift + ArgumentParsing/Subcommands/Merge.swift + ArgumentParsing/Subcommands/Preview.swift + ArgumentParsing/Subcommands/ProcessArchive.swift + ArgumentParsing/Subcommands/ProcessCatalog.swift + ArgumentParsing/Subcommands/TransformForStaticHosting.swift + Docc.swift + PreviewServer/PreviewHTTPHandler.swift + PreviewServer/PreviewServer.swift + PreviewServer/RequestHandler/DefaultRequestHandler.swift + PreviewServer/RequestHandler/ErrorRequestHandler.swift + PreviewServer/RequestHandler/FileRequestHandler.swift + PreviewServer/RequestHandler/HTTPResponseHead+FromRequest.swift + PreviewServer/RequestHandler/RequestHandlerFactory.swift + Transformers/StaticHostableTransformer.swift + Utility/DirectoryMonitor.swift + Utility/FoundationExtensions/Sequence+Unique.swift + Utility/FoundationExtensions/String+Path.swift + Utility/FoundationExtensions/URL+IsAbsoluteWebURL.swift + Utility/FoundationExtensions/URL+Relative.swift + Utility/PlatformArgumentParser.swift + Utility/Signal.swift + Utility/Throttle.swift) +target_link_libraries(SwiftDocCUtilities PUBLIC + ArgumentParser + SwiftDocC) diff --git a/Sources/docc/CMakeLists.txt b/Sources/docc/CMakeLists.txt new file mode 100644 index 0000000000..879e26fad4 --- /dev/null +++ b/Sources/docc/CMakeLists.txt @@ -0,0 +1,16 @@ +#[[ +This source file is part of the swift-format open source project + +Copyright (c) 2024 Apple Inc. and the DocC project authors +Licensed under Apache License v2.0 with Runtime Library Exception + +See https://swift.org/LICENSE.txt for license information +#]] + +add_executable(docc + main.swift) +target_link_libraries(docc PRIVATE + SwiftDocCUtilities) + +install(TARGETS docc + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})