Skip to content

Commit

Permalink
Inner objects not initialized fix (#19)
Browse files Browse the repository at this point in the history
* Add constructor to generated inner object

* Increase minor version

* Tweak Github Actions

---------

Co-authored-by: Jose Enrique García Maciñeiras <[email protected]>
  • Loading branch information
apenlor and jemacineiras authored Nov 3, 2023
1 parent 52e1e54 commit a48a930
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven-central-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
check-version:
runs-on: ubuntu-latest
needs: [check-pr-labels]
if: ${{ contains(needs.check-pr-labels.outputs.labels, 'release') || contains(needs.check-pr-labels.outputs.labels, 'maven') }}
if: ${{ contains(needs.check-pr-labels.outputs.labels, 'release') }}
steps:
- uses: actions/checkout@v3
- name: Check if version is updated
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/maven-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ jobs:
continue-on-error: true
- name: Check if version is updated
uses: avides/[email protected]
id: maven_plugin_version_check
id: maven_processor_version_check
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-to-check: pom.xml
continue-on-error: true
- name: Warn about version specification
if: ${{ steps.engine_version_check.outcome != 'success' || steps.maven_plugin_version_check.outcome != 'success' }}
if: ${{steps.maven_processor_version_check.outcome != 'success' }}
uses: thollander/actions-comment-pull-request@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: Project version has not been updated in pom.xml. Please, update your version using https://semver.org specifications
- name: Fail
if: ${{ steps.engine_version_check.outcome != 'success' || steps.maven_plugin_version_check.outcome != 'success' }}
if: ${{steps.maven_processor_version_check.outcome != 'success' }}
uses: cutenode/action-always-fail@v1
- name: New software version
if: ${{ steps.engine_version_check.outcome == 'success' && steps.maven_plugin_version_check.outcome == 'success' }}
run: echo "New Pact Annotation Builder engine version is " ${{ steps.engine_version_check.outputs.version }}
if: ${{ steps.maven_processor_version_check.outcome == 'success' }}
run: echo "New Pact Annotation Builder engine version is " ${{ steps.maven_processor_version_check.version }}

build:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
if: github.event.review.state == 'approved'
steps:
- name: Warn about missing labels
if: ${{ !contains(github.event.pull_request.labels.*.name, 'release') && !contains(github.event.pull_request.labels.*.name, 'documentation') && !contains(github.event.pull_request.labels.*.name, 'maven')}}}
if: ${{ !contains(github.event.pull_request.labels.*.name, 'release') && !contains(github.event.pull_request.labels.*.name, 'documentation')}}}
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: "This pull request hasn't been labeled as `release`, `maven` nor `documentation`. Please ensure this is intentional before merging."
message: "This pull request hasn't been labeled as `release` nor `documentation`. Please ensure this is intentional before merging."
comment_tag: label-warn
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ pom.xml.bak
.vscode/
**/.java-version

*.bak
*.bak
dependency-reduced-pom*
13 changes: 12 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.sngular</groupId>
<artifactId>pact-annotation-processor</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>

<name>PactDslBuilder - Annotation Processor</name>
<description>Pact DSL Builder annotation processor.</description>
Expand Down Expand Up @@ -39,6 +39,17 @@
</roles>
<timezone>Europe/Madrid</timezone>
</developer>
<developer>
<id>apenlor</id>
<name>Alejandro Pena Lorenzo</name>
<email>[email protected]</email>
<organizationUrl>https://sngular.github.io/</organizationUrl>
<roles>
<role>Principal Engineer</role>
<role>Team Leader</role>
</roles>
<timezone>America/New_York</timezone>
</developer>
</developers>

<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/templateDslBuilder.ftlh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<#if complexField.complexType.name() == "COLLECTION">
${complexField.fieldType?no_esc} ${complexField.name} = List.of(${writeDefaultsList(complexField.fields)});
<#elseif complexField.needBuilder>
${complexField.fieldType?no_esc}Builder ${complexField.name};
${complexField.fieldType?no_esc}Builder ${complexField.name} = new ${complexField.fieldType?no_esc}Builder();
<#else >
${complexField.fieldType?no_esc} ${complexField.name};
</#if>
Expand Down

0 comments on commit a48a930

Please sign in to comment.