Make language settings nullable in KotlinModuleFragment
There is no lang settings when importing from klibs (yet)
This commit is contained in:
committed by
Sergey Igushkin
parent
c3264a2979
commit
1a85da5ff8
+2
-2
@@ -33,11 +33,11 @@ class ProjectStructureMetadataModuleBuilder {
|
|||||||
): KotlinModule {
|
): KotlinModule {
|
||||||
val moduleData = BasicKotlinModule(component.toSingleModuleIdentifier()).apply {
|
val moduleData = BasicKotlinModule(component.toSingleModuleIdentifier()).apply {
|
||||||
metadata.sourceSetNamesByVariantName.keys.forEach { variantName ->
|
metadata.sourceSetNamesByVariantName.keys.forEach { variantName ->
|
||||||
fragments.add(BasicKotlinModuleVariant(this@apply, variantName, DefaultLanguageSettingsBuilder()))
|
fragments.add(BasicKotlinModuleVariant(this@apply, variantName))
|
||||||
}
|
}
|
||||||
fun fragment(sourceSetName: String): BasicKotlinModuleFragment {
|
fun fragment(sourceSetName: String): BasicKotlinModuleFragment {
|
||||||
if (fragments.none { it.fragmentName == sourceSetName })
|
if (fragments.none { it.fragmentName == sourceSetName })
|
||||||
fragments.add(BasicKotlinModuleFragment(this@apply, sourceSetName, DefaultLanguageSettingsBuilder()))
|
fragments.add(BasicKotlinModuleFragment(this@apply, sourceSetName))
|
||||||
return fragmentByName(sourceSetName)
|
return fragmentByName(sourceSetName)
|
||||||
}
|
}
|
||||||
metadata.sourceSetNamesByVariantName.forEach { (variantName, sourceSets) ->
|
metadata.sourceSetNamesByVariantName.forEach { (variantName, sourceSets) ->
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ interface KotlinModuleFragment {
|
|||||||
val fragmentName: String
|
val fragmentName: String
|
||||||
val directRefinesDependencies: Iterable<KotlinModuleFragment>
|
val directRefinesDependencies: Iterable<KotlinModuleFragment>
|
||||||
|
|
||||||
val languageSettings: LanguageSettings
|
val languageSettings: LanguageSettings?
|
||||||
|
|
||||||
// TODO: scopes
|
// TODO: scopes
|
||||||
val declaredModuleDependencies: Iterable<KotlinModuleDependency>
|
val declaredModuleDependencies: Iterable<KotlinModuleDependency>
|
||||||
@@ -49,7 +49,7 @@ val KotlinModuleFragment.refinesClosure: Set<KotlinModuleFragment>
|
|||||||
open class BasicKotlinModuleFragment(
|
open class BasicKotlinModuleFragment(
|
||||||
override val containingModule: KotlinModule,
|
override val containingModule: KotlinModule,
|
||||||
override val fragmentName: String,
|
override val fragmentName: String,
|
||||||
override val languageSettings: LanguageSettings
|
override val languageSettings: LanguageSettings? = null
|
||||||
) : KotlinModuleFragment {
|
) : KotlinModuleFragment {
|
||||||
|
|
||||||
override val directRefinesDependencies: MutableSet<BasicKotlinModuleFragment> = mutableSetOf()
|
override val directRefinesDependencies: MutableSet<BasicKotlinModuleFragment> = mutableSetOf()
|
||||||
@@ -63,7 +63,7 @@ open class BasicKotlinModuleFragment(
|
|||||||
class BasicKotlinModuleVariant(
|
class BasicKotlinModuleVariant(
|
||||||
containingModule: KotlinModule,
|
containingModule: KotlinModule,
|
||||||
fragmentName: String,
|
fragmentName: String,
|
||||||
languageSettings: LanguageSettings
|
languageSettings: LanguageSettings? = null
|
||||||
) : BasicKotlinModuleFragment (
|
) : BasicKotlinModuleFragment (
|
||||||
containingModule,
|
containingModule,
|
||||||
fragmentName,
|
fragmentName,
|
||||||
|
|||||||
Reference in New Issue
Block a user