This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id("com.mikhailovskii.kmp.module") | |
id("maven-publish") | |
} | |
kotlin { | |
sourceSets { | |
androidMain.dependencies { | |
implementation(libs.rustore.review) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal fun ExtensionContainer.getPluginId(alias: String): String = | |
getByType<VersionCatalogsExtension>().named("libs").findPlugin(alias).get().get().pluginId | |
internal fun ExtensionContainer.getVersion(alias: String): String = | |
getByType<VersionCatalogsExtension>().named("libs").findVersion(alias).get().toString() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class KMPModuleConventionPlugin : Plugin<Project> { | |
override fun apply(target: Project) { | |
with(target) { | |
with(pluginManager) { | |
apply(extensions.getPluginId("androidLibrary")) | |
apply(extensions.getPluginId("kotlinMultiplatform")) | |
apply("maven-publish") | |
} | |
group = "com.mikhailovskii.kmp" | |
version = System.getenv("LIBRARY_VERSION") ?: extensions.getVersion("pluginVersion") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
`kotlin-dsl` | |
} | |
gradlePlugin { | |
plugins { | |
register("com.mikhailovskii.kmp.KMPModuleConventionPlugin") { | |
id = "com.mikhailovskii.kmp.module" | |
implementationClass = "KMPModuleConventionPlugin" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencyResolutionManagement { | |
@Suppress("UnstableApiUsage") | |
repositories { | |
google() | |
mavenCentral() | |
} | |
versionCatalogs { | |
create("libs") { | |
from(files("../gradle/libs.versions.toml")) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id("com.mikhailovskii.kmp.module") | |
id("maven-publish") | |
} | |
kotlin { | |
sourceSets { | |
androidMain.dependencies { | |
implementation(libs.rustore.review) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
alias(libs.plugins.kotlinMultiplatform) | |
alias(libs.plugins.androidLibrary) | |
id("maven-publish") | |
} | |
group = "com.mikhailovskii.kmp" | |
version = System.getenv("LIBRARY_VERSION") ?: libs.versions.pluginVersion.get() | |
kotlin { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class RuStoreExceptionMapper { | |
operator fun invoke(throwable: RuStoreException) = when (throwable) { | |
is RuStoreNotInstalledException -> ReviewCode.STORE_NOT_FOUND | |
is RuStoreOutdatedException -> ReviewCode.STORE_OUTDATED | |
is RuStoreUserBannedException -> ReviewCode.USER_BANNED | |
is RuStoreApplicationBannedException -> ReviewCode.APP_BANNED | |
is RuStoreRequestLimitReached -> ReviewCode.REQUEST_LIMIT_REACHED | |
is RuStoreReviewExists -> ReviewCode.REVIEW_EXISTS | |
is RuStoreInvalidReviewInfo -> ReviewCode.INVALID_REVIEW_INFO | |
else -> throw throwable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RuStoreInAppReviewInitParams(val context: Context) | |
class RuStoreInAppReviewManager(private val params: RuStoreInAppReviewInitParams) : InAppReviewDelegate { | |
override fun requestInAppReview() = flow { | |
val activity = params.context | |
val manager = RuStoreReviewManagerFactory.create(activity) | |
val reviewInfo = manager.requestReviewFlow().await() | |
manager.launchReviewFlow(reviewInfo).await() | |
emit(ReviewCode.NO_ERROR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maven("https://artifactory-external.vkpartner.ru/artifactory/maven") |
NewerOlder