|
@@ -68,7 +68,10 @@ object BinaryCompatibilityConfigurator {
|
|
dir.resolve("build.gradle.kts").writeTextIfNeeded(
|
|
dir.resolve("build.gradle.kts").writeTextIfNeeded(
|
|
applyTemplate(
|
|
applyTemplate(
|
|
project.path,
|
|
project.path,
|
|
- if (targetName == null) "classes/kotlin/main" else "classes/kotlin/$targetName/main"
|
|
|
|
|
|
+ listOfNotNull(
|
|
|
|
+ if (targetName == null) "classes/kotlin/main" else "classes/kotlin/$targetName/main",
|
|
|
|
+ if (targetName?.contains("android") == true) "tmp/kotlin-classes/debug" else ""
|
|
|
|
+ )
|
|
)
|
|
)
|
|
)
|
|
)
|
|
dir.resolve(".gitignore").writeTextIfNeeded(
|
|
dir.resolve(".gitignore").writeTextIfNeeded(
|
|
@@ -80,7 +83,12 @@ object BinaryCompatibilityConfigurator {
|
|
findProject(getValidatorDir(dir))
|
|
findProject(getValidatorDir(dir))
|
|
?.afterEvaluate {
|
|
?.afterEvaluate {
|
|
if (targetName == null) {
|
|
if (targetName == null) {
|
|
- tasks.findByName("apiBuild")?.dependsOn(project.tasks.getByName("jar"))
|
|
|
|
|
|
+ tasks.findByName("apiBuild")?.dependsOn(
|
|
|
|
+ *listOfNotNull(
|
|
|
|
+ project.tasks.getByName("jar"),
|
|
|
|
+ project.tasks.findByName("compileDebugKotlinAndroid")
|
|
|
|
+ ).toTypedArray()
|
|
|
|
+ )
|
|
} else {
|
|
} else {
|
|
tasks.findByName("apiBuild")?.dependsOn(
|
|
tasks.findByName("apiBuild")?.dependsOn(
|
|
if (targetName.contains("android")) {
|
|
if (targetName.contains("android")) {
|
|
@@ -94,13 +102,13 @@ object BinaryCompatibilityConfigurator {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- fun applyTemplate(projectPath: String, buildDir: String): String {
|
|
|
|
|
|
+ fun applyTemplate(projectPath: String, buildDirs: List<String>): String {
|
|
return this::class.java.classLoader
|
|
return this::class.java.classLoader
|
|
.getResourceAsStream("binary-compatibility-validator-build.txt")!!
|
|
.getResourceAsStream("binary-compatibility-validator-build.txt")!!
|
|
.useToRun { readBytes() }
|
|
.useToRun { readBytes() }
|
|
.decodeToString()
|
|
.decodeToString()
|
|
.replace("$\$PROJECT_PATH$$", projectPath)
|
|
.replace("$\$PROJECT_PATH$$", projectPath)
|
|
- .replace("$\$BUILD_DIR$$", buildDir)
|
|
|
|
|
|
+ .replace("$\$BUILD_DIR$$", buildDirs.joinToString("\n"))
|
|
.replace("$\$PLUGIN_VERSION$$", Versions.binaryValidator)
|
|
.replace("$\$PLUGIN_VERSION$$", Versions.binaryValidator)
|
|
}
|
|
}
|
|
}
|
|
}
|