From 995ef905aa27ea05f6d0eddff290fd2d6dbd1a09 Mon Sep 17 00:00:00 2001 From: Pavlo Stavytskyi Date: Wed, 4 Aug 2021 08:53:14 +0300 Subject: [PATCH] android-simple-multimodule sample: updated migration components naming --- .../android-simple-multimodule/build.gradle | 4 +-- ...licationBuild.kt => AndroidModuleBuild.kt} | 7 ++-- ...inLibraryBuild.kt => KotlinModuleBuild.kt} | 6 ++-- ...te.kt => android_module_build_template.kt} | 34 ++++++++++--------- ...ate.kt => kotlin_module_build_template.kt} | 2 +- 5 files changed, 28 insertions(+), 25 deletions(-) rename examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/{AndroidApplicationBuild.kt => AndroidModuleBuild.kt} (87%) rename examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/{KotlinLibraryBuild.kt => KotlinModuleBuild.kt} (90%) rename examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/template/{android_application_build_template.kt => android_module_build_template.kt} (72%) rename examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/template/{kotlin_library_build_template.kt => kotlin_module_build_template.kt} (97%) diff --git a/examples/migration/android-simple-multimodule/build.gradle b/examples/migration/android-simple-multimodule/build.gradle index cf51d16a..adcd085f 100644 --- a/examples/migration/android-simple-multimodule/build.gradle +++ b/examples/migration/android-simple-multimodule/build.gradle @@ -26,8 +26,8 @@ allprojects { airin { templates { register Workspace - register KotlinLibraryBuild - register AndroidApplicationBuild + register KotlinModuleBuild + register AndroidModuleBuild } artifacts { diff --git a/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/AndroidApplicationBuild.kt b/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/AndroidModuleBuild.kt similarity index 87% rename from examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/AndroidApplicationBuild.kt rename to examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/AndroidModuleBuild.kt index dbd5a127..08d0c58f 100644 --- a/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/AndroidApplicationBuild.kt +++ b/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/AndroidModuleBuild.kt @@ -19,13 +19,13 @@ import org.gradle.api.Project import org.morfly.airin.* import org.morfly.airin.starlark.elements.StarlarkFile -import template.android_application_build_template +import template.android_module_build_template /** * */ -class AndroidApplicationBuild : GradlePerModuleTemplateProvider() { +class AndroidModuleBuild : GradlePerModuleTemplateProvider() { override fun canProvide(target: Project): Boolean = target.plugins.hasPlugin(ANDROID_APPLICATION) @@ -42,8 +42,9 @@ class AndroidApplicationBuild : GradlePerModuleTemplateProvider() { .shortLabels() return listOf( - android_application_build_template( + android_module_build_template( name = target.name, + hasBinary = target.plugins.hasPlugin(ANDROID_APPLICATION), packageName = target.packageName ?: "ERROR", moduleDependencies = moduleDepsLabels, artifactDependencies = artifactDepsLabels diff --git a/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/KotlinLibraryBuild.kt b/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/KotlinModuleBuild.kt similarity index 90% rename from examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/KotlinLibraryBuild.kt rename to examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/KotlinModuleBuild.kt index f9a0794a..498ae8a3 100644 --- a/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/KotlinLibraryBuild.kt +++ b/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/KotlinModuleBuild.kt @@ -17,13 +17,13 @@ import org.gradle.api.Project import org.morfly.airin.* import org.morfly.airin.starlark.elements.StarlarkFile -import template.kotlin_library_build_template +import template.kotlin_module_build_template /** * */ -class KotlinLibraryBuild : GradlePerModuleTemplateProvider() { +class KotlinModuleBuild : GradlePerModuleTemplateProvider() { override fun canProvide(target: Project): Boolean = with(target.plugins) { hasPlugin(KOTLIN_JVM) && !hasPlugin(APPLICATION) && !hasPlugin(ANDROID_LIBRARY) @@ -40,7 +40,7 @@ class KotlinLibraryBuild : GradlePerModuleTemplateProvider() { .shortLabels() return listOf( - kotlin_library_build_template( + kotlin_module_build_template( name = target.name, moduleDependencies = moduleDepsLabels, artifactDependencies = artifactDepsLabels diff --git a/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/template/android_application_build_template.kt b/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/template/android_module_build_template.kt similarity index 72% rename from examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/template/android_application_build_template.kt rename to examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/template/android_module_build_template.kt index 6ab4b3bf..18436800 100644 --- a/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/template/android_application_build_template.kt +++ b/examples/migration/android-simple-multimodule/buildSrc/src/main/kotlin/template/android_module_build_template.kt @@ -30,8 +30,9 @@ import org.morfly.airin.starlark.library.kt_android_library /** * */ -fun android_application_build_template( +fun android_module_build_template( name: String, + hasBinary: Boolean, packageName: String, moduleDependencies: List