diff --git a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/JetCoreEnvironment.java b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/JetCoreEnvironment.java index 1b38288ec79..c3af1699a05 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/JetCoreEnvironment.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/JetCoreEnvironment.java @@ -28,6 +28,7 @@ import com.intellij.psi.PsiManager; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.asJava.JavaElementFinder; import org.jetbrains.jet.cli.jvm.JVMConfigurationKeys; +import org.jetbrains.jet.config.CommonConfigurationKeys; import org.jetbrains.jet.config.CompilerConfiguration; import org.jetbrains.jet.lang.parsing.JetParser; import org.jetbrains.jet.lang.parsing.JetParserDefinition; @@ -88,6 +89,9 @@ public class JetCoreEnvironment extends JavaCoreEnvironment { for (File path : configuration.getList(JVMConfigurationKeys.ANNOTATIONS_PATH_KEY)) { addExternalAnnotationsRoot(PathUtil.jarFileOrDirectoryToVirtualFile(path)); } + for (String path : configuration.getList(CommonConfigurationKeys.SOURCE_ROOTS_KEY)) { + addSources(path); + } JetStandardLibrary.initialize(getProject()); } diff --git a/compiler/frontend/src/org/jetbrains/jet/config/CommonConfigurationKeys.java b/compiler/frontend/src/org/jetbrains/jet/config/CommonConfigurationKeys.java new file mode 100644 index 00000000000..acdaf8efb7d --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/jet/config/CommonConfigurationKeys.java @@ -0,0 +1,30 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.config; + +import com.intellij.openapi.util.Key; + +import java.util.List; + +/** + * @author Evgeny Gerashchenko + * @since 7/9/12 + */ +public class CommonConfigurationKeys { + public static final Key> SOURCE_ROOTS_KEY = Key.create("source roots"); + +}