Skip to content

Commit

Permalink
Don't set KOTLIN_BUNDLED in unit tests in AS42
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirdolzhenko committed Nov 17, 2020
1 parent 9030514 commit 995df01
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions idea/src/org/jetbrains/kotlin/idea/KotlinPluginMacros.kt.as42
@@ -0,0 +1,28 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/

package org.jetbrains.kotlin.idea

import com.intellij.openapi.application.PathMacroContributor
import org.jetbrains.kotlin.idea.util.application.isUnitTestMode
import org.jetbrains.kotlin.utils.PathUtil

/**
* Some actions have to be performed before loading and opening any project.
*
* E.g. path variables have to be registered in advance as modules could rely on some path variables.
*/
class KotlinPluginMacros : PathMacroContributor {
override fun registerPathMacros(macros: MutableMap<String, String>, legacyMacros: MutableMap<String, String>) {
if (!isUnitTestMode()) {
macros[KOTLIN_BUNDLED_PATH_VARIABLE] = PathUtil.kotlinPathsForIdeaPlugin.homePath.path
}
}

companion object {
const val KOTLIN_BUNDLED_PATH_VARIABLE = "KOTLIN_BUNDLED"
}

}

0 comments on commit 995df01

Please sign in to comment.