Skip to content

Commit 87749a3

Browse files
committed
reverse some code changes which require Kotlin 2.x
1 parent 4253099 commit 87749a3

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

plugin-build/plugin/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import com.vanniktech.maven.publish.GradlePublishPlugin
2-
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8
2+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
33

44
plugins {
55
id("com.android.lint")
@@ -44,8 +44,8 @@ java {
4444
kotlin {
4545
jvmToolchain(11)
4646
compilerOptions {
47-
apiVersion.set(KOTLIN_1_8)
48-
languageVersion.set(KOTLIN_1_8)
47+
apiVersion.set(KotlinVersion.KOTLIN_1_8)
48+
languageVersion.set(KotlinVersion.KOTLIN_1_8)
4949
}
5050
}
5151

plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class AboutLibrariesTask : BaseAboutLibrariesTask() {
3434
abstract val deprecated: Property<Boolean>
3535

3636
override fun getDescription(): String = "Exports dependency meta data from the current module.${variant.orNull?.let { " Filtered by variant: '$it'." } ?: ""}"
37-
override fun getGroup(): String = super.group ?: org.gradle.language.base.plugins.LifecycleBasePlugin.BUILD_GROUP
37+
override fun getGroup(): String = super.getGroup() ?: org.gradle.language.base.plugins.LifecycleBasePlugin.BUILD_GROUP
3838

3939
fun configureOutputFile(outputFile: Provider<RegularFile>? = null) {
4040
if (outputFile != null && outputFile.isPresent) {

plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/mapping/License.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ data class License(
5757
* Ensures and applies fixes to the library names (shorten, ...)
5858
*/
5959
private fun resolveLicenseId(name: String, url: String?): String? {
60-
for (l: SpdxLicense in SpdxLicense.entries) {
60+
for (l: SpdxLicense in SpdxLicense.values()) {
6161
val matcher = l.customMatcher
6262
if (l.id.equals(name, true) || l.name.equals(name, true) || l.fullName.equals(name, true) || (matcher != null && matcher.invoke(name, url))) {
6363
return l.id

plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/mapping/SpdxLicense.kt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,15 @@ enum class SpdxLicense(
208208
Leptonica("Leptonica License", "Leptonica"),
209209
LGPL_2_0_only("GNU Library General Public License v2 only", "LGPL-2.0-only"),
210210
LGPL_2_0_or_later("GNU Library General Public License v2 or later", "LGPL-2.0-or-later"),
211-
LGPL_2_1_only("GNU Lesser General Public License v2.1 only", "LGPL-2.1-only",
211+
LGPL_2_1_only(
212+
"GNU Lesser General Public License v2.1 only", "LGPL-2.1-only",
212213
customMatcher = { name, _ ->
213214
name.equals("GNU Lesser General Public License (LGPL), Version 2.1", true)
214215
}
215216
),
216217
LGPL_2_1_or_later("GNU Lesser General Public License v2.1 or later", "LGPL-2.1-or-later"),
217-
LGPL_3_0_only("GNU Lesser General Public License v3.0 only", "LGPL-3.0-only",
218+
LGPL_3_0_only(
219+
"GNU Lesser General Public License v3.0 only", "LGPL-3.0-only",
218220
customMatcher = { name, _ ->
219221
name.equals("GNU General Lesser Public License (LGPL) version 3.0", true)
220222
}
@@ -247,11 +249,12 @@ enum class SpdxLicense(
247249
mpich2("mpich2 License", "mpich2"),
248250
MPL_1_0("Mozilla Public License 1.0", "MPL-1.0"),
249251
MPL_1_1("Mozilla Public License 1.1", "MPL-1.1"),
250-
MPL_2_0("Mozilla Public License 2.0", "MPL-2.0",
252+
MPL_2_0(
253+
"Mozilla Public License 2.0", "MPL-2.0",
251254
customMatcher = { name, url ->
252255
name.contains("Mozilla Public License", true)
253-
&& url?.contains("mozilla.org", true) == true
254-
&& url.contains("MPL/2.0", true)
256+
&& url?.contains("mozilla.org", true) == true
257+
&& url.contains("MPL/2.0", true)
255258
}
256259
),
257260
MPL_2_0_no_copyleft_exception(
@@ -474,7 +477,7 @@ enum class SpdxLicense(
474477

475478
companion object {
476479
internal fun find(key: String): SpdxLicense? {
477-
for (l: SpdxLicense in entries) {
480+
for (l: SpdxLicense in values()) {
478481
if (l.id.equals(key, true) || l.name.equals(key, true) || l.fullName.equals(key, true)) {
479482
return l
480483
}
@@ -483,7 +486,7 @@ enum class SpdxLicense(
483486
}
484487

485488
internal fun getById(id: String): SpdxLicense {
486-
return entries.first { it.id.equals(id, true) }
489+
return values().first { it.id.equals(id, true) }
487490
}
488491
}
489492
}

0 commit comments

Comments
 (0)