Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and align Maven coordinates #2195

Merged
merged 2 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ This project adheres to [Semantic Versioning](https://semver.org/).

## Unreleased

IMPORTANT: Maven coordinates have been changed for some module. Be sure to update them, to get latest changes!

| Old Maven coordinates | New Maven coordinates |
|----------------------------------------------------|--------------------------------------------------------|
| com.pinterest.ktlint | com.pinterest.ktlint.ktlint-cli |
Copy link
Contributor

@PaulWoitaschek PaulWoitaschek Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the coordinates are actually with a double colon:

I.e.
com.pinterest:ktlint -> com.pinterest.ktlint:ktlint-cli

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tnx. Fixed via #2264

| com.pinterest.ktlint.ktlint-reporter-baseline | com.pinterest.ktlint.ktlint-cli-reporter-baseline |
| com.pinterest.ktlint.ktlint-reporter-checkstyle | com.pinterest.ktlint.ktlint-cli-reporter-checkstyle |
| com.pinterest.ktlint.ktlint-cli-reporter | com.pinterest.ktlint.ktlint-cli-reporter-core |
| com.pinterest.ktlint.ktlint-reporter-format | com.pinterest.ktlint.ktlint-cli-reporter-format |
| com.pinterest.ktlint.ktlint-reporter-html | com.pinterest.ktlint.ktlint-cli-reporter-html |
| com.pinterest.ktlint.ktlint-reporter-json | com.pinterest.ktlint.ktlint-cli-reporter-json |
| com.pinterest.ktlint.ktlint-reporter-plain | com.pinterest.ktlint.ktlint-cli-reporter-plain |
| com.pinterest.ktlint.ktlint-reporter-plain-summary | com.pinterest.ktlint.ktlint-cli-reporter-plain-summary |
| com.pinterest.ktlint.ktlint-reporter-sarif | com.pinterest.ktlint.ktlint-cli-reporter-sarif |
| com.pinterest.ktlint. | com.pinterest.ktlint. |
| com.pinterest.ktlint. | com.pinterest.ktlint. |

### API changes

* As a part of public API stabilization, data classes are no longer used in the public API. As of that, functions like `copy()` or `componentN()` (used for destructuring declarations) are not available anymore. This is a binary incompatible change, breaking backwards compatibility. ([#2133](https://github.com/pinterest/ktlint/issues/2133))
Expand Down
5 changes: 1 addition & 4 deletions build-logic/src/main/kotlin/ktlint-publication.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ project.version =
} else {
definedVersion
}
// TODO: Remove `localGradleProperty` once https://github.com/gradle/gradle/issues/23572 or https://github.com/pinterest/ktlint/issues/1931 is fixed.
project.group = localGradleProperty("GROUP").orNull ?: providers.gradleProperty("GROUP").orNull
?: throw GradleException("Project group property is missing")
paul-dingemans marked this conversation as resolved.
Show resolved Hide resolved

publishing {
publications {
create<MavenPublication>("maven") {
groupId = group.toString()
groupId = localGradleProperty("POM_GROUP_ID").get()
version = version.toString()
artifactId = localGradleProperty("POM_ARTIFACT_ID").get()

Expand Down
20 changes: 20 additions & 0 deletions documentation/snapshot/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@ By using ktlint you put the importance of code clarity and community conventions

ktlint is a single binary with both linter & formatter included. All you need is to drop it in (no need to get [overwhelmed](https://en.wikipedia.org/wiki/Decision_fatigue) while choosing among [dozens of code style options](https://checkstyle.sourceforge.net/checks.html)).


## What are the Maven coordinates in Ktlint 1.x?

With the release of ktlint `1.0` the Maven coordinates of most modules have been changed. Now all ktlint modules are published in Maven group `com.pinterest.ktlint`. Also, the artifact id's of some modules have been changed.

The Maven coordinates of modules below have been changed:

| Old Maven coordinates | New Maven coordinates |
|------------------------------------------------------|----------------------------------------------------------|
| `com.pinterest.ktlint` | `com.pinterest.ktlint.ktlint-cli` |
| `com.pinterest.ktlint.ktlint-reporter-baseline` | `com.pinterest.ktlint.ktlint-cli-reporter-baseline` |
| `com.pinterest.ktlint.ktlint-reporter-checkstyle` | `com.pinterest.ktlint.ktlint-cli-reporter-checkstyle` |
| `com.pinterest.ktlint.ktlint-cli-reporter` | `com.pinterest.ktlint.ktlint-cli-reporter-core` |
| `com.pinterest.ktlint.ktlint-reporter-format` | `com.pinterest.ktlint.ktlint-cli-reporter-format` |
| `com.pinterest.ktlint.ktlint-reporter-html` | `com.pinterest.ktlint.ktlint-cli-reporter-html` |
| `com.pinterest.ktlint.ktlint-reporter-json` | `com.pinterest.ktlint.ktlint-cli-reporter-json` |
| `com.pinterest.ktlint.ktlint-reporter-plain` | `com.pinterest.ktlint.ktlint-cli-reporter-plain` |
| `com.pinterest.ktlint.ktlint-reporter-plain-summary` | `com.pinterest.ktlint.ktlint-cli-reporter-plain-summary` |
| `com.pinterest.ktlint.ktlint-reporter-sarif` | `com.pinterest.ktlint.ktlint-cli-reporter-sarif` |

## How do I enable or disable a rule?

An individual rule can be enabled or disabled with a rule property. The name of the rule property consists of the `ktlint_` prefix followed by the rule set id followed by a `_` and the rule id. Examples:
Expand Down
6 changes: 6 additions & 0 deletions documentation/snapshot/overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@
<strong>RELEASE version of the documentation</strong>
</a>
{% endblock %}

<strong>The maven coordinates of `ktlint` have been changed. See
<a href="{{ '../' ~ base_url }}/dev-snapshot/faq/#what-are-the-maven-coordinates-in-ktlint-1x">
new Maven coordinates
</a>
</strong>
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_NAME=0.50.1-SNAPSHOT
GROUP=com.pinterest.ktlint
VERSION_NAME=1.0.0-SNAPSHOT
POM_GROUP_ID=com.pinterest.ktlint

POM_DESCRIPTION=An anti-bikeshedding Kotlin linter with built-in formatter.

Expand Down
5 changes: 2 additions & 3 deletions ktlint-cli-reporter-baseline/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# TODO: https://github.com/pinterest/ktlint/issues/1931 Rename POM to ktlint-cli-reporter-baseline whenever releasing version 1.0
POM_NAME=ktlint-reporter-baseline
POM_ARTIFACT_ID=ktlint-reporter-baseline
POM_NAME=ktlint-cli-reporter-baseline
POM_ARTIFACT_ID=ktlint-cli-reporter-baseline
5 changes: 2 additions & 3 deletions ktlint-cli-reporter-checkstyle/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# TODO: https://github.com/pinterest/ktlint/issues/1931 Rename POM to ktlint-cli-reporter-checkstyle whenever releasing version 1.0
POM_NAME=ktlint-reporter-checkstyle
POM_ARTIFACT_ID=ktlint-reporter-checkstyle
POM_NAME=ktlint-cli-reporter-checkstyle
POM_ARTIFACT_ID=ktlint-cli-reporter-checkstyle
5 changes: 2 additions & 3 deletions ktlint-cli-reporter-core/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# TODO: https://github.com/pinterest/ktlint/issues/1931 Rename POM to ktlint-cli-reporter-core whenever releasing version 1.0
POM_NAME=ktlint-cli-reporter
POM_ARTIFACT_ID=ktlint-cli-reporter
POM_NAME=ktlint-cli-reporter-core
POM_ARTIFACT_ID=ktlint-cli-reporter-core
5 changes: 2 additions & 3 deletions ktlint-cli-reporter-format/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# TODO: https://github.com/pinterest/ktlint/issues/1931 Rename POM to ktlint-cli-reporter-format whenever releasing version 1.0
POM_NAME=ktlint-reporter-format
POM_ARTIFACT_ID=ktlint-reporter-format
POM_NAME=ktlint-cli-reporter-format
POM_ARTIFACT_ID=ktlint-cli-reporter-format
5 changes: 2 additions & 3 deletions ktlint-cli-reporter-html/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# TODO: https://github.com/pinterest/ktlint/issues/1931 Rename POM to ktlint-cli-reporter-html whenever releasing version 1.0
POM_NAME=ktlint-reporter-html
POM_ARTIFACT_ID=ktlint-reporter-html
POM_NAME=ktlint-cli-reporter-html
POM_ARTIFACT_ID=ktlint-cli-reporter-html
5 changes: 2 additions & 3 deletions ktlint-cli-reporter-json/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# TODO: https://github.com/pinterest/ktlint/issues/1931 Rename POM to ktlint-cli-reporter-json whenever releasing version 1.0
POM_NAME=ktlint-reporter-json
POM_ARTIFACT_ID=ktlint-reporter-json
POM_NAME=ktlint-cli-reporter-json
POM_ARTIFACT_ID=ktlint-cli-reporter-json
5 changes: 2 additions & 3 deletions ktlint-cli-reporter-plain-summary/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# TODO: https://github.com/pinterest/ktlint/issues/1931 Rename POM to ktlint-cli-reporter-plain-summary whenever releasing version 1.0
POM_NAME=ktlint-reporter-plain-summary
POM_ARTIFACT_ID=ktlint-reporter-plain-summary
POM_NAME=ktlint-cli-reporter-plain-summary
POM_ARTIFACT_ID=ktlint-cli-reporter-plain-summary
5 changes: 2 additions & 3 deletions ktlint-cli-reporter-plain/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# TODO: https://github.com/pinterest/ktlint/issues/1931 Rename POM to ktlint-cli-reporter-plain whenever releasing version 1.0
POM_NAME=ktlint-reporter-plain
POM_ARTIFACT_ID=ktlint-reporter-plain
POM_NAME=ktlint-cli-reporter-plain
POM_ARTIFACT_ID=ktlint-cli-reporter-plain
5 changes: 2 additions & 3 deletions ktlint-cli-reporter-sarif/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# TODO: Rename POM to ktlint-cli-reporter-sarif whenever releasing version 1.0
POM_NAME=ktlint-reporter-sarif
POM_ARTIFACT_ID=ktlint-reporter-sarif
POM_NAME=ktlint-cli-reporter-sarif
POM_ARTIFACT_ID=ktlint-cli-reporter-sarif
6 changes: 2 additions & 4 deletions ktlint-cli/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# TODO: https://github.com/pinterest/ktlint/issues/1931
GROUP=com.pinterest
POM_NAME=ktlint
POM_ARTIFACT_ID=ktlint
POM_NAME=ktlint-cli
POM_ARTIFACT_ID=ktlint-cli