Skip to content

Commit 49c5ee6

Browse files
committed
Initial import of plugin source
1 parent 8fa5744 commit 49c5ee6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+3503
-0
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*.{kt,kts}]
4+
ktlint_code_style = intellij_idea
5+
ktlint_ignore_back_ticked_identifier = false
6+
7+
# names here come from the wrapped functions, so ignore these rules in generated code
8+
[**/build/generated/**]
9+
ktlint_standard_filename = disabled
10+
ktlint_standard_function-naming = disabled
11+
ktlint_standard_class-naming = disabled
12+
13+
[*]
14+
charset = utf-8
15+
indent_size = 4
16+
insert_final_newline = true
17+
trim_trailing_whitespace = true
18+
19+
[*{.yml,yaml}]
20+
indent_style = space
21+
indent_size = 2

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @tajobe @xavierpinho

.github/CODE_OF_CONDUCT.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
2+
# Code of Conduct
3+
4+
## Our Pledge
5+
6+
In the interest of fostering an open and welcoming environment, we as
7+
contributors and maintainers pledge to make participation in our project and
8+
our community a harassment-free experience for everyone, regardless of age, body
9+
size, disability, ethnicity, sex characteristics, gender identity and expression,
10+
level of experience, education, socio-economic status, nationality, personal
11+
appearance, race, religion, or sexual identity and orientation.
12+
13+
## Our Standards
14+
15+
Examples of behavior that contributes to creating a positive environment
16+
include:
17+
18+
* Using welcoming and inclusive language
19+
* Being respectful of differing viewpoints and experiences
20+
* Gracefully accepting constructive criticism
21+
* Focusing on what is best for the community
22+
* Showing empathy towards other community members
23+
24+
Examples of unacceptable behavior by participants include:
25+
26+
* The use of sexualized language or imagery and unwelcome sexual attention or
27+
advances
28+
* Trolling, insulting/derogatory comments, and personal or political attacks
29+
* Public or private harassment
30+
* Publishing others' private information, such as a physical or electronic
31+
address, without explicit permission
32+
* Other conduct which could reasonably be considered inappropriate in a
33+
professional setting
34+
35+
## Our Responsibilities
36+
37+
Project maintainers are responsible for clarifying the standards of acceptable
38+
behavior and are expected to take appropriate and fair corrective action in
39+
response to any instances of unacceptable behavior.
40+
41+
Project maintainers have the right and responsibility to remove, edit, or
42+
reject comments, commits, code, wiki edits, issues, and other contributions
43+
that are not aligned to this Code of Conduct, or to ban temporarily or
44+
permanently any contributor for other behaviors that they deem inappropriate,
45+
threatening, offensive, or harmful.
46+
47+
## Scope
48+
49+
This Code of Conduct applies within all project spaces, and it also applies when
50+
an individual is representing the project or its community in public spaces.
51+
Examples of representing a project or community include using an official
52+
project e-mail address, posting via an official social media account, or acting
53+
as an appointed representative at an online or offline event. Representation of
54+
a project may be further defined and clarified by project maintainers.
55+
56+
## Enforcement
57+
58+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
59+
reported by contacting the project team at `support AT stackgen.com`. All
60+
complaints will be reviewed and investigated and will result in a response that
61+
is deemed necessary and appropriate to the circumstances. The project team is
62+
obligated to maintain confidentiality with regard to the reporter of an incident.
63+
Further details of specific enforcement policies may be posted separately.
64+
65+
Project maintainers who do not follow or enforce the Code of Conduct in good
66+
faith may face temporary or permanent repercussions as determined by other
67+
members of the project's leadership.
68+
69+
## Attribution
70+
71+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
72+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
73+
74+
[homepage]: https://www.contributor-covenant.org
75+
76+
For answers to common questions about this code of conduct, see
77+
https://www.contributor-covenant.org/faq
78+

.github/CONTRIBUTING.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# How to contribute
2+
3+
We are happy to welcome new contributors and make the contribution process as painless as possible. If you have any questions, feel free to open an issue.
4+
5+
Please check the [README](../README.md) to understand the project.
6+
7+
## Getting started
8+
9+
To contribute to the project, please:
10+
11+
1. Fork this repository
12+
2. Create a branch
13+
3. Commit your changes
14+
4. Push your commits to the branch
15+
5. Submit a pull request
16+
17+
Any material change to the released artifact(s) should be accompanied by a `CHANGELOG.md` entry.
18+
19+
For further guidance about getting started, please refer to the related links:
20+
21+
* [Pull Request Guidelines](PULL_REQUEST_TEMPLATE.md)
22+
* Issues Guidelines
23+
* [Bug Report](ISSUE_TEMPLATE/bug_report.md)
24+
* [Bug Report](ISSUE_TEMPLATE/feature_request.md)
25+
26+
## Change Tracking
27+
28+
All changes into the `main` branch should come from a Pull Request with a review from one of the [codeowners](CODEOWNERS) and should generally include
29+
an entry in `CHANGELOG.md`'s `[UNRELEASED]` section (do not directly modify a version's changes, this is automatic).
30+
31+
Changelog entries should be organized into appropriate headings per
32+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and follow the format:
33+
34+
```md
35+
- <contributor>: <Description of change> (#<github issue>)
36+
```
37+
38+
## Coding conventions
39+
40+
In order to sanitize coding standards, please follow the [Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html). Any changes should pass ktlint and detekt checks.
41+
42+
## Code of Conduct
43+
44+
This project and everyone participating in it is governed by this [Code of Conduct](CODE_OF_CONDUCT.md).
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.md

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: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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: scala-kotlin-extension-codegen
49+
path: "**/build/libs/scala-kotlin-extension-codegen-*.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/scala-kotlin-extension-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 generateKotlinExtensionsForScalaClasses
67+
if: success()
68+
# verify we seemed to get some functions
69+
- name: Verify wrappers were generated
70+
run: test -f example/build/generated/extensions/main/kotlin/scribe/LoggerIdExtensions.kt
71+
if: success()

0 commit comments

Comments
 (0)