From 63b97c96c03d02bd9bc26c85df43cbc4fe9c689f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Sat, 2 Mar 2024 23:11:23 +0800 Subject: [PATCH] Update kotlin target to 1.8 --- easylauncher/build.gradle | 4 ++-- .../easylauncher/plugin/EasyLauncherConfig.kt | 1 - .../easylauncher/plugin/EasyLauncherPlugin.kt | 4 +--- .../easylauncher/plugin/IconTransformer.kt | 1 - .../easylauncher/plugin/internal/Kotlin15Utils.kt | 15 --------------- 5 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/internal/Kotlin15Utils.kt diff --git a/easylauncher/build.gradle b/easylauncher/build.gradle index 53ecba07..fa5cfe53 100644 --- a/easylauncher/build.gradle +++ b/easylauncher/build.gradle @@ -44,8 +44,8 @@ tasks.withType(PluginUnderTestMetadata).configureEach { tasks.withType(KotlinCompile).configureEach { compilerOptions { - apiVersion = KotlinVersion.KOTLIN_1_4 - languageVersion = KotlinVersion.KOTLIN_1_4 + apiVersion = KotlinVersion.KOTLIN_1_8 + languageVersion = KotlinVersion.KOTLIN_1_8 } } kotlin { diff --git a/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherConfig.kt b/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherConfig.kt index d4a3e61b..bccb78bc 100644 --- a/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherConfig.kt +++ b/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherConfig.kt @@ -4,7 +4,6 @@ import com.project.starter.easylauncher.filter.ChromeLikeFilter import com.project.starter.easylauncher.filter.ColorRibbonFilter import com.project.starter.easylauncher.filter.EasyLauncherFilter import com.project.starter.easylauncher.filter.OverlayFilter -import com.project.starter.easylauncher.plugin.internal.uppercase import org.gradle.api.model.ObjectFactory import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property diff --git a/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherPlugin.kt b/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherPlugin.kt index d9f9d424..54203c77 100644 --- a/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherPlugin.kt +++ b/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherPlugin.kt @@ -4,8 +4,6 @@ import com.android.build.api.AndroidPluginVersion import com.android.build.api.variant.AndroidComponentsExtension import com.android.build.api.variant.Variant import com.android.build.gradle.BaseExtension -import com.project.starter.easylauncher.plugin.internal.replaceFirstChar -import com.project.starter.easylauncher.plugin.internal.titleCase import org.gradle.api.Plugin import org.gradle.api.Project import java.io.File @@ -119,7 +117,7 @@ class EasyLauncherPlugin : Plugin { } .flatten() - val capitalisedVariantName = variant.name.replaceFirstChar(Char::titleCase) + val capitalisedVariantName = variant.name.replaceFirstChar(Char::titlecase) val task = project.tasks.register("easylauncher$capitalisedVariantName", EasyLauncherTask::class.java) { it.manifestFiles.set(manifests) it.manifestPlaceholders.set(variant.manifestPlaceholders) diff --git a/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/IconTransformer.kt b/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/IconTransformer.kt index 12bf9122..012cbefa 100644 --- a/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/IconTransformer.kt +++ b/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/IconTransformer.kt @@ -2,7 +2,6 @@ package com.project.starter.easylauncher.plugin import com.project.starter.easylauncher.filter.Canvas import com.project.starter.easylauncher.filter.EasyLauncherFilter -import com.project.starter.easylauncher.plugin.internal.lowercase import com.project.starter.easylauncher.plugin.models.toSize import groovy.xml.XmlSlurper import java.awt.image.BufferedImage diff --git a/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/internal/Kotlin15Utils.kt b/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/internal/Kotlin15Utils.kt deleted file mode 100644 index 2324cb6d..00000000 --- a/easylauncher/src/main/kotlin/com/project/starter/easylauncher/plugin/internal/Kotlin15Utils.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.project.starter.easylauncher.plugin.internal - -import java.util.Locale - -internal fun String.uppercase() = toUpperCase(Locale.ROOT) - -internal fun String.lowercase() = toLowerCase(Locale.ROOT) - -internal fun String.replaceFirstChar(block: (Char) -> Char): String = if (this.isEmpty()) { - this -} else { - "${block(first())}${substring(1)}" -} - -internal fun Char.titleCase() = this.toUpperCase()