This commit adds support for adding extension entries to the Maven pom.
This is useful to be able to use plugins that are dependent on OS
version, for example, by extending with the os-maven plugin.
See gh-1290
This commit improves the annotation support so that it handles more
attribute types. An AnnotationContainer is introduced that permits to
further configure an annotation, in particular attribute values can be
added, and an attribute can be removed.
This commit adds a number of deprecations:
* Annotation#getName has been deprecated in favor of
Annotation#getClasName.
* Annotable#annotate has been deprecated in favor of
Annotable#annotations()#add.
* Annotable#getAnnotations has been deprecated in favor of
Annotable#annotations()#values.
* Annotation#name has been deprecated in favor of Annotation#of.
* Annotation.Builder#attribute has been deprecated in favor of
Annotation.Builder#set.
In particular, the type of the attribute does not need to be specified
as it is infered from the specified values. Use Annotation.Builder#add
or Annotation.Builder#set depending on your needs.
Closes gh-1424
This commit introduces a way to build more complex statement, including
multi statements and nested method invocations. CodeBlock is heavily
inspired from Square's JavaPoet project.
A CodeBlock is an immutable piece of code that provide the imports that
are needed and can emit code to an IndentingWriter.
This commit also migrates the use of expressions in Java, Kotlin, and
Groovy to the newly introduced CodeBlock. Those are deprecated in
favor of CodeBlock.
Closes gh-1043
This commit provides an escape hatch for the DSL that we currently don't
support in a gradle build. Snippets can be added with a callback to an
IndentingWriter. For convenience, imports can be added as well.
Snippets are rendered at the end of the file.
Closes gh-1079
At present, generated Gradle build scripts that use Groovy DSL configure
tasks eagerly. This is both suboptimal and actually not aligned with the
generated build scripts that use Kotlin DSL, which configures tasks
lazily.
This commit updates `GroovyDslGradleBuildWriter` to ensure tasks are
configured lazily.
See gh-1292
This commit improves the handling of repositories with Maven.
Previously, the writer wrongly assumed that the default for releases
and snapshots are true and false respectively. However, both defaults
are true which means that snapshots repository are considered for
releases, and releases repositories are considered for snapshots.
MavenRepository has now separate flags for those and the writer makes
sure to only update the `enabled` flag if the chosen value is not
true. This doesn't increase the content for repository definitions
while offering better performance for dependencies resolution.
Closes gh-1226
This commit adds a mapping strategy for Gradle plugins that don't have
a plugin marker artifact. This is necessary to avoid using a buildScript
section to declare the plugin implementation artifact.
Closes gh-1189
Previously, a nested structure of a Maven Plugin configuration can be
only configured for a single parameter. This commit adds a dedicated
method to add a new entry with a nested structure every time it is
called. This effectively allows to configure nested "list" structure
such as listing dependency exclusions.
Closes gh-1165
This commit exposes an additional protected method in ProjectGenerator
that sub-classes can override to alter the list of
`@ProjectGenerationConfiguration`-annotated types that are used to load
candidate contributors.
Closes gh-870
This commit clarifies that Version now handles two different formats,
the original one (flagged V1) and a SemVer compliant format (flagged
V2). Both Version and VersionRange can switch from one format to the
other to produce backward compatible content.
See gh-1092
This commit improves the version parser to handle qualifiers that are
separated by either a `.` or a `-`. This makes the parsing of
`1.2.0-RC1` or `2020.0.0-M1` possible.
Closes gh-1083