Skip to content

Commit

Permalink
Feature/kotlin 1.9.20 (#54)
Browse files Browse the repository at this point in the history
* Bump Kotlin to 1.9.20.

* Bump kotlin-compile-testing-extensions to 1.9.20-1.3.0.

* Release 1.9.20-1.2.0.

* Fix code style.
  • Loading branch information
bennyhuo authored Nov 14, 2023
1 parent 3ccd98d commit 3d8bcb0
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 79 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright [2023] [Kanyun.Inc.]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ English | **[简体中文](README_zh.md)**
# Kace
[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![Language](https://img.shields.io/badge/Language-Kotlin-green)](https://kotlinlang.org/)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.kanyun.kace/kace-gradle-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.kanyun.kace/kace-gradle-plugin)

> The Kace means kotlin-android-compatible-extensions, a framework for assisting in the seamless migration from kotlin-android-extensions
Expand Down Expand Up @@ -72,7 +73,8 @@ The Kace currently supports the above four most commonly used types. Other types
| 1.7.0-1.0.4 | 1.7.0 | 4.2.0 | 6.7.1 |
| 1.8.0-1.0.4 | 1.8.0~1.8.10 | 4.2.0 | 6.8.3 |
| 1.8.20-1.1.0 | 1.8.20 | 4.2.0 | 6.8.3 |
| 1.9.0-1.1.0 | 1.9.0 | 4.2.2 | 6.8.3 |
| 1.9.0-1.2.0 | 1.9.0~1.9.20 | 4.2.2 | 6.8.3 |
| 1.9.20-1.2.0 | 1.9.20 | 4.2.2 | 6.8.3 |

Since the goal of the Kace is to help developers easily upgrade to Kotlin 1.8, the minimum supported version of Kotlin is relatively high

Expand Down
3 changes: 2 additions & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ Kace 目前支持了以上四种最常用的类型,其他 kotlin-android-exten
| 1.7.0-1.0.4 | 1.7.0 | 4.2.0 | 6.7.1 |
| 1.8.0-1.0.4 | 1.8.0~1.8.10 | 4.2.0 | 6.8.3 |
| 1.8.20-1.1.0 | 1.8.20 | 4.2.0 | 6.8.3 |
| 1.9.0-1.1.0 | 1.9.0 | 4.2.2 | 6.8.3 |
| 1.9.0-1.2.0 | 1.9.0~1.9.20 | 4.2.2 | 6.8.3 |
| 1.9.20-1.2.0 | 1.9.20 | 4.2.2 | 6.8.3 |

由于 Kace 的目标是帮助开发者更方便地迁移到 Kotlin 1.8,因此 Kotlin 最低支持版本比较高

Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
plugins {
id("com.android.application") version "4.2.2" apply false
id("com.android.library") version "4.2.2" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.20" apply false
id("com.vanniktech.maven.publish") version "0.18.0" apply false
id("com.github.gmazzo.buildconfig") version "2.1.0" apply false
}
Expand All @@ -11,7 +11,7 @@ allprojects {
repositories {
mavenCentral()
google()
maven { setUrl("https://oss.sonatype.org/content/repositories/snapshots/") }
maven { setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots/") }
}

apply(plugin = "com.vanniktech.maven.publish")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kotlin.code.style=official
android.nonTransitiveRClass=true

KOTLIN_PLUGIN_ID=com.kanyun.kace
VERSION_NAME=1.9.0-1.2.0
VERSION_NAME=1.9.20-1.2.0

GROUP=com.kanyun.kace

Expand Down
2 changes: 1 addition & 1 deletion kace-compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {
testImplementation(kotlin("test-junit"))
testImplementation("org.jetbrains.kotlin:kotlin-compiler-embeddable")

testImplementation("com.bennyhuo.kotlin:kotlin-compile-testing-extensions:1.8.20-1.1.0")
testImplementation("com.bennyhuo.kotlin:kotlin-compile-testing-extensions:1.9.20-1.3.0")
}

val compileKotlin: KotlinCompile by tasks
Expand Down
14 changes: 5 additions & 9 deletions kace-compiler/src/test/java/com/kanyun/kace/compiler/KaceTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,25 @@ class KaceTest {

@Test
fun k1() {
testBase("K1.txt", false)
testBase(false)
}

@Test
fun k2() {
testBase("K2.txt", true)
testBase(true)
}

@OptIn(ExperimentalCompilerApi::class)
private fun testBase(fileName: String, useK2: Boolean) {
private fun testBase(useK2: Boolean) {
val source = File("testData/source.txt").readText()
val expect = File("testData/$fileName").readText()
val expect = File("testData/expect.txt").readText()
val loader = TextBasedModuleInfoLoader("$source\n$expect")
val sourceModuleInfos = loader.loadSourceModuleInfos()

Options.isEnabled.set(true)

val modules = sourceModuleInfos.map {
KotlinModule(it, compilerPluginRegistrars = listOf(KaceCompilerPluginRegistrar()), supportK2 = true).also {
if (useK2) {
it.languageVersion = "2.0"
}
}
KotlinModule(it, compilerPluginRegistrars = listOf(KaceCompilerPluginRegistrar()), useK2 = true)
}

modules.checkResult(
Expand Down
62 changes: 0 additions & 62 deletions kace-compiler/testData/K1.txt

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion kace-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
plugins {
id("com.android.application") apply false
id("com.android.library") apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.20" apply false
id("com.kanyun.kace") version "0.0.0-SNAPSHOT" apply false
}

Expand Down

0 comments on commit 3d8bcb0

Please sign in to comment.