[Build] Add build-tools-api and build-tools-impl modules
#KT-57396 In Progress
This commit is contained in:
committed by
Space Team
parent
3ab057b5e8
commit
3a8d7c0839
@@ -0,0 +1,3 @@
|
||||
## Build Tools
|
||||
|
||||
Please refer to the [Build Tools API readme](./build-tools-api/README.md).
|
||||
@@ -0,0 +1,9 @@
|
||||
## Build Tools API
|
||||
|
||||
This module contains public interfaces for Kotlin build tools.
|
||||
Using APIs from this module should be the preferred way to work with Kotlin compiler when integrating Kotlin builds into different build systems.
|
||||
The Kotlin stdlib of at least Kotlin 1.4 is expected to be a dependency of a consumer of the API.
|
||||
|
||||
The default implementation of the API is located in the [build-tools-impl](../build-tools-impl) directory.
|
||||
Interfaces implementation are expected to be loaded using the [ServiceLoader](https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html).
|
||||
The purpose of such a segregation is to allow using this API with different Kotlin compiler versions.
|
||||
@@ -0,0 +1,14 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
configureKotlinCompileTasksGradleCompatibility()
|
||||
|
||||
dependencies {
|
||||
compileOnly(kotlinStdlib())
|
||||
}
|
||||
|
||||
publish()
|
||||
|
||||
standardPublicJars()
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright 2010-2023 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.buildtools.api
|
||||
|
||||
/**
|
||||
* A facade for invoking compilation in Kotlin compiler. It allows to use compiler in different modes.
|
||||
* TODO: add a mention where to see the available modes after implementing them
|
||||
*/
|
||||
interface CompilationService {
|
||||
fun compile()
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":compiler:build-tools:build-tools-api"))
|
||||
implementation(kotlinStdlib())
|
||||
}
|
||||
|
||||
publish()
|
||||
|
||||
standardPublicJars()
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright 2010-2023 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.buildtools.internal
|
||||
|
||||
import org.jetbrains.kotlin.buildtools.api.CompilationService
|
||||
|
||||
internal class CompilationServiceImpl : CompilationService {
|
||||
override fun compile() {
|
||||
println("I'm simulating compilation, nothing more yet")
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.buildtools.internal.CompilationServiceImpl
|
||||
Reference in New Issue
Block a user