-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor streampipes-maven-plugin to auto-generate docs #1907
Merged
dominikriemer
merged 6 commits into
dev
from
1906-revive-streampipes-maven-plugin-to-auto-generate-pipeline-element-documentation
Sep 11, 2023
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3ffbdbe
Refactor streampipes-maven-plugin to auto-generate docs
dominikriemer 6a66336
Add additional assets to image folder
dominikriemer d86286a
Assign proper pipeline element type
dominikriemer fc826d1
Add github action to create docs
dominikriemer 8a00577
Upload multiple doc artifacts
dominikriemer 48584e9
Fix copy-paste leftover
dominikriemer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: "build-extensions-docs-and-share-as-artifact" | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 3 * * 6" # runs every saturday at 03:00:00 | ||
|
||
jobs: | ||
python-docs-artifact-building: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: clone | ||
uses: actions/checkout@v4 | ||
|
||
- name: create working branch & set GitHub config | ||
run: | | ||
git checkout -b build-extensions-docs-${{ github.run_id }} | ||
git config user.name 'github-actions[bot]' | ||
git config user.email 'github-actions[bot]@users.noreply.github.com' | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'maven' | ||
|
||
- name: Build with Maven | ||
run: mvn clean package | ||
|
||
- name: Publish Extensions docs as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: streampipes-extensions-docs | ||
path: | | ||
streampipes-extensions/streampipes-extensions-all-jvm/target/docs/pe/ | ||
retention-days: 5 | ||
|
||
- name: Publish Extensions image assets as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: streampipes-extensions-docs-image-assets | ||
path: | | ||
streampipes-extensions/streampipes-extensions-all-jvm/target/docs/img/ | ||
retention-days: 5 | ||
|
||
- name: Publish Extensions sidebar | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: streampipes-extensions-docs-sidebar | ||
path: | | ||
streampipes-extensions/streampipes-extensions-all-jvm/target/docs/sidebars.json | ||
retention-days: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
~ contributor license agreements. See the NOTICE file distributed with | ||
~ this work for additional information regarding copyright ownership. | ||
~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
~ (the "License"); you may not use this file except in compliance with | ||
~ the License. You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~ | ||
--> | ||
|
||
# Apache StreamPipes Maven Plugin | ||
|
||
## Description | ||
|
||
The Apache StreamPipes is an internal developer plugin which eases the generation of documentation for | ||
adapters and pipeline elements. | ||
|
||
The plugin generates documentation files which can be integrated into the UI. | ||
|
||
## Usage | ||
|
||
The streampipes-maven-plugin can either be started from the command line or embedded into a project's pom. | ||
|
||
### Prerequisites | ||
|
||
The plugin must be started from a module which contains an `Init` class which inherits `ExtensionsModelSubmitter`. | ||
By default, the goal runs in the `package` phase. | ||
|
||
### Command line | ||
|
||
```bash | ||
# Switch to a directory containing StreamPipes extensions and an Init class, e.g., streampipes-extensions-all-jvm | ||
|
||
mvn streampipes:extract-docs -DinitClass=org.apache.streampipes.extensions.all.jvm.AllExtensionsInit | ||
``` | ||
|
||
### Inclusion in pom file | ||
|
||
```xml | ||
|
||
<plugin> | ||
<groupId>org.apache.streampipes</groupId> | ||
<artifactId>streampipes-maven-plugin</artifactId> | ||
<version>0.93.0</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.rocketmq</groupId> | ||
<artifactId>rocketmq-client-java</artifactId> | ||
<version>5.0.2</version> | ||
</dependency> | ||
</dependencies> | ||
<configuration> | ||
<initClass>org.apache.streampipes.extensions.all.jvm.AllExtensionsInit</initClass> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>extract-docs</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
``` | ||
|
||
* Replace the `version` with the current development version. | ||
* Replace the `initClass` with the module's init class. | ||
* The dependency to RocketMQ is only needed for modules containing the RocketMQ sink and can be omitted otherwise. | ||
|
||
## Output | ||
|
||
The plugin creates a new folder `docs` in the module's `target` directory. | ||
|
||
The folder includes: | ||
|
||
* An `img` folder which has a subdirectory for each extension (named by the `appId`) containing the icon. | ||
* A `pe` folder which has a subdirectory for each extension (named by the `appId`) containing the `documentation.md` | ||
file, which has been rewritten to match the requirements of the Docusaurus Markdown parser. | ||
* An updated `sidebar.json` file containing the sidebar, which is downloaded from the `streampipes-website` repo on | ||
branch `dev` and updated with the current set of extensions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 0 additions & 106 deletions
106
streampipes-maven-plugin/src/main/java/org/apache/streampipes/smp/CreateAssetMojo.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy/paste leftover 😉