Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't set KOTLIN_BUNDLED in unit tests in AS42
- Loading branch information
1 parent
9030514
commit 995df01
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
idea/src/org/jetbrains/kotlin/idea/KotlinPluginMacros.kt.as42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
|
||
} |