Skip to content

Commit 8d60212

Browse files
committed
Migrate to Kotlin abiValidation
1 parent 1a31b5b commit 8d60212

File tree

15 files changed

+2496
-1565
lines changed

15 files changed

+2496
-1565
lines changed

.github/workflows/auto-merge.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@ jobs:
6363
with:
6464
path: ~/.gradle/wrapper
6565
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
66-
67-
# Check API compatibility
68-
- name: API compatibility check
69-
run: ./gradlew :api:checkApi
70-
66+
7167
# Run ksp generated tests
7268
- name: test
7369
run: ./gradlew --stacktrace --info check

.github/workflows/main.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ jobs:
5959
path: ~/.gradle/wrapper
6060
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
6161

62-
# Check API compatibility
63-
- name: API compatibility check
64-
if: matrix.os == 'ubuntu-latest'
65-
run: ./gradlew :api:checkApi
66-
6762
# Run tests
6863
- name: test
6964
shell: bash

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This project follows
3030

3131
## API verification
3232

33-
For changes that involves API changes(new API, API signature change), please also update [api.base](./api/api.base) file. You can monitor api change with `./gradlew :api:checkApi`, and`./gradlew :api:updateApi` to generate new api signature.
33+
For changes that involves API changes(new API, API signature change), please also update API files. You can monitor api change with `./gradlew checkLegacyAbi`, and`./gradlew updateLegacyAbi` to generate new api signature.
3434

3535
## Testing
3636
For incoming PRs, we would like to request changes covered by tests for good practice.

api/api.base

Lines changed: 0 additions & 748 deletions
This file was deleted.

api/api/api.api

Lines changed: 775 additions & 0 deletions
Large diffs are not rendered by default.

build.gradle.kts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import com.google.devtools.ksp.configureKtlint
22
import com.google.devtools.ksp.configureKtlintApplyToIdea
3-
import com.google.devtools.ksp.configureMetalava
43
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
54
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
65
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
6+
import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation
77

88
val sonatypeUserName: String? by project
99
val sonatypePassword: String? by project
@@ -99,7 +99,20 @@ subprojects {
9999
}
100100
}
101101

102-
configureMetalava()
102+
kotlin {
103+
@OptIn(ExperimentalAbiValidation::class)
104+
abiValidation {
105+
enabled = true
106+
}
107+
}
108+
109+
tasks.check {
110+
dependsOn(
111+
tasks.withType<Test>(),
112+
// TODO: https://youtrack.jetbrains.com/issue/KT-78525
113+
tasks.checkLegacyAbi,
114+
)
115+
}
103116
}
104117

105118
val compileJavaVersion = JavaLanguageVersion.of(17)

buildSrc/src/main/kotlin/com/google/devtools/ksp/ApiCheck.kt

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)