Don't detect library kind for pure JVM projects
Also require .kjsm to detect JS libraries; don't detect jars containing only .js files as JS libraries #KT-19717 Fixed
This commit is contained in:
@@ -84,7 +84,7 @@ private fun detectLibraryKindFromJarContents(jarRoot: VirtualFile): PersistentLi
|
|||||||
when (file.extension) {
|
when (file.extension) {
|
||||||
"class" -> false
|
"class" -> false
|
||||||
|
|
||||||
"js", "kjsm" -> {
|
"kjsm" -> {
|
||||||
result = JSLibraryKind
|
result = JSLibraryKind
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -109,7 +109,7 @@ class KotlinGradleLibraryDataService : AbstractProjectDataService<LibraryData, V
|
|||||||
if (toImport.isEmpty()) return
|
if (toImport.isEmpty()) return
|
||||||
val projectDataNode = toImport.first().parent!! as DataNode<ProjectData>
|
val projectDataNode = toImport.first().parent!! as DataNode<ProjectData>
|
||||||
val moduleDataNodes = projectDataNode.children.filter { it.data is ModuleData } as List<DataNode<ModuleData>>
|
val moduleDataNodes = projectDataNode.children.filter { it.data is ModuleData } as List<DataNode<ModuleData>>
|
||||||
if (moduleDataNodes.any { detectPlatformByPlugin(it) != null}) {
|
if (moduleDataNodes.any { detectPlatformByPlugin(it)?.takeIf { it !is TargetPlatformKind.Jvm } != null }) {
|
||||||
for (libraryDataNode in toImport) {
|
for (libraryDataNode in toImport) {
|
||||||
val ideLibrary = modelsProvider.findIdeLibrary(libraryDataNode.data) ?: continue
|
val ideLibrary = modelsProvider.findIdeLibrary(libraryDataNode.data) ?: continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user