Skip to content

Commit

Permalink
build: Migrate to version catalog and add a BOM (#233)
Browse files Browse the repository at this point in the history
Supersedes #228

Co-authored-by: Alexey Zhokhov <[email protected]>
  • Loading branch information
timyates and donbeave authored May 19, 2022
1 parent 9427956 commit 734ea01
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 65 deletions.
82 changes: 82 additions & 0 deletions CONTRIBUTING.md
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-acme). 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-acme/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+help+wanted%22).

## JDK Setup

Micronaut ACME currently requires JDK 8.

## IDE Setup

Micronaut ACME can be imported into IntelliJ IDEA by opening the `build.gradle` file.

## Docker Setup

Micronaut ACME 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 ACME 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 ACME 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 acme-bom/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id "io.micronaut.build.internal.bom"
}
51 changes: 12 additions & 39 deletions acme/build.gradle
Original file line number Diff line number Diff line change
@@ -1,44 +1,17 @@
plugins {
id "io.micronaut.build.internal.module"
}

configurations {
documentation
id 'io.micronaut.build.internal.module'
}

dependencies {
annotationProcessor("io.micronaut:micronaut-inject-java")
annotationProcessor "io.micronaut.docs:micronaut-docs-asciidoc-config-props:$micronautDocsVersion"

implementation("io.micronaut:micronaut-http")
implementation("io.micronaut:micronaut-http-server")
implementation("io.micronaut:micronaut-http-server-netty")
implementation("io.micronaut:micronaut-inject")
implementation 'jakarta.inject:jakarta.inject-api:2.0.1'

implementation "org.shredzone.acme4j:acme4j-client:${acmeVersion}"
implementation "org.shredzone.acme4j:acme4j-utils:${acmeVersion}"

implementation "io.netty:netty-tcnative-boringssl-static:$tcnativeBoringsslStatic"

documentation "org.codehaus.groovy:groovy-templates:${groovyVersion}"
documentation "org.codehaus.groovy:groovy-dateutil:${groovyVersion}"

testImplementation "org.testcontainers:spock:1.16.3"
testImplementation("io.micronaut:micronaut-http-client")
testImplementation("org.codehaus.groovy:groovy-dateutil:$groovyVersion")
testImplementation("org.codehaus.groovy:groovy-json:$groovyVersion")
testImplementation("org.spockframework:spock-core:${spockVersion}") {
exclude module:'groovy-all'
}
testImplementation "cglib:cglib-nodep:${cglibVersion}"
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "io.micronaut.test:micronaut-test-spock:${micronautTestVersion}"
testImplementation "org.codehaus.groovy:groovy-test:${groovyVersion}"
testImplementation "org.objenesis:objenesis:${objenesisVersion}"
testRuntimeOnly "ch.qos.logback:logback-classic:${logbackClassicVersion}"
}

groovydoc {
classpath += project.configurations.documentation
implementation libs.micronaut.http
implementation libs.micronaut.http.server
implementation libs.micronaut.http.server.netty
implementation libs.managed.acme4j.client
implementation libs.managed.acme4j.utils
implementation libs.netty.tcnative.boringssl.static

testImplementation libs.testcontainers.spock
testImplementation libs.groovy.json
testImplementation libs.groovy.dateutil
testImplementation libs.micronaut.http.client
}
15 changes: 0 additions & 15 deletions config/checkstyle/HEADER

This file was deleted.

13 changes: 3 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
projectVersion=3.1.1-SNAPSHOT
projectVersion=3.2.0-SNAPSHOT
projectGroup=io.micronaut.acme

micronautDocsVersion=2.0.0
micronautVersion=3.3.4
micronautVersion=3.4.4
micronautTestVersion=3.2.0

groovyVersion=3.0.10
spockVersion=2.0-groovy-3.0

acmeVersion=2.13
objenesisVersion=3.2
logbackClassicVersion=1.2.11
tcnativeBoringsslStatic=2.0.52.Final
cglibVersion=3.3.0

title=Micronaut Acme
projectDesc=Extensions to integrate Micronaut and Acme
projectUrl=https://micronaut.io
githubSlug=micronaut-projects/micronaut-acme
developers=Nathan Zender

githubCoreBranch=3.4.x
githubCoreBranch=3.5.x
bomProperty=micronautAcmeVersion

org.gradle.caching=true
Expand Down
18 changes: 18 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[versions]
managed-acme4j = "2.12"

[libraries]
managed-acme4j-client = { module = 'org.shredzone.acme4j:acme4j-client', version.ref = 'managed-acme4j' }
managed-acme4j-utils = { module = 'org.shredzone.acme4j:acme4j-utils', version.ref = 'managed-acme4j' }

micronaut-http = { module = 'io.micronaut:micronaut-http' }
micronaut-http-server = { module = 'io.micronaut:micronaut-http-server' }
micronaut-http-server-netty = { module = 'io.micronaut:micronaut-http-server-netty' }
micronaut-http-client = { module = 'io.micronaut:micronaut-http-client' }

graal = { module = "org.graalvm.nativeimage:svm" }
netty-tcnative-boringssl-static = { module = 'io.netty:netty-tcnative-boringssl-static' }
testcontainers-spock = { module = 'org.testcontainers:spock' }

groovy-json = { module = 'org.codehaus.groovy:groovy-json' }
groovy-dateutil = { module = 'org.codehaus.groovy:groovy-dateutil' }
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ pluginManagement {
}

plugins {
id 'io.micronaut.build.shared.settings' version '5.3.7'
id 'io.micronaut.build.shared.settings' version '5.3.9'
}

rootProject.name = "acme-parent"

include 'acme-bom'
include "acme"

[
Expand Down

0 comments on commit 734ea01

Please sign in to comment.