Package io.gitlab.ntduycse.extension
Class SpringQuickstartExtension
java.lang.Object
io.gitlab.ntduycse.extension.SpringQuickstartExtension
Gradle DSL extension registered as
spring { } on the project.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<Convention> static final Stringstatic final intstatic final BigDecimalstatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionSpringQuickstartExtension(org.gradle.api.model.ObjectFactory objects, org.gradle.api.file.ProjectLayout layout) -
Method Summary
Modifier and TypeMethodDescriptionvoidcoverageThreshold(double value) voidcoverageThreshold(String value) Convenience setter forgetCoverageThreshold()accepting a decimal string (e.g.voidcoverageThreshold(BigDecimal value) Convenience setter forgetCoverageThreshold()accepting aBigDecimal.disable(Convention... conventions) Removes one or more conventions fromgetEnabled()while keeping the rest.enable(Convention... conventions) Adds one or more conventions togetEnabled()without overwriting the existing set.org.gradle.api.provider.ListProperty<String> Ant-style patterns excluded from JaCoCoclassDirectoriesforjacocoTestReportandjacocoTestCoverageVerification.org.gradle.api.provider.Property<BigDecimal> Minimum line coverage (0.0–1.0) forjacocoTestCoverageVerification.org.gradle.api.provider.SetProperty<Convention> Enabled conventions.org.gradle.api.file.DirectoryPropertyDirectory for integration tests, relative to the project directory.org.gradle.api.provider.Property<org.gradle.api.JavaVersion> Java language version forjava { toolchain { languageVersion = ... } }.org.gradle.api.provider.Property<String> ktfmt version used by the Spotless Kotlin step for Kotlin (Gradle) scripts.org.gradle.api.provider.Property<String> Lombok version used for allorg.projectlombok:lombokdependencies added by the plugin.org.gradle.api.provider.ListProperty<String> MapStruct compiler arguments forJavaCompiletasks.org.gradle.api.provider.Property<String> Lombok/MapStruct binding version used fororg.projectlombok:lombok-mapstruct-binding(added onannotationProcessorwhen Lombok is detected).org.gradle.api.provider.Property<String> Version used fororg.mapstruct.extensions.spring:mapstruct-spring-extensionsandmapstruct-spring-annotations.org.gradle.api.provider.Property<String> MapStruct version used fororg.mapstruct:mapstructandmapstruct-processor.org.gradle.api.provider.Property<Integer> Minimum priority for PMD rules.org.gradle.api.provider.Property<String> PMD tool version applied to everyPmdtask (pmd { toolVersion }).org.gradle.api.provider.Property<String> Prettier version used by the Spotless YAML step.org.gradle.api.provider.Property<RepositoryType> Required.org.gradle.api.file.DirectoryPropertyDirectory for unit tests, relative to the project directory.org.gradle.api.provider.Property<Boolean> Whentrue, the plugin emits detailed progress lines (dependency lists, compiler arguments, coverage exclusions, task graph) atlifecyclelevel.
-
Field Details
-
EXTENSION_NAME
- See Also:
-
DEFAULT_ENABLED_CONVENTIONS
-
DEFAULT_JACOCO_EXCLUDED_PATTERNS
-
DEFAULT_MAPSTRUCT_COMPILE_ARGS
-
DEFAULT_TEST_COVERAGE
-
DEFAULT_PMD_RULES_MIN_PRIORITY
public static final int DEFAULT_PMD_RULES_MIN_PRIORITY- See Also:
-
DEFAULT_UNIT_TEST_DIR
- See Also:
-
DEFAULT_INTEGRATION_TEST_DIR
- See Also:
-
-
Constructor Details
-
SpringQuickstartExtension
@Inject public SpringQuickstartExtension(org.gradle.api.model.ObjectFactory objects, org.gradle.api.file.ProjectLayout layout)
-
-
Method Details
-
coverageThreshold
Convenience setter forgetCoverageThreshold()accepting aBigDecimal.- Parameters:
value- the coverage threshold
-
coverageThreshold
Convenience setter forgetCoverageThreshold()accepting a decimal string (e.g."0.85").- Parameters:
value- the coverage threshold
-
coverageThreshold
public void coverageThreshold(double value) - Parameters:
value- the coverage threshold
-
disable
Removes one or more conventions fromgetEnabled()while keeping the rest. The current value ofenabledis read at call time, sodisable(...)must be invoked after anyenabled.set(...)/enabled.add(...)the user wants to be effective for the removal. Usage:spring { disable(Convention.PMD) }- Parameters:
conventions- the conventions to disable- Returns:
- this extension for chaining
-
enable
Adds one or more conventions togetEnabled()without overwriting the existing set. Usage:spring { enable(Convention.JACOCO, Convention.LOMBOK) }- Parameters:
conventions- the conventions to enable- Returns:
- this extension for chaining
-
getCoverageExclusion
Ant-style patterns excluded from JaCoCoclassDirectoriesforjacocoTestReportandjacocoTestCoverageVerification. Defaults toDEFAULT_JACOCO_EXCLUDED_PATTERNS. Useset(...)orset([])to replace that list entirely; an empty list applies no excludes.- Returns:
- the coverage exclusion patterns
-
getCoverageThreshold
Minimum line coverage (0.0–1.0) forjacocoTestCoverageVerification. Default0.90(90%). For convenience prefer the overloaded setterscoverageThreshold(double)/coverageThreshold(String)in build scripts.- Returns:
- the coverage threshold
-
getEnabled
Enabled conventions. Defaults toDEFAULT_ENABLED_CONVENTIONS. Useset(...)orset([])to replace that list entirely; an empty list applies no conventions. Preferenable(Convention...)/disable(Convention...)for additive edits.- Returns:
- the enabled conventions
-
getIntegrationTestDir
public org.gradle.api.file.DirectoryProperty getIntegrationTestDir()Directory for integration tests, relative to the project directory. Defaults toDEFAULT_INTEGRATION_TEST_DIR.Typed as
DirectoryPropertyso it participates in Gradle's file API (task inputs,Provider<RegularFile>wiring). In Groovy/Kotlin DSL build scripts you can still assign aString— Gradle coerces it vialayout.projectDirectory.dir(...).- Returns:
- the integration test directory
-
getJavaVersion
public org.gradle.api.provider.Property<org.gradle.api.JavaVersion> getJavaVersion()Java language version forjava { toolchain { languageVersion = ... } }. Defaults toJavaVersion.VERSION_21.- Returns:
- the Java language version
-
getKtfmtVersion
ktfmt version used by the Spotless Kotlin step for Kotlin (Gradle) scripts. Defaults toVersions.KTFMT.- Returns:
- the ktfmt version
-
getLombokVersion
Lombok version used for allorg.projectlombok:lombokdependencies added by the plugin. Defaults toVersions.LOMBOK.- Returns:
- the Lombok version
-
getMapstructCompileArgs
MapStruct compiler arguments forJavaCompiletasks. Defaults toDEFAULT_MAPSTRUCT_COMPILE_ARGS. Useset(...)orset([])to replace that list entirely; an empty list applies no arguments.- Returns:
- the MapStruct compiler arguments
-
getMapstructLombokBindingVersion
Lombok/MapStruct binding version used fororg.projectlombok:lombok-mapstruct-binding(added onannotationProcessorwhen Lombok is detected). Defaults toVersions.MAPSTRUCT_LOMBOK_BINDING.- Returns:
- the Lombok/MapStruct binding version
-
getMapstructSpringExtensionsVersion
Version used fororg.mapstruct.extensions.spring:mapstruct-spring-extensionsandmapstruct-spring-annotations. Defaults toVersions.MAPSTRUCT_SPRING_EXTENSIONS.- Returns:
- the MapStruct Spring extensions version
-
getMapstructVersion
MapStruct version used fororg.mapstruct:mapstructandmapstruct-processor. Defaults toVersions.MAPSTRUCT.- Returns:
- the MapStruct version
-
getPmdRulesMinPriority
Minimum priority for PMD rules. Defaults toDEFAULT_PMD_RULES_MIN_PRIORITY.- Returns:
- the minimum priority for PMD rules
-
getPmdToolVersion
- Returns:
- the PMD tool version
-
getPrettierVersion
Prettier version used by the Spotless YAML step. Defaults toVersions.PRETTIER.- Returns:
- the Prettier version
-
getRepoType
Required. Set toRepositoryType.LIBRARYorRepositoryType.APPLICATION.- Returns:
- the repository type
-
getUnitTestDir
public org.gradle.api.file.DirectoryProperty getUnitTestDir()Directory for unit tests, relative to the project directory. Defaults toDEFAULT_UNIT_TEST_DIR.Typed as
DirectoryPropertyso it participates in Gradle's file API (task inputs,Provider<RegularFile>wiring). In Groovy/Kotlin DSL build scripts you can still assign aString— Gradle coerces it vialayout.projectDirectory.dir(...).- Returns:
- the unit test directory
-
getVerbose
Whentrue, the plugin emits detailed progress lines (dependency lists, compiler arguments, coverage exclusions, task graph) atlifecyclelevel. Whenfalse(default), those details are demoted toinfolevel and only concise headers remain visible on a normal build. Can also be toggled at the command line with-Pspring.verbose=true.- Returns:
- the verbose flag
-