HMPP: import flag indicating that the project uses HMPP feature

This commit is contained in:
Andrey Uskov
2019-06-14 23:46:13 +03:00
parent 35dea296fa
commit e791b9d3f7
15 changed files with 32 additions and 13 deletions
@@ -128,6 +128,7 @@ interface KotlinTarget : Serializable {
interface ExtraFeatures : Serializable {
val coroutinesState: String?
val isHMPPEnabled: Boolean
}
interface KotlinMPPGradleModel : Serializable {
@@ -52,7 +52,7 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService {
val coroutinesState = getCoroutinesState(project)
reportUnresolvedDependencies(targets)
val kotlinNativeHome = KotlinNativeHomeEvaluator.getKotlinNativeHome(project) ?: NO_KOTLIN_NATIVE_HOME
return KotlinMPPGradleModelImpl(sourceSetMap, targets, ExtraFeaturesImpl(coroutinesState), kotlinNativeHome)
return KotlinMPPGradleModelImpl(sourceSetMap, targets, ExtraFeaturesImpl(coroutinesState, isHMPPEnabled(project)), kotlinNativeHome)
}
private fun isHMPPEnabled(project: Project): Boolean {
@@ -147,7 +147,8 @@ data class KotlinTargetImpl(
}
data class ExtraFeaturesImpl(
override val coroutinesState: String?
override val coroutinesState: String?,
override val isHMPPEnabled: Boolean
) : ExtraFeatures
data class KotlinMPPGradleModelImpl(
@@ -169,7 +170,7 @@ data class KotlinMPPGradleModelImpl(
cloningCache[initialTarget] = it
}
}.toList(),
ExtraFeaturesImpl(mppModel.extraFeatures.coroutinesState),
ExtraFeaturesImpl(mppModel.extraFeatures.coroutinesState, mppModel.extraFeatures.isHMPPEnabled),
mppModel.kotlinNativeHome
)
}