[kpm] IdeaKpmContentRoot: Rename SOURCE_TYPE -> SOURCES_TYPE & RESOURCE_TYPE -> RESOURCES_TYPE
^KT-52568 Verification Pending
This commit is contained in:
committed by
Space
parent
70df08c678
commit
92713bdcb3
+10
-2
@@ -3,8 +3,12 @@
|
|||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@file:Suppress("unused")
|
||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.kpm.idea
|
package org.jetbrains.kotlin.gradle.kpm.idea
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.gradle.kpm.idea.IdeaKpmContentRoot.Companion.RESOURCES_TYPE
|
||||||
|
import org.jetbrains.kotlin.gradle.kpm.idea.IdeaKpmContentRoot.Companion.SOURCES_TYPE
|
||||||
import org.jetbrains.kotlin.tooling.core.Extras
|
import org.jetbrains.kotlin.tooling.core.Extras
|
||||||
import org.jetbrains.kotlin.tooling.core.emptyExtras
|
import org.jetbrains.kotlin.tooling.core.emptyExtras
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -16,11 +20,15 @@ sealed interface IdeaKpmContentRoot : Serializable {
|
|||||||
val type: String
|
val type: String
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val SOURCE_TYPE = "source"
|
const val SOURCES_TYPE = "source"
|
||||||
const val RESOURCE_TYPE = "resource"
|
const val RESOURCES_TYPE = "resource"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val IdeaKpmContentRoot.isSources get() = type == SOURCES_TYPE
|
||||||
|
|
||||||
|
val IdeaKpmContentRoot.isResources get() = type == RESOURCES_TYPE
|
||||||
|
|
||||||
@InternalKotlinGradlePluginApi
|
@InternalKotlinGradlePluginApi
|
||||||
data class IdeaKpmContentRootImpl(
|
data class IdeaKpmContentRootImpl(
|
||||||
override val file: File,
|
override val file: File,
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ private fun IdeaKpmProjectBuildingContext.buildIdeaKpmFragment(fragment: GradleK
|
|||||||
languageSettings = IdeaKpmLanguageSettings(fragment.languageSettings),
|
languageSettings = IdeaKpmLanguageSettings(fragment.languageSettings),
|
||||||
dependencies = dependencyResolver.resolve(fragment).toList(),
|
dependencies = dependencyResolver.resolve(fragment).toList(),
|
||||||
contentRoots = fragment.kotlinSourceRoots.sourceDirectories.files.map { file ->
|
contentRoots = fragment.kotlinSourceRoots.sourceDirectories.files.map { file ->
|
||||||
IdeaKpmContentRootImpl(file, type = IdeaKpmContentRoot.SOURCE_TYPE)
|
IdeaKpmContentRootImpl(file, type = IdeaKpmContentRoot.SOURCES_TYPE)
|
||||||
},
|
},
|
||||||
extras = fragment.extras
|
extras = fragment.extras
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user