diff --git a/CHANGELOG.md b/CHANGELOG.md index c5f38f6b..0d8ecd7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,8 @@ ### Updated +- `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.7.1` - `gradle -> 8.9` -- `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.7.0` ## [0.5.1] - 2024-03-29 diff --git a/gradle-version/main/kotlin/com/javiersc/gradle/version/GradleVersion.kt b/gradle-version/main/kotlin/com/javiersc/gradle/version/GradleVersion.kt index d8b05e62..1b91916a 100644 --- a/gradle-version/main/kotlin/com/javiersc/gradle/version/GradleVersion.kt +++ b/gradle-version/main/kotlin/com/javiersc/gradle/version/GradleVersion.kt @@ -91,8 +91,7 @@ private constructor( stageNum = null, commits = commits, hash = hash, - metadata = metadata - ) + metadata = metadata) } number == null && stageName.isBlank() -> { invoke( @@ -103,8 +102,7 @@ private constructor( stageNum = null, commits = commits, hash = hash, - metadata = metadata - ) + metadata = metadata) } number == null && stageName.isNotBlank() && stage?.name.isNullOrBlank() -> { invoke( @@ -115,8 +113,7 @@ private constructor( stageNum = incNum, commits = commits, hash = hash, - metadata = metadata - ) + metadata = metadata) } number == null && stageName.isNotBlank() && stageName == stage?.name -> { invoke( @@ -127,8 +124,7 @@ private constructor( stageNum = stage.num?.inc(), commits = commits, hash = hash, - metadata = metadata - ) + metadata = metadata) } number == null && stageName.isNotBlank() && stageName != stage?.name -> { invoke( @@ -139,8 +135,7 @@ private constructor( stageNum = incNum, commits = commits, hash = hash, - metadata = metadata - ) + metadata = metadata) } number is Increase.Major && stageName.isBlank() -> { invoke( @@ -151,8 +146,7 @@ private constructor( stageNum = null, commits = commits, hash = hash, - metadata = metadata - ) + metadata = metadata) } number is Increase.Minor && stageName.isBlank() -> { invoke( @@ -163,8 +157,7 @@ private constructor( stageNum = null, commits = commits, hash = hash, - metadata = metadata - ) + metadata = metadata) } number is Increase.Patch && stageName.isBlank() -> { invoke( @@ -175,8 +168,7 @@ private constructor( stageNum = null, commits = commits, hash = hash, - metadata = metadata - ) + metadata = metadata) } number is Increase.Major && stageName.isNotBlank() -> { invoke( @@ -187,8 +179,7 @@ private constructor( stageNum = incNum, commits = commits, hash = hash, - metadata = metadata - ) + metadata = metadata) } number is Increase.Minor && stageName.isNotBlank() -> { invoke( @@ -199,8 +190,7 @@ private constructor( stageNum = incNum, commits = commits, hash = hash, - metadata = metadata - ) + metadata = metadata) } number is Increase.Patch && stageName.isNotBlank() -> { invoke( @@ -211,16 +201,14 @@ private constructor( stageNum = incNum, commits = commits, hash = hash, - metadata = metadata - ) + metadata = metadata) } else -> null } ?: gradleVersionError("There were an error configuring the version") if (nextVersion < this) { gradleVersionError( - "Next version ($nextVersion) should be higher than the current one ($this)" - ) + "Next version ($nextVersion) should be higher than the current one ($this)") } return nextVersion } @@ -378,16 +366,7 @@ private constructor( checkMode: CheckMode = Insignificant, ): Result = runCatching { GradleVersion( - major, - minor, - patch, - stageName, - stageNum, - commits, - hash, - metadata, - checkMode - ) + major, minor, patch, stageName, stageNum, commits, hash, metadata, checkMode) } public fun getOrNull( diff --git a/gradle-version/test/kotlin/com/javiersc/gradle/version/GradleVersionTest.kt b/gradle-version/test/kotlin/com/javiersc/gradle/version/GradleVersionTest.kt index 7024bb44..d5521c98 100644 --- a/gradle-version/test/kotlin/com/javiersc/gradle/version/GradleVersionTest.kt +++ b/gradle-version/test/kotlin/com/javiersc/gradle/version/GradleVersionTest.kt @@ -40,8 +40,7 @@ internal class GradleVersionTest { Arb.constant("rc"), Arb.constant("SNAPSHOT"), Arb.constant("zasca"), - Arb.constant(null) - ) + Arb.constant(null)) private val num = Arb.choice( Arb.positiveInt(11), @@ -62,8 +61,7 @@ internal class GradleVersionTest { Arb.constant("4Hash3h"), Arb.constant("0h2az2U"), Arb.constant("102aY20"), - Arb.constant(null) - ) + Arb.constant(null)) private val metadata = Arb.choice( @@ -77,8 +75,7 @@ internal class GradleVersionTest { Arb.constant("777777777"), Arb.constant("AAAA"), Arb.constant("BBBBBBBBB"), - Arb.constant(null) - ) + Arb.constant(null)) private val versionArbitrary: Arb = arbitrary { val major: Int = major.bind() diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 42a30653..58ca42cb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -hubdle = "0.7.0" +hubdle = "0.7.1" [plugins] javiersc-hubdle = { id = "com.javiersc.hubdle", version.ref = "hubdle" } diff --git a/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/internal/git/GitCache.kt b/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/internal/git/GitCache.kt index 4aeb5af8..f76c5c88 100644 --- a/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/internal/git/GitCache.kt +++ b/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/internal/git/GitCache.kt @@ -52,8 +52,7 @@ private constructor( message = headRevCommit.shortMessage, fullMessage = headRevCommit.fullMessage, hash = headRevCommit.toObjectId().name, - ) - ) + )) } internal val commitsInCurrentBranchRevCommit: List by lazy { @@ -130,8 +129,7 @@ private constructor( message = commit.shortMessage, fullMessage = commit.fullMessage, hash = commit.toObjectId().name, - ) - ) + )) } internal fun tagsInCurrentCommit(hash: String): List = @@ -185,9 +183,9 @@ private constructor( val higherVersion: GradleVersion? = versionsInCurrentBranch(tagPrefix).firstOrNull() - if ( - lastVersion != null && higherVersion != null && higherVersion > lastVersion - ) { + if (lastVersion != null && + higherVersion != null && + higherVersion > lastVersion) { isWarningLastVersionIsNotHigherVersion(true) warningLastVersionIsNotHigherVersion(lastVersion, higherVersion) } diff --git a/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/internal/git/GitRefGitExtensions.kt b/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/internal/git/GitRefGitExtensions.kt index 99dbaadc..cf803a9d 100644 --- a/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/internal/git/GitRefGitExtensions.kt +++ b/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/internal/git/GitRefGitExtensions.kt @@ -26,8 +26,7 @@ internal val Git.headCommit: GitRef.Head message = headRevCommit.shortMessage, fullMessage = headRevCommit.fullMessage, hash = headRevCommit.toObjectId().name, - ) - ) + )) internal val Git.headRevCommit: RevCommit get() = RevWalk(repository).parseCommit(repository.resolve(Constants.HEAD)) @@ -98,8 +97,7 @@ internal val Git.tagsInRepo: List message = commit.shortMessage, fullMessage = commit.fullMessage, hash = commit.toObjectId().name, - ) - ) + )) } internal val Git.tagsInRepoRef: List @@ -123,8 +121,7 @@ internal val Git.tagsInCurrentBranch: List message = commit.shortMessage, fullMessage = commit.fullMessage, hash = commit.toObjectId().name, - ) - ) + )) } internal val Git.tagsInCurrentBranchRef: List diff --git a/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/services/GitBuildService.kt b/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/services/GitBuildService.kt index 40766782..93f2abbd 100644 --- a/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/services/GitBuildService.kt +++ b/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/services/GitBuildService.kt @@ -91,17 +91,16 @@ constructor( internal fun register(project: Project): Provider = project.gradle.sharedServices.registerIfAbsent( - "gitTagBuildService", - GitBuildService::class - ) { buildService -> - val commitsMaxCount: Int = - project.commitsMaxCount.orNull ?: project.semverExtension.commitsMaxCount.get() - buildService.parameters.gitDir.set(project.semverExtension.gitDir) - buildService.parameters.commitsMaxCount.set(commitsMaxCount) - buildService.parameters.remoteProperty.set(project.remoteProperty) - - buildService.maxParallelUsages.set(1) - } + "gitTagBuildService", GitBuildService::class) { buildService -> + val commitsMaxCount: Int = + project.commitsMaxCount.orNull + ?: project.semverExtension.commitsMaxCount.get() + buildService.parameters.gitDir.set(project.semverExtension.gitDir) + buildService.parameters.commitsMaxCount.set(commitsMaxCount) + buildService.parameters.remoteProperty.set(project.remoteProperty) + + buildService.maxParallelUsages.set(1) + } } } diff --git a/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/tasks/PrintSemverTask.kt b/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/tasks/PrintSemverTask.kt index f173c629..4175584a 100644 --- a/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/tasks/PrintSemverTask.kt +++ b/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/tasks/PrintSemverTask.kt @@ -40,47 +40,42 @@ constructor( @Input @Option( option = "githubOnlyRoot", - description = "Set any GitHub option to work only on the root project `printSemver` task" - ) + description = "Set any GitHub option to work only on the root project `printSemver` task") public val githubOnlyRoot: Property = objects.property().convention(false) @Input @Option( option = "githubEnvTag", description = - "Set the version as `semver-tag-subproject-name` environment variable of the GitHub Actions" - ) + "Set the version as `semver-tag-subproject-name` environment variable of the GitHub Actions") public val githubEnvTag: Property = objects.property().convention(false) @Input @Option( option = "githubEnvVersion", description = - "Set the version as `semver-version-subproject-name` environment variable of the GitHub Actions" - ) + "Set the version as `semver-version-subproject-name` environment variable of the GitHub Actions") public val githubEnvVersion: Property = objects.property().convention(false) @Input @Option( option = "githubEnv", description = - "Set the version as `semver-subproject-name` environment variable of the GitHub Actions" - ) + "Set the version as `semver-subproject-name` environment variable of the GitHub Actions") public val githubEnv: Property = objects.property().convention(false) @Input @Option( option = "githubOutputTag", - description = "Set the version as `semver-tag-subproject-name` output of the GitHub Actions" - ) + description = + "Set the version as `semver-tag-subproject-name` output of the GitHub Actions") public val githubOutputTag: Property = objects.property().convention(false) @Input @Option( option = "githubOutputVersion", description = - "Set the version as `semver-version-subproject-name` output of the GitHub Actions" - ) + "Set the version as `semver-version-subproject-name` output of the GitHub Actions") public val githubOutputVersion: Property = objects.property().convention(false) @@ -88,8 +83,7 @@ constructor( @Option( option = "githubOutput", description = - "Set the version as `semver-subproject-name` output of the GitHub Actions `semver` step ID" - ) + "Set the version as `semver-subproject-name` output of the GitHub Actions `semver` step ID") public val githubOutput: Property = objects.property().convention(false) @get:Input public abstract val tagPrefix: Property diff --git a/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/tasks/WriteSemverTask.kt b/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/tasks/WriteSemverTask.kt index 6a67d8fc..7cd5ae1b 100644 --- a/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/tasks/WriteSemverTask.kt +++ b/semver-project-gradle-plugin/main/kotlin/com/javiersc/semver/project/gradle/plugin/tasks/WriteSemverTask.kt @@ -56,8 +56,7 @@ constructor( |$semverWithPrefix | """ - .trimMargin() - ) + .trimMargin()) } } diff --git a/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/CalculatedVersionTest.kt b/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/CalculatedVersionTest.kt index 294e889e..a2d90eb8 100644 --- a/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/CalculatedVersionTest.kt +++ b/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/CalculatedVersionTest.kt @@ -22,8 +22,7 @@ internal class CalculatedVersionTest { commits = 0, hash = git.lastCommitInCurrentBranch!!.hash.take(7), metadata = null, - ) - ) + )) resolve("2 commit.txt").createNewFile() @@ -33,8 +32,7 @@ internal class CalculatedVersionTest { commits = 0, hash = git.lastCommitInCurrentBranch!!.hash.take(7), metadata = "DIRTY", - ) - ) + )) git.add().addFilepattern(".").call() git.commit().setMessage("2 commit").call() @@ -50,8 +48,7 @@ internal class CalculatedVersionTest { commits = 0, hash = null, metadata = "DIRTY", - ) - ) + )) git.add().addFilepattern(".").call() @@ -61,8 +58,7 @@ internal class CalculatedVersionTest { commits = 0, hash = null, metadata = "DIRTY", - ) - ) + )) git.commit().setMessage("3 commit").call() @@ -72,8 +68,7 @@ internal class CalculatedVersionTest { commits = 1, hash = git.lastCommitInCurrentBranch!!.hash.take(7), metadata = null, - ) - ) + )) } } diff --git a/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/GitCommitTest.kt b/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/GitCommitTest.kt index 9f1ed98a..a4dad382 100644 --- a/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/GitCommitTest.kt +++ b/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/GitCommitTest.kt @@ -56,8 +56,7 @@ internal class GitCommitTest { git.commitsInCurrentBranchRevCommit.map(RevCommit::getShortMessage).shouldBe(messages) git.commitsInCurrentBranch.map(GitRef.Commit::message).shouldBe(messages) git.commitsInCurrentBranchHash.shouldBe( - git.commitsInCurrentBranch.map(GitRef.Commit::hash) - ) + git.commitsInCurrentBranch.map(GitRef.Commit::hash)) } } diff --git a/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/GitTagTest.kt b/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/GitTagTest.kt index 14f592dd..bdb15a5e 100644 --- a/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/GitTagTest.kt +++ b/semver-project-gradle-plugin/test/kotlin/com/javiersc/semver/project/gradle/plugin/GitTagTest.kt @@ -121,8 +121,7 @@ internal class GitTagTest { "refs/tags/hello", "refs/tags/v100", "refs/tags/vhello", - ) - ) + )) resolve("Second commit.txt").createNewFile() git.add().addFilepattern(".").call() @@ -135,8 +134,7 @@ internal class GitTagTest { "refs/tags/v100", "refs/tags/v3.0.0", "refs/tags/vhello", - ) - ) + )) git.tag().setName("v1.0.0").call() git.tagsInRepoName.shouldBe( @@ -146,8 +144,7 @@ internal class GitTagTest { "refs/tags/v100", "refs/tags/v3.0.0", "refs/tags/vhello", - ) - ) + )) git.tag().setName("v2.0.0").call() git.tag().setName("v200").call() @@ -162,8 +159,7 @@ internal class GitTagTest { "refs/tags/v200", "refs/tags/v3.0.0", "refs/tags/vhello", - ) - ) + )) } } @@ -180,8 +176,7 @@ internal class GitTagTest { "hello", "v100", "vhello", - ) - ) + )) resolve("Second commit.txt").createNewFile() git.add().addFilepattern(".").call() @@ -196,8 +191,7 @@ internal class GitTagTest { "v100", "v3.0.0", "vhello", - ) - ) + )) git.tag().setName("v1.0.0").call() git.tagsInCurrentBranch @@ -209,8 +203,7 @@ internal class GitTagTest { "v100", "v3.0.0", "vhello", - ) - ) + )) git.tag().setName("v2.0.0").call() git.tag().setName("v200").call() @@ -227,8 +220,7 @@ internal class GitTagTest { "v200", "v3.0.0", "vhello", - ) - ) + )) } } @@ -245,8 +237,7 @@ internal class GitTagTest { "hello", "v100", "vhello", - ) - ) + )) resolve("Second commit.txt").createNewFile() git.add().addFilepattern(".").call() @@ -261,8 +252,7 @@ internal class GitTagTest { "v100", "v3.0.0", "vhello", - ) - ) + )) git.tag().setName("v1.0.0").call() git.tagsInCurrentBranchRef @@ -274,8 +264,7 @@ internal class GitTagTest { "v100", "v3.0.0", "vhello", - ) - ) + )) git.tag().setName("v2.0.0").call() git.tag().setName("v200").call() @@ -292,8 +281,7 @@ internal class GitTagTest { "v200", "v3.0.0", "vhello", - ) - ) + )) } } @@ -338,8 +326,7 @@ internal class GitTagTest { "refs/tags/hello", "refs/tags/v100", "refs/tags/vhello", - ) - ) + )) resolve("Second commit.txt").createNewFile() git.add().addFilepattern(".").call() @@ -352,8 +339,7 @@ internal class GitTagTest { "refs/tags/v100", "refs/tags/v3.0.0", "refs/tags/vhello", - ) - ) + )) git.tag().setName("v1.0.0").call() git.tagsInCurrentBranchName.shouldBe( @@ -363,8 +349,7 @@ internal class GitTagTest { "refs/tags/v100", "refs/tags/v3.0.0", "refs/tags/vhello", - ) - ) + )) git.tag().setName("v2.0.0").call() git.tag().setName("v200").call() @@ -379,8 +364,7 @@ internal class GitTagTest { "refs/tags/v200", "refs/tags/v3.0.0", "refs/tags/vhello", - ) - ) + )) } } @@ -397,8 +381,7 @@ internal class GitTagTest { "hello", "v100", "vhello", - ) - ) + )) resolve("Second commit.txt").createNewFile() git.add().addFilepattern(".").call() @@ -410,8 +393,7 @@ internal class GitTagTest { .shouldBe( listOf( "v1.0.0", - ) - ) + )) git.tag().setName("v2.0.0").call() git.tag().setName("v200").call() @@ -424,8 +406,7 @@ internal class GitTagTest { "v2.0.0", "v20.20", "v200", - ) - ) + )) } } @@ -531,8 +512,7 @@ internal class GitTagTest { "v1.0.0-alpha.22", "v2.0.0", "v3.0.0", - ) - ) + )) git.tag().setName("v1.0.0-rc.22").call() git.tag().setName("v1.0.0-rc.11").call() @@ -556,8 +536,7 @@ internal class GitTagTest { "v1.0.0-rc.22", "v2.0.0", "v3.0.0", - ) - ) + )) git.tag().setName("v200").call() git.tag().setName("v20.20").call() @@ -578,8 +557,7 @@ internal class GitTagTest { "v1.0.0-rc.22", "v2.0.0", "v3.0.0", - ) - ) + )) } } @@ -627,8 +605,7 @@ internal class GitTagTest { "v1.0.0", "v2.0.0", "v3.0.0", - ) - ) + )) git.tag().setName("v1.0.0-rc.22").call() git.tag().setName("v1.0.0-rc.11").call() @@ -653,8 +630,7 @@ internal class GitTagTest { "v1.0.0", "v2.0.0", "v3.0.0", - ) - ) + )) git.tag().setName("v200").call() git.tag().setName("v20.20").call() @@ -676,8 +652,7 @@ internal class GitTagTest { "v1.0.0", "v2.0.0", "v3.0.0", - ) - ) + )) } } @@ -729,8 +704,7 @@ internal class GitTagTest { "v1.0.0", "v2.0.0", "v3.0.0", - ) - ) + )) git.tag().setName("v1.0.0-rc.22").call() git.tag().setName("v1.0.0-rc.11").call() @@ -755,8 +729,7 @@ internal class GitTagTest { "v1.0.0", "v2.0.0", "v3.0.0", - ) - ) + )) git.tag().setName("v200").call() git.tag().setName("v20.20").call() @@ -778,8 +751,7 @@ internal class GitTagTest { "v1.0.0", "v2.0.0", "v3.0.0", - ) - ) + )) } } diff --git a/semver-project-gradle-plugin/testFixtures/kotlin/com/javiersc/semver/project/gradle/plugin/AssertVersion.kt b/semver-project-gradle-plugin/testFixtures/kotlin/com/javiersc/semver/project/gradle/plugin/AssertVersion.kt index e6240c4e..a631597c 100644 --- a/semver-project-gradle-plugin/testFixtures/kotlin/com/javiersc/semver/project/gradle/plugin/AssertVersion.kt +++ b/semver-project-gradle-plugin/testFixtures/kotlin/com/javiersc/semver/project/gradle/plugin/AssertVersion.kt @@ -76,8 +76,7 @@ internal fun File.assertVersion( |$prefix$version | """ - .trimMargin() - ) + .trimMargin()) } } } diff --git a/semver-project-gradle-plugin/testFixtures/kotlin/com/javiersc/semver/project/gradle/plugin/Sandbox.kt b/semver-project-gradle-plugin/testFixtures/kotlin/com/javiersc/semver/project/gradle/plugin/Sandbox.kt index cdc5258a..9c366483 100644 --- a/semver-project-gradle-plugin/testFixtures/kotlin/com/javiersc/semver/project/gradle/plugin/Sandbox.kt +++ b/semver-project-gradle-plugin/testFixtures/kotlin/com/javiersc/semver/project/gradle/plugin/Sandbox.kt @@ -18,8 +18,7 @@ internal val GradleRunner.git: Git .setGitDir(File("$projectDir/.git")) .readEnvironment() .findGitDir() - .build() - ) + .build()) val File.git: Git get() = @@ -28,8 +27,7 @@ val File.git: Git .setGitDir(resolve(".git")) .readEnvironment() .findGitDir() - .build() - ) + .build()) internal fun getResource(resource: String): File = File(Thread.currentThread().contextClassLoader?.getResource(resource)?.toURI()!!) @@ -65,15 +63,13 @@ internal fun File.generateInitialCommitAddVersionTagAndAddNewCommit( fullMessage = "Add new2", hash = "f099fed42808c387d38f8e34934d4ef2d6f3c2c5", timestampEpochSecond = Instant.now().epochSecond, - tags = emptyList() - ), + tags = emptyList()), Commit( message = "Add new", fullMessage = "Add new", hash = "0d9be4d12a836435c91fc38e0d64bcd3c14c89c8", timestampEpochSecond = Instant.now().epochSecond, - tags = emptyList() - ), + tags = emptyList()), Commit( message = "Initial commit", fullMessage = "Initial commit", @@ -82,9 +78,7 @@ internal fun File.generateInitialCommitAddVersionTagAndAddNewCommit( tags = listOf( Tag(name = "1.0.0", refName = "refs/tags/1.0.0"), - ) - ) - ) + ))) } internal fun File.createGitIgnore() { @@ -100,8 +94,7 @@ internal fun File.createGitIgnore() { |environment/ | """ - .trimMargin() - ) + .trimMargin()) } } diff --git a/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/GitHubVariablesTest.kt b/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/GitHubVariablesTest.kt index bb929a0a..7d854ebd 100644 --- a/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/GitHubVariablesTest.kt +++ b/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/GitHubVariablesTest.kt @@ -33,8 +33,7 @@ class GitHubVariablesTest : GradleTestKitTest() { mapOf( "GITHUB_ENV" to githubEnvFile.path, "GITHUB_OUTPUT" to githubOutputFile.path, - ) - ) + )) } @Test diff --git a/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/PushSemverTagTaskTest.kt b/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/PushSemverTagTaskTest.kt index 6cd1ba34..7800a427 100644 --- a/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/PushSemverTagTaskTest.kt +++ b/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/PushSemverTagTaskTest.kt @@ -29,8 +29,7 @@ class PushSemverTagTaskTest : GradleTestKitTest() { .setGitDir(remoteBuildGitDir) .readEnvironment() .findGitDir() - .build() - ) + .build()) git.repository.directory.copyRecursively(remoteBuildGitDir) diff --git a/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/VersionBuildDirTest.kt b/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/VersionBuildDirTest.kt index 4065d485..6a0e5516 100644 --- a/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/VersionBuildDirTest.kt +++ b/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/VersionBuildDirTest.kt @@ -59,8 +59,7 @@ internal class VersionBuildDirTest : GradleTestKitTest() { |v1.0.0$additionalData | """ - .trimMargin() - ) + .trimMargin()) } withArgumentsFromTXT() diff --git a/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/examples/MultiProjectExampleTest.kt b/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/examples/MultiProjectExampleTest.kt index 2592b49a..2dd10133 100644 --- a/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/examples/MultiProjectExampleTest.kt +++ b/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/examples/MultiProjectExampleTest.kt @@ -227,8 +227,7 @@ internal class MultiProjectExampleTest : GradleTestKitTest() { "createSemverTag", "-Psemver.stage=final", "-Psemver.scope=major", - "-Psemver.tagPrefix=a" - ) + "-Psemver.tagPrefix=a") projectDirByName("library-one-a").assertVersion("a", "2.0.0") projectDirByName("library-two-b").assertVersion("b", "1.0.0", Insignificant.Hash) diff --git a/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/examples/OneProjectExampleTest.kt b/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/examples/OneProjectExampleTest.kt index 4235c918..a251c45e 100644 --- a/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/examples/OneProjectExampleTest.kt +++ b/semver-project-gradle-plugin/testFunctional/kotlin/com/javiersc/semver/project/gradle/plugin/examples/OneProjectExampleTest.kt @@ -117,8 +117,7 @@ internal class OneProjectExampleTest : GradleTestKitTest() { "createSemverTag", "-Psemver.stage=final", "-Psemver.scope=major", - "-Psemver.tagPrefix=v" - ) + "-Psemver.tagPrefix=v") projectDir.assertVersion("v", "1.0.0") }