Configure binary compatibility validator for android target

This commit is contained in:
Him188 2021-02-24 11:36:03 +08:00
parent aa289e932f
commit 9c3a175b02
6 changed files with 5972 additions and 10 deletions

View File

@ -0,0 +1,28 @@
/*
* Copyright 2019-2021 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
@file:Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("net.mamoe.kotlin-jvm-blocking-bridge")
}
description = "Mirai API binary compatibility validator"
tasks.withType(kotlinx.validation.KotlinApiBuildTask::class) {
inputClassesDirs =
files(inputClassesDirs.files, project(":mirai-core-api").buildDir.resolve("classes/kotlin/android/main"))
}
// tasks["apiDump"].dependsOn(project(":mirai-core-api").tasks["build"])
// this dependency is set in mirai-core-api since binary validator is configured before mirai-core-api

View File

@ -9,15 +9,6 @@
@file:Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
/*
* Copyright 2019-2021 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
plugins {
kotlin("jvm")
kotlin("plugin.serialization")

View File

@ -48,7 +48,8 @@ configure<kotlinx.validation.ApiValidationExtension> {
ignoredProjects.add(subproject.name)
}
ignoredProjects.remove("binary-compatibility-validator")
// Enable validator for module `binary-compatibility-validator` only.
ignoredProjects.remove("binary-compatibility-validator-android")
// Enable validator for module `binary-compatibility-validator` and `-android` only.
ignoredPackages.add("net.mamoe.mirai.internal")

View File

@ -124,4 +124,5 @@ configureMppPublishing()
afterEvaluate {
project(":binary-compatibility-validator").tasks["apiBuild"].dependsOn(project(":mirai-core-api").tasks["build"])
project(":binary-compatibility-validator-android").tasks["apiBuild"].dependsOn(project(":mirai-core-api").tasks["build"])
}

View File

@ -29,6 +29,8 @@ include(":mirai-core")
include(":mirai-core-all")
include(":binary-compatibility-validator")
include(":binary-compatibility-validator-android")
project(":binary-compatibility-validator-android").projectDir = file("binary-compatibility-validator/android")
include(":ci-release-helper")