Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/spring-configuration-property-docum…
Browse files Browse the repository at this point in the history
…enter-78
  • Loading branch information
nandorholozsnyak committed Sep 9, 2023
2 parents ee4b43c + 02398e3 commit c64e2c9
Show file tree
Hide file tree
Showing 44 changed files with 858 additions and 178 deletions.
12 changes: 11 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,18 @@
"contributions": [
"code"
]
},
{
"login": "ParkerM",
"name": "Parker Mauney",
"avatar_url": "https://avatars.githubusercontent.com/u/5124113?v=4",
"profile": "https://github.com/ParkerM",
"contributions": [
"code"
]
}
],
"skipCi": true,
"contributorsPerLine": 7
"contributorsPerLine": 7,
"commitType": "docs"
}
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
distribution: temurin
cache: maven
- name: Build & Verify Project
run: ./mvnw -Pgradle-build verify
run: ./mvnw verify
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Stage Files for Release
run: |
./mvnw versions:set -DnewVersion=$RELEASE_VERSION
./mvnw -Prelease,gradle-build deploy -DskipITs -DaltDeploymentRepository=local::file:./target/staging-deploy -pl '!spring-configuration-property-documenter-report'
./mvnw -Prelease deploy -DskipITs -DaltDeploymentRepository=local::file:./target/staging-deploy -pl '!spring-configuration-property-documenter-report'
./scripts/jbang-version-release.sh $RELEASE_VERSION
env:
RELEASE_VERSION: ${{ inputs.releaseVersion }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Stage Files for Snapshot Release
run: |
./mvnw versions:set -DnewVersion=999-SNAPSHOT
./mvnw -Prelease,gradle-build deploy -DaltDeploymentRepository=local::file:./target/staging-deploy -pl '!spring-configuration-property-documenter-report'
./mvnw -Prelease deploy -DaltDeploymentRepository=local::file:./target/staging-deploy -pl '!spring-configuration-property-documenter-report'
./scripts/jbang-version-release.sh 999-SNAPSHOT
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
## Contributors ✨

Expand All @@ -15,6 +15,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nandorholozsnyak"><img src="https://avatars.githubusercontent.com/u/11406183?v=4?s=100" width="100px;" alt="Nándor Holozsnyák"/><br /><sub><b>Nándor Holozsnyák</b></sub></a><br /><a href="#maintenance-nandorholozsnyak" title="Maintenance">🚧</a> <a href="https://github.com/rodnansol/spring-configuration-property-documenter/commits?author=nandorholozsnyak" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Allsimon"><img src="https://avatars.githubusercontent.com/u/8037169?v=4?s=100" width="100px;" alt="Allegraud Simon"/><br /><sub><b>Allegraud Simon</b></sub></a><br /><a href="https://github.com/rodnansol/spring-configuration-property-documenter/commits?author=Allsimon" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tkhadir"><img src="https://avatars.githubusercontent.com/u/45130488?v=4?s=100" width="100px;" alt="KHADIR Tayeb"/><br /><sub><b>KHADIR Tayeb</b></sub></a><br /><a href="https://github.com/rodnansol/spring-configuration-property-documenter/commits?author=tkhadir" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ParkerM"><img src="https://avatars.githubusercontent.com/u/5124113?v=4?s=100" width="100px;" alt="Parker Mauney"/><br /><sub><b>Parker Mauney</b></sub></a><br /><a href="https://github.com/rodnansol/spring-configuration-property-documenter/commits?author=ParkerM" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
12 changes: 12 additions & 0 deletions docs/modules/ROOT/pages/gradle-plugin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,12 @@ Or run them in two separate commands:
|Empty list - Everything will be included
|0.5.0
|failOnMissingInput
|Defines if the build should fail if the input file is missing/not existing.
|Yes
|
|0.7.0
|===
====

Expand Down Expand Up @@ -504,6 +510,12 @@ Or run them in two separate commands:
|
|0.5.0
|failOnMissingInput
|Defines if the build should fail if the input file is missing/not existing.
|Yes
|
|0.7.0
|===
[#aggregation-input]
Expand Down
42 changes: 41 additions & 1 deletion docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ endif::[]
:toc:
:toc-placement!:
:toclevels: 4
:latest-version: 0.7.0

[.text-center]
image:https://img.shields.io/maven-central/v/org.rodnansol/spring-configuration-property-documenter.svg[Maven Central]
Expand Down Expand Up @@ -192,6 +193,45 @@ image::{docs-images-prefix}html-result.png[]
image::{docs-images-prefix}xml-result.png[]
====

=== Try out quickly with Maven

==== Via direct plugin execution

[source,bash,subs=+attributes]
----
mvn clean package \
org.rodnansol:spring-configuration-property-documenter-maven-plugin:{latest-version}:generate-property-document \
-Dtype=ADOC
----

An Asciidoc based property documentation should be available in your `target/property-docs` folder.

==== Via minimal pom.xml configuration

.pom.xml
[source,xml,subs=+attributes]
----
<plugin>
<groupId>org.rodnansol</groupId>
<artifactId>spring-configuration-property-documenter-maven-plugin</artifactId>
<version>{latest-version}</version>
<executions>
<execution>
<id>generate-adoc-without-deprecation-and-type</id>
<phase>process-classes</phase>
<goals>
<goal>generate-property-document</goal>
</goals>
<configuration>
<type>ADOC</type>
</configuration>
</execution>
</executions>
</plugin>
----

NOTE: Don't worry, we have a Gradle plugin as well, check it out xref:{docs-url-prefix}gradle-plugin.adoc[here].

== Setup
=== Requirements

Expand Down Expand Up @@ -249,7 +289,7 @@ Please fork the project if you would like to contribute.

The project requires at least Java 11, if sdkman is installed on your machine `sdk e` command could be used in the terminal to set up the required Java version.

- To build the project just run: `mvn verify -Pbuild` - The `build` profile is required to access the Gradle dependencies
- To build the project just run: `mvn verify`
- If you want to build the samples run: `mvn install` and then `mvn package -f samples/pom.xml`

=== Code formatter
Expand Down
15 changes: 12 additions & 3 deletions docs/modules/ROOT/pages/maven-plugin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ The plugin is having multiple <<available-goals-and-config, goals>> at this mome
Spring's annotation processor will kick in the `compile` phase, and because of that the plugin must be linked after that lifecycle, for example the `process-classes`.

.pom.xml
[%collapsible]
====
[source,xml]
----
<build>
Expand Down Expand Up @@ -87,7 +85,6 @@ Spring's annotation processor will kick in the `compile` phase, and because of t
</plugins>
</build>
----
====

In this example 3 files are going to be created with different extensions (Markdown, AsciiDoc, HTML).

Expand Down Expand Up @@ -377,6 +374,12 @@ As we can see in the `input` tags we can define an `input` field that can be:
|Empty list - Everything will be included
|0.4.0
|failOnMissingInput
|Defines if the build should fail if the input file is missing/not existing.
|Yes
|
|0.7.0
|===
====

Expand Down Expand Up @@ -482,6 +485,12 @@ As we can see in the `input` tags we can define an `input` field that can be:
|
|0.2.1
|failOnMissingInput
|Defines if the build should fail if any of the input files are missing/not existing.
|Yes
|
|0.7.0
|===
[#aggregation-mojo-input]
Expand Down
122 changes: 122 additions & 0 deletions docs/modules/ROOT/pages/migrations.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[#header]
= Migrations

ifndef::env-github[]
:icons: font
endif::[]
Expand All @@ -14,7 +15,106 @@ endif::[]
:toc-placement!:
:toclevels: 4

[#version-0-7-0]
== 0.6.0 -> 0.7.0

Before the 0.7.0 version in case any of the input files during the `generate-and-aggregate-documents` Maven goal or `generateAndAggregateDocuments` Gradle task was missing the documentation was created but the missing elements were not rendered into the document, because there was nothing to be read.

With the release of the 0.7.0 this changes and the build will fail, but it can be parametrized for both available goals/tasks.

Maven goals:

* generate-property-document
* generate-and-aggregate-documents
Gradle tasks:

* generatePropertyDocument
* generateAndAggregateDocuments
=== Maven

.pom.xml
[source,xml]
----
<executions>
<execution>
<id>generate-adoc</id>
<phase>process-classes</phase>
<goals>
<goal>generate-property-document</goal>
</goals>
<configuration>
<type>TYPE</type>
<!--Set to true if the build should fail if the input file is missing, set to false if it should generate an empty document-->
<failOnMissingInput>true</failOnMissingInput>
</configuration>
</execution>
<execution>
<id>generate-adoc</id>
<phase>process-classes</phase>
<goals>
<goal>generate-and-aggregate-documents</goal>
</goals>
<configuration>
<type>TYPE</type>
<!--Set to true if the build should fail if the input file is missing, set to false if it should generate an empty document-->
<failOnMissingInput>true</failOnMissingInput>
</configuration>
</execution>
</executions>
----

=== Gradle

.gradle.build
[source,groovy]
----
tasks.register('generateAdoc') {
dependsOn generatePropertyDocument {
failOnMissingInput = true // Will fail if input is missing
documentName = "Hello World"
type = "ADOC"
asciiDocCustomization {
contentCustomization {
includeEnvFormat = true
includeClass = false
includeDeprecation = false
includeDescription = false
}
unknownGroupLocalization = "Renamed unknown group"
tocLevels = 3
}
}
}
tasks.register('generateAdocFromMissingInputFile') {
dependsOn generatePropertyDocument {
failOnMissingInput = false // Won't fail if input is missing, and empty file will be made
metadataInput = new File("non-existing.json")
outputFile = new File("build/property-docs/non-existing-file.adoc")
documentName = "Hello World"
type = "ADOC"
asciiDocCustomization {
contentCustomization {
includeEnvFormat = true
includeClass = false
includeDeprecation = false
includeDescription = false
}
unknownGroupLocalization = "Renamed unknown group"
tocLevels = 3
}
}
}
----

[#version-0-6-1]
== 0.6.0 -> 0.6.1

No changes required.

[#version-0-6-0]
== 0.5.1 -> 0.6.0

=== Including environment format
Expand All @@ -24,6 +124,7 @@ Header appearance in the tables are now customizable, and to make sure the envir
A new level of configuration is introduced, it can be configured with the `contentCustomization` key in Maven and in Gradle.

==== Maven

.Till 0.5.1
[source,xml]
----
Expand Down Expand Up @@ -92,6 +193,7 @@ A new level of configuration is introduced, it can be configured with the `conte
----

==== Gradle

.Till 0.5.1
[source,groovy]
----
Expand Down Expand Up @@ -188,32 +290,52 @@ tasks.register('generateXml') {
}
----

[#version-0-5-1]
== 0.5.0 -> 0.5.1

No changes required.

[#version-0-5-0]
== 0.4.0 -> 0.5.0

No changes required.

[#version-0-4-0]
== 0.3.0 -> 0.4.0

No changes required.

[#version-0-3-0]
== 0.2.4 -> 0.3.0

No changes required.

[#version-0-2-4]
== 0.2.3 -> 0.2.4

No changes required.

[#version-0-2-3]
== 0.2.2 -> 0.2.3

No changes required.

[#version-0-2-2]
== 0.2.1 -> 0.2.2

No changes required.

[#version-0-2-1]
== 0.2.0 -> 0.2.1

No changes required.

[#version-0-2-0]
== 0.1.1 -> 0.2.0

No changes required.

[#version-0-1-1]
== 0.1.0 -> 0.1.1

No changes required.
5 changes: 5 additions & 0 deletions hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env bash

if git rev-parse -q --verify MERGE_HEAD; then
echo "This is a merge commit, no checks are required"
exit 0
fi

# Create a regex for a conventional commit.
convetional_commit_regex="^(release|build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z \-]+\))?!?: .+$"

Expand Down
8 changes: 6 additions & 2 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env bash

echo "Verifying project before committing"
./mvnw clean verify
if git rev-parse -q --verify MERGE_HEAD; then
echo "This is a merge commit, no builds are going to be executed."
else
echo "Building project"
./mvnw clean verify
fi
Loading

0 comments on commit c64e2c9

Please sign in to comment.