All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.kotlin.kotlin-compiler.1.3.11.source-code.ContentRoots.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0-Beta1
Show newest version
/*
 * Copyright 2010-2018 JetBrains s.r.o. 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.cli.common.config

import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.config.CompilerConfiguration

interface ContentRoot

/**
 * @param isCommon whether this source root contains sources of a common module in a multi-platform project
 */
data class KotlinSourceRoot(val path: String, val isCommon: Boolean): ContentRoot

@JvmOverloads
fun CompilerConfiguration.addKotlinSourceRoot(path: String, isCommon: Boolean = false) {
    add(CLIConfigurationKeys.CONTENT_ROOTS, KotlinSourceRoot(path, isCommon))
}

fun CompilerConfiguration.addKotlinSourceRoots(sources: List): Unit =
    sources.forEach { addKotlinSourceRoot(it) }

val CompilerConfiguration.kotlinSourceRoots: List
    get() = get(CLIConfigurationKeys.CONTENT_ROOTS)?.filterIsInstance().orEmpty()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy