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

Add support for "conventional" project names #477

Merged
merged 2 commits into from
Jan 30, 2023
Merged

Conversation

melix
Copy link
Contributor

@melix melix commented Jan 30, 2023

This commit adds the ability to use conventional project names, that is to say project names which start with micronaut-. This allows having publications which artifact id match the project name. Not having this is source of trouble for using composite builds, since Gradle wouldn't be able to determine the substitutions automatically. Changing the project names to match the artifact id fixes this issue, at the cost of some drawbacks:

  • full task paths will now use :micronaut-xxx as a prefix, instead of just :xxx
  • project dependencies will be broken when this feature is enabled. For example, a dependency on project(":foo") will have to be rewritten to project(":micronaut-foo")

The change is not applied to the root project (which is not published in any case), which will let us preserve the Gradle Enterprise history for that project. It is not applied either to projects which name starts with test-suite.

This feature is disabled by default for now, it needs to be enabled in the settings.gradle file, under the build extension:

micronautBuild {
    useStandardizedProjectNames = true
}

This commit adds the ability to use conventional project names,
that is to say project names which start with `micronaut-`. This
allows having publications which artifact id match the project name.
Not having this is source of trouble for using composite builds,
since Gradle wouldn't be able to determine the substitutions
automatically. Changing the project names to match the artifact
id fixes this issue, at the cost of some drawbacks:

   - full task paths will now use `:micronaut-xxx` as a prefix,
instead of just `:xxx`
   - project dependencies will be broken when this feature is
enabled. For example, a dependency on `project(":foo")` will
have to be rewritten to `project(":micronaut-foo")`

The change is _not_ applied to the root project (which is not
published in any case), which will let us preserve the Gradle
Enterprise history for that project. It is not applied either
to projects which name starts with `test-suite`.

This feature is _disabled by default_ for now, it needs to
be enabled in the `settings.gradle` file, under the build
extension:

```gradle
micronautBuild {
    useStandardizedProjectNames = true
}
```
@melix melix added the type: improvement A minor improvement to an existing feature label Jan 30, 2023
@melix melix added this to the 6.3.0 milestone Jan 30, 2023
@melix melix self-assigned this Jan 30, 2023
Copy link
Member

@alvarosanchez alvarosanchez left a comment

Choose a reason for hiding this comment

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

The only thing I would say is: can you please add a warning statement somewhere if useStandardizedProjectNames is false? So that at least we don't forget we need to enable it at some point.

I'm concerned that it may happen the same as with binary compatibility checks, that we turn them off to move on, and then forget about it forever.

@melix melix merged commit 698e2d0 into master Jan 30, 2023
@melix melix deleted the cc/rename-projects branch January 30, 2023 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants