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

org.jetbrains.kotlin.gradle.tasks.TasksProvider.kt Maven / Gradle / Ivy

There is a newer version: 2.1.20-Beta1
Show newest version
package org.jetbrains.kotlin.gradle.tasks

import org.gradle.api.tasks.compile.AbstractCompile
import org.gradle.api.Task
import org.gradle.api.Project
import org.gradle.api.tasks.SourceTask
import java.net.URLClassLoader

/**
 * Tasks provider to be used wrapper
 * Created by Nikita.Skvortsov
 * date: 17.12.2014.
 */

public open class KotlinTasksProvider(val tasksLoader: ClassLoader) {
    val kotlinJVMCompileTaskClass: Class =
            tasksLoader.loadClass("org.jetbrains.kotlin.gradle.tasks.KotlinCompile") as Class

    val kotlinJSCompileTaskClass: Class =
            tasksLoader.loadClass("org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile") as Class

    val kotlinJVMOptionsClass: Class =
            tasksLoader.loadClass("org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments") as Class


    public fun createKotlinJVMTask(project: Project, name: String): AbstractCompile {
        return project.tasks.create(name, kotlinJVMCompileTaskClass)
    }

    public fun createKotlinJSTask(project: Project, name: String): AbstractCompile {
        return project.tasks.create(name, kotlinJSCompileTaskClass)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy