Skip to content

Commit 9c00801

Browse files
committed
Initial import of plugin source
1 parent f238233 commit 9c00801

37 files changed

+2479
-0
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_size = 4
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*{.yml,yaml}]
10+
indent_style = space
11+
indent_size = 2

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* text=auto eol=lf
2+
3+
*.bat text eol=crlf
4+
*.jar binary
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
---
5+
6+
## 🐛 Describe the bug
7+
<!-- A clear and concise description of what the bug is. -->
8+
9+
## ⚠️ Current behavior
10+
<!-- A clear and concise description of what you expected to happen. -->
11+
12+
## ✅ Expected behavior
13+
<!-- A clear and concise description of what you expected to happen. -->
14+
15+
## 💣 Steps to reproduce
16+
<!-- How we can reproduce the behavior: -->
17+
18+
## 📷 Screenshots
19+
<!-- If applicable, add screenshots to help explain your problem. -->
20+
21+
## 📱 Tech info
22+
- Device: <!-- e.g. Nexus One -->
23+
- OS: <!-- e.g. 7.1.1 -->
24+
- Library/App version: <!-- e.g. 1.0.0 -->
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
---
5+
6+
## ⚠️ Is your feature request related to a problem? Please describe
7+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
8+
9+
## 💡 Describe the solution you'd like
10+
<!-- A clear and concise description of what you want to happen. -->
11+
12+
## 🤚 Do you want to develop this feature yourself?
13+
<!-- Put an `x` symbol into braces of desired choice. -->
14+
- [ ] Yes
15+
- [ ] No

.github/PULL_REQUEST_TEMPLATE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!-- Thanks for taking the time to write this Pull Request ❤️ -->
2+
3+
## 🚀 Description
4+
<!-- Describe your changes in detail -->
5+
6+
## 📄 Motivation and Context
7+
<!-- Why is this change required? What problem does it solve? -->
8+
<!-- If it fixes an open issue, please link to the issue here. -->
9+
10+
## 🧪 How Has This Been Tested?
11+
<!-- Please describe in detail how you tested your changes. -->
12+
<!-- Include details of your testing environment, tests ran to see how -->
13+
<!-- your change affects other areas of the code, etc. -->
14+
15+
## 📦 Types of changes
16+
<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
17+
- [ ] Bug fix (non-breaking change which fixes an issue)
18+
- [ ] New feature (non-breaking change which adds functionality)
19+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
20+
21+
## ✅ Checklist
22+
<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
23+
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
24+
- [ ] My code follows the code style of this project.
25+
- [ ] My change requires a change to the documentation.
26+
- [ ] I have updated the documentation accordingly.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Create Version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
versionIncrementer:
7+
type: choice
8+
description: Override the default version incrementer according to https://axion-release-plugin.readthedocs.io/en/latest/configuration/version/#incrementing
9+
default: default
10+
options:
11+
- default
12+
- incrementPatch
13+
- incrementMinor
14+
- incrementMajor
15+
- incrementPrerelease
16+
17+
jobs:
18+
release:
19+
name: Gradle Release
20+
runs-on: ubuntu-24.04
21+
outputs:
22+
version: ${{ steps.version.outputs.version }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
ssh-key: "${{ secrets.COMMIT_KEY }}"
27+
fetch-depth: 0
28+
- uses: webfactory/ssh-agent@v0.9.0
29+
with:
30+
ssh-private-key: ${{ secrets.COMMIT_KEY }}
31+
- uses: gradle/actions/setup-gradle@v4
32+
- name: Gradle Release
33+
if: ${{ inputs.versionIncrementer == 'default' }}
34+
run: ./gradlew release
35+
- name: Gradle Release w/ Increment Override
36+
if: ${{ inputs.versionIncrementer != 'default' }}
37+
run: ./gradlew release -Prelease.versionIncrementer=${{ inputs.versionIncrementer }}

.github/workflows/pre-merge.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Pre Merge Checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
8+
jobs:
9+
preMerge:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
checks: write
14+
pull-requests: write
15+
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
16+
steps:
17+
- name: Checkout Repo
18+
uses: actions/checkout@v4
19+
- uses: actions/setup-java@v4
20+
with:
21+
distribution: temurin
22+
java-version: 17
23+
- uses: gradle/actions/setup-gradle@v4
24+
- name: Pre-merge checks
25+
run: ./gradlew preMerge --continue
26+
- name: Publish Test Results
27+
uses: EnricoMi/publish-unit-test-result-action@v2
28+
if: always()
29+
with:
30+
files: |
31+
**/build/test-results/**/*.xml
32+
- name: Upload HTML Test Results
33+
uses: actions/upload-artifact@v4
34+
if: always()
35+
with:
36+
name: Test results
37+
path: |
38+
**/build/reports/tests
39+
retention-days: 7
40+
- name: Publish Ktlint reports
41+
uses: lcollins/checkstyle-github-action@v2
42+
if: always()
43+
with:
44+
path: "**/build/reports/ktlint/**/*Check.xml"
45+
- name: Upload build artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: flatgraph-codegen-gradle
49+
path: plugin-build/flatgraph-codegen-gradle/build/libs/flatgraph-codegen-gradle-*.jar
50+
retention-days: 7
51+
if-no-files-found: error
52+
- name: Vulnerability Scan
53+
uses: aquasecurity/trivy-action@master
54+
env:
55+
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
56+
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1
57+
with:
58+
scan-type: 'rootfs'
59+
scan-ref: plugin-build/flatgraph-codegen-gradle/build/libs/
60+
format: 'table'
61+
exit-code: '1'
62+
ignore-unfixed: true
63+
vuln-type: 'os,library'
64+
severity: 'CRITICAL,HIGH,MEDIUM'
65+
- name: Run the plugin
66+
run: ./gradlew generateDomainClasses
67+
if: success()
68+
- name: Verify the classes were generated
69+
run: test -f example/build/generated/flatgraph/main/scala/flatgraph/generated/nodes/Mynodetype.scala
70+
if: success()
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Build & Publish Plugin
2+
3+
on:
4+
push:
5+
branches: [ 'main' ]
6+
tags:
7+
- "v[0-9]+.[0-9]+.[0-9]+"
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
issues: read
15+
checks: write
16+
pull-requests: write
17+
packages: write
18+
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
19+
steps:
20+
- name: Checkout Repo
21+
uses: actions/checkout@v4
22+
with:
23+
ssh-key: "${{ secrets.COMMIT_KEY }}"
24+
fetch-depth: 0
25+
- uses: actions/setup-java@v4
26+
with:
27+
distribution: temurin
28+
java-version: 17
29+
- uses: gradle/actions/setup-gradle@v4
30+
- name: Pre-merge checks
31+
run: ./gradlew preMerge --continue
32+
- name: Publish Test Results
33+
uses: EnricoMi/publish-unit-test-result-action@v2
34+
if: always()
35+
with:
36+
files: |
37+
**/build/test-results/**/*.xml
38+
- name: Upload HTML Test Results
39+
uses: actions/upload-artifact@v4
40+
if: always()
41+
with:
42+
name: Test results
43+
path: |
44+
**/build/reports/tests
45+
retention-days: 7
46+
- name: Publish Ktlint reports
47+
uses: lcollins/checkstyle-github-action@v2
48+
if: always()
49+
with:
50+
path: "**/build/reports/ktlint/**/*Check.xml"
51+
# Use Github Packages for snapshots (Gradle Plugin portal doesn't accept them)
52+
- name: Publish to Github Packages
53+
shell: bash
54+
env:
55+
GRADLE_PUBLISH_KEY: ${{ env.GITHUB_ACTOR }}
56+
GRADLE_PUBLISH_SECRET: ${{ secrets.GITHUB_TOKEN }}
57+
run: |
58+
if [[ "${{ !startsWith(github.ref, 'refs/tags/v') }}" == "true" ]]; then
59+
./gradlew --project-dir plugin-build setupPluginUploadFromEnvironment publishAllPublicationsToGitHubPackagesRepository -Prelease.forceSnapshot
60+
else
61+
./gradlew --project-dir plugin-build setupPluginUploadFromEnvironment publishAllPublicationsToGitHubPackagesRepository
62+
fi
63+
- name: Publish to Gradle Plugin portal
64+
if: startsWith(github.ref, 'refs/tags/v')
65+
shell: bash
66+
env:
67+
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
68+
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
69+
run: ./gradlew --project-dir plugin-build setupPluginUploadFromEnvironment publishPlugins
70+
- name: Get Version
71+
id: version
72+
shell: bash
73+
run: echo "version=$(./gradlew --console plain --quiet :currentVersion -Prelease.quiet)" >> $GITHUB_OUTPUT
74+
- name: Upload build artifact
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: flatgraph-codegen-gradle
78+
path: plugin-build/flatgraph-codegen-gradle/build/libs/flatgraph-codegen-gradle-*.jar
79+
retention-days: 7
80+
if-no-files-found: error
81+
- name: Vulnerability Scan
82+
uses: aquasecurity/trivy-action@master
83+
env:
84+
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
85+
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1
86+
with:
87+
scan-type: 'rootfs'
88+
scan-ref: plugin-build/flatgraph-codegen-gradle/build/libs/
89+
format: 'table'
90+
exit-code: '1'
91+
ignore-unfixed: true
92+
vuln-type: 'os,library'
93+
severity: 'CRITICAL,HIGH,MEDIUM'
94+
- name: Create Github Release
95+
uses: docker://antonyurchenko/git-release:v6
96+
env:
97+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
RELEASE_NAME: ${{ steps.version.outputs.version }}
99+
PRE_RELEASE: ${{ github.ref_type == 'branch' }}
100+
UNRELEASED: ${{ github.ref_type == 'branch' && 'update' || '' }}
101+
UNRELEASED_TAG: latest-snapshot
102+
DRAFT_RELEASE: false
103+
ALLOW_EMPTY_CHANGELOG: ${{ github.ref_type == 'branch' && 'true' || 'false' }}
104+
with:
105+
args: plugin-build/flatgraph-codegen-gradle/build/libs/flatgraph-codegen-gradle-*.jar

0 commit comments

Comments
 (0)