From e3e37e00cb4e7d53146eafffd0cf9ef465922047 Mon Sep 17 00:00:00 2001 From: DatLag Date: Mon, 9 Dec 2024 00:05:02 +0100 Subject: [PATCH] bump version --- gradle/libs.versions.toml | 2 +- .../dev/datlag/sekret/gradle/SekretPlugin.kt | 2 +- .../gradle/generator/BuildFileGenerator.kt | 5 +-- .../tasks/GenerateSekretBuildScriptTask.kt | 41 ------------------- .../sekret/gradle/tasks/GenerateSekretTask.kt | 20 --------- 5 files changed, 3 insertions(+), 67 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 228a839..92a2de1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -lib = "2.0.0-alpha-09-SNAPSHOT" +lib = "2.0.0-alpha-09" android = "8.4.2" auto-service = "1.1.1" kotlin = "2.1.0" diff --git a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/SekretPlugin.kt b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/SekretPlugin.kt index 78f993d..619fff2 100644 --- a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/SekretPlugin.kt +++ b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/SekretPlugin.kt @@ -59,7 +59,7 @@ open class SekretPlugin : Plugin { } companion object { - private const val VERSION = "2.0.0-alpha-09-SNAPSHOT" + private const val VERSION = "2.0.0-alpha-09" internal fun getVersion(): String { return runCatching { diff --git a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/BuildFileGenerator.kt b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/BuildFileGenerator.kt index 7489c29..97ff711 100644 --- a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/BuildFileGenerator.kt +++ b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/generator/BuildFileGenerator.kt @@ -13,7 +13,6 @@ object BuildFileGenerator { version: String = SekretPlugin.getVersion(), targets: Iterable, packageName: String, - versionCatalogSekretDependency: String?, outputDir: File, overwrite: Boolean = false ) { @@ -23,7 +22,6 @@ object BuildFileGenerator { .addSourceSets( version = version, commonJS = targets.any { it.isJS }, - versionCatalogSekretDependency = versionCatalogSekretDependency, sourceSets = targets.toSet() ) .endControlFlow() @@ -64,7 +62,6 @@ object BuildFileGenerator { private fun FileSpec.Builder.addSourceSets( version: String, commonJS: Boolean, - versionCatalogSekretDependency: String?, sourceSets: Set ): FileSpec.Builder { var spec = this @@ -93,7 +90,7 @@ object BuildFileGenerator { spec = spec.beginControlFlow("sourceSets") spec = spec.beginControlFlow("commonMain.dependencies") - spec = spec.addStatement("api(%S)", versionCatalogSekretDependency ?: "dev.datlag.sekret:sekret:$version") + spec = spec.addStatement("api(%S)", "dev.datlag.sekret:sekret:$version") spec = spec.endControlFlow() spec = spec.addStatement("") diff --git a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretBuildScriptTask.kt b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretBuildScriptTask.kt index f4ecf24..c492095 100644 --- a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretBuildScriptTask.kt +++ b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretBuildScriptTask.kt @@ -1,9 +1,7 @@ package dev.datlag.sekret.gradle.tasks -import dev.datlag.sekret.gradle.SekretPlugin import dev.datlag.sekret.gradle.SekretPluginExtension import dev.datlag.sekret.gradle.Target -import dev.datlag.sekret.gradle.common.* import dev.datlag.sekret.gradle.common.sekretExtension import dev.datlag.sekret.gradle.common.targetsMapped import dev.datlag.sekret.gradle.extension.PropertiesExtension @@ -14,14 +12,11 @@ import org.gradle.api.Project import org.gradle.api.file.DirectoryProperty import org.gradle.api.file.ProjectLayout import org.gradle.api.logging.LogLevel -import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.provider.SetProperty import org.gradle.api.tasks.Input import org.gradle.api.tasks.OutputDirectory import org.gradle.api.tasks.TaskAction -import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet -import org.jetbrains.kotlin.gradle.plugin.KotlinTarget import java.io.File import javax.inject.Inject @@ -36,18 +31,6 @@ open class GenerateSekretBuildScriptTask : DefaultTask() { @get:Input open val targets: SetProperty = project.objects.setProperty(Target::class.java) - @get:Input - open val hasVersionCatalogs: Property = project.objects.property(Boolean::class.java) - - @get:Input - open val usesVersionCatalogForPlugin: Property = project.objects.property(Boolean::class.java) - - @get:Input - open val versionCatalogName: Property = project.objects.property(String::class.java) - - @get:Input - open val versionCatalogLibraryAlias: Property = project.objects.property(String::class.java) - @get:OutputDirectory open val outputDirectory: DirectoryProperty = project.objects.directoryProperty() @@ -81,21 +64,9 @@ open class GenerateSekretBuildScriptTask : DefaultTask() { logger.log(logLevel, "Following targets are used/required depending on your configuration: ${requiredTargets.joinToString { it.name }}.") logger.log(logLevel, "Please report if you encounter any missing target.") - val hasVersionCatalogs = hasVersionCatalogs.getOrElse(false) ?: false - val usesVersionCatalogForPlugin = usesVersionCatalogForPlugin.getOrElse(false) ?: false - - if (hasVersionCatalogs && !usesVersionCatalogForPlugin) { - logger.log(LogLevel.WARN, "Seems like you use version catalogs but not for the sekret plugin.") - } - BuildFileGenerator.generate( targets = requiredTargets, packageName = packageName.getOrElse(PropertiesExtension.sekretPackageName), - versionCatalogSekretDependency = versionCatalogLibraryAlias.orNull?.ifBlank { null }?.let { lib -> - versionCatalogName.orNull?.ifBlank { null }?.let { catalog -> - "${catalog}.${lib}" - } - }, outputDir = ModuleGenerator.createBase(outputDir), overwrite = true ) @@ -109,18 +80,6 @@ open class GenerateSekretBuildScriptTask : DefaultTask() { targets.set(project.provider { project.targetsMapped }) - hasVersionCatalogs.set(project.provider { - project.hasVersionCatalogs - }) - usesVersionCatalogForPlugin.set(project.provider { - project.hasSekretVersionCatalog - }) - versionCatalogName.set(project.provider { - project.sekretVersionCatalog?.name - }) - versionCatalogLibraryAlias.set(project.provider { - project.sekretVersionCatalog?.sekretLibraryAlias - }) outputDirectory.set(project.findProject("sekret")?.projectDir ?: File(project.projectDir, "sekret")) } diff --git a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretTask.kt b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretTask.kt index 64bcab8..4578d98 100644 --- a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretTask.kt +++ b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretTask.kt @@ -17,15 +17,12 @@ import org.gradle.api.file.DirectoryProperty import org.gradle.api.file.ProjectLayout import org.gradle.api.file.RegularFileProperty import org.gradle.api.logging.LogLevel -import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.provider.SetProperty import org.gradle.api.tasks.Input import org.gradle.api.tasks.InputFile import org.gradle.api.tasks.OutputDirectory import org.gradle.api.tasks.TaskAction -import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet -import org.jetbrains.kotlin.gradle.plugin.KotlinTarget import java.io.File import javax.inject.Inject @@ -40,12 +37,6 @@ open class GenerateSekretTask : DefaultTask() { @get:Input open val targets: SetProperty = project.objects.setProperty(Target::class.java) - @get:Input - open val versionCatalogName: Property = project.objects.property(String::class.java) - - @get:Input - open val versionCatalogLibraryAlias: Property = project.objects.property(String::class.java) - @get:Input open val encryptionKey: Property = project.objects.property(String::class.java) @@ -89,11 +80,6 @@ open class GenerateSekretTask : DefaultTask() { BuildFileGenerator.generate( targets = requiredTargets, packageName = packageName.getOrElse(PropertiesExtension.sekretPackageName), - versionCatalogSekretDependency = versionCatalogLibraryAlias.orNull?.ifBlank { null }?.let { lib -> - versionCatalogName.orNull?.ifBlank { null }?.let { catalog -> - "${catalog}.${lib}" - } - }, outputDir = sekretDir, overwrite = false ) @@ -144,12 +130,6 @@ open class GenerateSekretTask : DefaultTask() { targets.set(project.provider { project.targetsMapped }) - versionCatalogName.set(project.provider { - project.sekretVersionCatalog?.name - }) - versionCatalogLibraryAlias.set(project.provider { - project.sekretVersionCatalog?.sekretLibraryAlias - }) encryptionKey.set(extension.properties.encryptionKey) outputDirectory.set(project.findProject("sekret")?.projectDir ?: File(project.projectDir, "sekret"))