-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds BOM Module and Migrate to Gradle Version Catalog (#280)
* Upgrade to Micronaut 3.3.4. Upgrade to the latest GraphQL libraries. * Fixed graphql-java-extended-scalars version. * graphql-java 18.0 * Fixed jwt-security example. * Sync common files with https://github.com/micronaut-projects/micronaut-project-template * Gradle 7.4.2. io.micronaut.build.shared.settings 5.3.3. * Migrate to Gradle Version Catalogs. Co-authored-by: Alexey Zhokhov <[email protected]>
- Loading branch information
Showing
13 changed files
with
147 additions
and
46 deletions.
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,82 @@ | ||
# Contributing Code or Documentation to Micronaut | ||
|
||
Sign the [Contributor License Agreement (CLA)](https://cla-assistant.io/micronaut-projects/micronaut-graphql). This is required before any of your code or pull-requests are accepted. | ||
|
||
## Finding Issues to Work on | ||
|
||
If you are interested in contributing to Micronaut and are looking for issues to work on, take a look at the issues tagged with [help wanted](https://github.com/micronaut-projects/micronaut-graphql/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+help+wanted%22). | ||
|
||
## JDK Setup | ||
|
||
Micronaut GraphQL currently requires JDK 8. | ||
|
||
## IDE Setup | ||
|
||
Micronaut GraphQL can be imported into IntelliJ IDEA by opening the `build.gradle` file. | ||
|
||
## Docker Setup | ||
|
||
Micronaut GraphQL tests currently require Docker to be installed. | ||
|
||
## Running Tests | ||
|
||
To run the tests, use `./gradlew check`. | ||
|
||
## Building Documentation | ||
|
||
The documentation sources are located at `src/main/docs/guide`. | ||
|
||
To build the documentation, run `./gradlew publishGuide` (or `./gradlew pG`), then open `build/docs/index.html` | ||
|
||
To also build the Javadocs, run `./gradlew docs`. | ||
|
||
## Working on the code base | ||
|
||
If you use IntelliJ IDEA, you can import the project using the Intellij Gradle Tooling ("File / Import Project" and selecting the "settings.gradle" file). | ||
|
||
To get a local development version of Micronaut GraphQL working, first run the `publishToMavenLocal` task. | ||
|
||
``` | ||
./gradlew pTML | ||
``` | ||
|
||
You can then reference the version specified with `projectVersion` in `gradle.properties` in a test project's `build.gradle` or `pom.xml`. If you use Gradle, add the `mavenLocal` repository (Maven automatically does this): | ||
|
||
``` | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
``` | ||
|
||
## Creating a pull request | ||
|
||
Once you are satisfied with your changes: | ||
|
||
- Commit your changes in your local branch | ||
- Push your changes to your remote branch on GitHub | ||
- Send us a [pull request](https://help.github.com/articles/creating-a-pull-request) | ||
|
||
## Checkstyle | ||
|
||
We want to keep the code clean, following good practices about organization, Javadoc, and style as much as possible. | ||
|
||
Micronaut GraphQL uses [Checkstyle](https://checkstyle.sourceforge.io/) to make sure that the code follows those standards. The configuration is defined in `config/checkstyle/checkstyle.xml`. To execute Checkstyle, run: | ||
|
||
``` | ||
./gradlew <module-name>:checkstyleMain | ||
``` | ||
|
||
Before starting to contribute new code we recommended that you install the IntelliJ [CheckStyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) plugin and configure it to use Micronaut's checkstyle configuration file. | ||
|
||
IntelliJ will mark in red the issues Checkstyle finds. For example: | ||
|
||
![](https://github.com/micronaut-projects/micronaut-core/raw/master/src/main/docs/resources/img/checkstyle-issue.png) | ||
|
||
In this case, to fix the issues, we need to: | ||
|
||
- Add one empty line before `package` in line 16 | ||
- Add the Javadoc for the constructor in line 27 | ||
- Add an space after `if` in line 34 | ||
|
||
The plugin also adds a new tab in the bottom of the IDE to run Checkstyle and show errors and warnings. We recommend that you run the report and fix all issues before submitting a pull request. |
3 changes: 3 additions & 0 deletions
3
buildSrc/src/main/groovy/io.micronaut.build.internal.graphql-module.gradle
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,3 @@ | ||
plugins { | ||
id 'io.micronaut.build.internal.module' | ||
} |
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,2 @@ | ||
- suppressions.xml | ||
- checkstyle.xml |
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
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
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,13 @@ | ||
[versions] | ||
managed-graphql-java = "16.2" | ||
managed-graphql-java-extended-scalars = "1.0.1" | ||
managed-graphql-java-tools = "11.0.1" | ||
managed-graphql-spqr = "0.11.2" | ||
|
||
[libraries] | ||
managed-graphql-java = { module = 'com.graphql-java:graphql-java', version.ref = 'managed-graphql-java' } | ||
managed-graphql-java-extended-scalars = { module = 'com.graphql-java:graphql-java-extended-scalars', version.ref = 'managed-graphql-java-extended-scalars' } | ||
managed-graphql-java-tools = { module = 'com.graphql-java-kickstart:graphql-java-tools', version.ref = 'managed-graphql-java-tools' } | ||
managed-graphql-spqr = { module = 'io.leangen.graphql:spqr', version.ref = 'managed-graphql-spqr' } | ||
|
||
reactor-core = { module = 'io.projectreactor:reactor-core' } |
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,15 @@ | ||
plugins { | ||
id "io.micronaut.build.internal.bom" | ||
} | ||
|
||
// First BOM release, this can be removed after a BOM is out | ||
micronautBuild { | ||
// Required as a workaround to https://github.com/micronaut-projects/micronaut-build/pull/376 | ||
tasks.named("checkVersionCatalogCompatibility") { onlyIf { false } } | ||
} | ||
|
||
micronautBom { | ||
excludeProject.set({ p -> | ||
p.name.contains('example') || p.name.contains('hello-world') | ||
} as Spec<String>) | ||
} |
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