Class DocumentationUtils


  • public class DocumentationUtils
    extends Object
    Utility class for getting the meta data for the extension processors in Siddhi
    • Method Detail

      • getExtensionMetaData

        public static List<NamespaceMetaData> getExtensionMetaData​(String targetDirectoryPath,
                                                                   List<String> runtimeClasspathElements,
                                                                   org.apache.maven.plugin.logging.Log logger,
                                                                   boolean includeOrigin,
                                                                   boolean loadFromAllJars)
                                                            throws org.apache.maven.plugin.MojoFailureException,
                                                                   org.apache.maven.plugin.MojoExecutionException
        Returns the extension extension meta data Gets the meta data from the siddhi manager
        Parameters:
        targetDirectoryPath - The path of the target directory of the maven module containing extensions
        logger - The maven plugin logger
        includeOrigin -
        loadFromAllJars -
        Returns:
        NamespaceMetaData namespace meta data list
        Throws:
        org.apache.maven.plugin.MojoFailureException - If this fails to access project dependencies
        org.apache.maven.plugin.MojoExecutionException - If the classes directory from which classes are loaded is invalid
      • generateDocumentation

        public static void generateDocumentation​(List<NamespaceMetaData> namespaceMetaDataList,
                                                 String documentationBaseDirectory,
                                                 String documentationVersion,
                                                 org.apache.maven.plugin.logging.Log logger,
                                                 String siddhiVersion,
                                                 String mavenProjectGroupId)
                                          throws org.apache.maven.plugin.MojoFailureException
        Generate documentation related files using metadata
        Parameters:
        namespaceMetaDataList - Metadata in this repository
        documentationBaseDirectory - The path of the directory in which the documentation will be generated
        documentationVersion - The version of the documentation being generated
        logger - The logger to log errors
        siddhiVersion - Siddhi Core version
        mavenProjectGroupId - Project Group ID
        Throws:
        org.apache.maven.plugin.MojoFailureException - if the Mojo fails to find template file or create new documentation file
      • updateHeadingsInMarkdownFile

        public static void updateHeadingsInMarkdownFile​(File inputFile,
                                                        File outputFile,
                                                        String extensionRepositoryName,
                                                        String latestDocumentationVersion,
                                                        List<NamespaceMetaData> namespaceMetaDataList,
                                                        String groupId,
                                                        String siddhiVersion)
                                                 throws org.apache.maven.plugin.MojoFailureException
        Update the documentation home page
        Parameters:
        inputFile - The path to the input file
        outputFile - The path to the output file
        extensionRepositoryName - The name of the extension repository
        latestDocumentationVersion - The version of the latest documentation generated
        namespaceMetaDataList - Metadata in this repository
        groupId -
        siddhiVersion -
        Throws:
        org.apache.maven.plugin.MojoFailureException - if the Mojo fails to find template file or create new documentation file
      • removeSnapshotAPIDocs

        public static void removeSnapshotAPIDocs​(File mkdocsConfigFile,
                                                 String documentationBaseDirectory,
                                                 org.apache.maven.plugin.logging.Log logger)
        Remove the snapshot version documentation files from docs/api directory
        Parameters:
        mkdocsConfigFile - The mkdocs configuration file
        documentationBaseDirectory - The path of the base directory in which the documentation will be generated
        logger - The maven plugin logger
      • updateAPIPagesInMkdocsConfig

        public static String updateAPIPagesInMkdocsConfig​(File mkdocsConfigFile,
                                                          String documentationBaseDirectory)
                                                   throws FileNotFoundException
        This add a new page to the list of pages in the mkdocs configuration
        Parameters:
        mkdocsConfigFile - The mkdocs configuration file
        documentationBaseDirectory - The base directory of the documentation
        Returns:
        latestVersion
        Throws:
        FileNotFoundException - If mkdocs configuration file is not found
      • generateMkdocsSite

        public static boolean generateMkdocsSite​(File mkdocsConfigFile,
                                                 org.apache.maven.plugin.logging.Log logger)
        Build the mkdocs site using the mkdocs config file
        Parameters:
        mkdocsConfigFile - The mkdocs configuration file
        logger - The maven logger
        Returns:
        true if the documentation generation is successful
      • deployMkdocsOnGitHubPages

        public static void deployMkdocsOnGitHubPages​(String version,
                                                     File baseDirectory,
                                                     String url,
                                                     String scmUsername,
                                                     String scmPassword,
                                                     org.apache.maven.plugin.logging.Log logger)
        Deploy the mkdocs website on GitHub pages
        Parameters:
        version - The version of the documentation
        baseDirectory - The base directory of the project
        url - The SCM URL
        scmUsername - The SCM username
        scmPassword - The SCM password
        logger - The maven logger
      • updateDocumentationOnGitHub

        public static void updateDocumentationOnGitHub​(String docsDirectory,
                                                       File mkdocsConfigFile,
                                                       File readmeFile,
                                                       String version,
                                                       org.apache.maven.plugin.logging.Log logger)
        Commit the documentation directory and the mkdocs config file
        Parameters:
        docsDirectory - The docs drectory
        mkdocsConfigFile - The mkdocs configuration file
        readmeFile - The read me file
        version - The version of the documentation
        logger - The maven logger