Package io.siddhi.doc.gen.core.utils
Class DocumentationUtils
- java.lang.Object
-
- io.siddhi.doc.gen.core.utils.DocumentationUtils
-
public class DocumentationUtils extends Object
Utility class for getting the meta data for the extension processors in Siddhi
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddeployMkdocsOnGitHubPages(String version, File baseDirectory, String url, String scmUsername, String scmPassword, org.apache.maven.plugin.logging.Log logger)Deploy the mkdocs website on GitHub pagesstatic voidgenerateDocumentation(List<NamespaceMetaData> namespaceMetaDataList, String documentationBaseDirectory, String documentationVersion, org.apache.maven.plugin.logging.Log logger, String siddhiVersion, String mavenProjectGroupId)Generate documentation related files using metadatastatic booleangenerateMkdocsSite(File mkdocsConfigFile, org.apache.maven.plugin.logging.Log logger)Build the mkdocs site using the mkdocs config filestatic List<NamespaceMetaData>getExtensionMetaData(String targetDirectoryPath, List<String> runtimeClasspathElements, org.apache.maven.plugin.logging.Log logger, boolean includeOrigin, boolean loadFromAllJars)Returns the extension extension meta data Gets the meta data from the siddhi managerstatic voidremoveSnapshotAPIDocs(File mkdocsConfigFile, String documentationBaseDirectory, org.apache.maven.plugin.logging.Log logger)Remove the snapshot version documentation files from docs/api directorystatic StringupdateAPIPagesInMkdocsConfig(File mkdocsConfigFile, String documentationBaseDirectory)This add a new page to the list of pages in the mkdocs configurationstatic voidupdateDocumentationOnGitHub(String docsDirectory, File mkdocsConfigFile, File readmeFile, String version, org.apache.maven.plugin.logging.Log logger)Commit the documentation directory and the mkdocs config filestatic voidupdateHeadingsInMarkdownFile(File inputFile, File outputFile, String extensionRepositoryName, String latestDocumentationVersion, List<NamespaceMetaData> namespaceMetaDataList, String groupId, String siddhiVersion)Update the documentation home page
-
-
-
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 extensionslogger- The maven plugin loggerincludeOrigin-loadFromAllJars-- Returns:
- NamespaceMetaData namespace meta data list
- Throws:
org.apache.maven.plugin.MojoFailureException- If this fails to access project dependenciesorg.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 repositorydocumentationBaseDirectory- The path of the directory in which the documentation will be generateddocumentationVersion- The version of the documentation being generatedlogger- The logger to log errorssiddhiVersion- Siddhi Core versionmavenProjectGroupId- 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 fileoutputFile- The path to the output fileextensionRepositoryName- The name of the extension repositorylatestDocumentationVersion- The version of the latest documentation generatednamespaceMetaDataList- Metadata in this repositorygroupId-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 filedocumentationBaseDirectory- The path of the base directory in which the documentation will be generatedlogger- 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 filedocumentationBaseDirectory- 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 filelogger- 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 documentationbaseDirectory- The base directory of the projecturl- The SCM URLscmUsername- The SCM usernamescmPassword- The SCM passwordlogger- 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 drectorymkdocsConfigFile- The mkdocs configuration filereadmeFile- The read me fileversion- The version of the documentationlogger- The maven logger
-
-