init research
This commit is contained in:
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
## :build-logic
|
||||
|
||||
This project contains all shared logic for build logic (`build.gradle.kts` files).
|
||||
|
||||
The entire DataFrame project is built
|
||||
using [Composite Builds](https://docs.gradle.org/current/userguide/composite_builds.html)
|
||||
and [Pre-compiled Script Plugins](https://docs.gradle.org/current/userguide/implementing_gradle_plugins_precompiled.html)
|
||||
acting as [Convention Plugins](https://docs.gradle.org/current/userguide/implementing_gradle_plugins_convention.html).
|
||||
|
||||
### Plugins:
|
||||
- `dfbuild.base`: common build logic for all projects.
|
||||
- `dfbuild.kotlinJvmCommon`: common build logic for all Kotlin JVM projects.
|
||||
- Includes `dfbuild.base` and `dfbuild.ktlint`.
|
||||
- Sets `explicitApi()`, opt-ins, and the toolchain version.
|
||||
- Sets up the `instrumentedJars` configuration and task.
|
||||
- This should not be used directly, as a JVM target version needs to be picked.
|
||||
Use `dfbuild.kotlinJvm8` (preferred) or `dfbuild.kotlinJvm11` instead.
|
||||
- `dfbuild.kotlinJvm8`: See `dfbuild.kotlinJvmCommon`.
|
||||
- `dfbuild.kotlinJvm11`: See `dfbuild.kotlinJvmCommon`.
|
||||
- `dfbuild.ktlint`: Sets up our linter plugin. Included by default in `dfbuild.kotlinJvmCommon`.
|
||||
- `dfbuild.buildConfig`: Generates build config compile-time constants,
|
||||
like `BuildConfig.VERSION` and `BuildConfig.DEBUG`.
|
||||
Is NOT included by default, but can be combined with `dfbuild.kotlinJvm<X>`.
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
import dev.panuszewski.gradle.pluginMarker
|
||||
import org.gradle.kotlin.dsl.support.expectedKotlinDslPluginsVersion
|
||||
|
||||
plugins {
|
||||
// The Kotlin DSL plugin provides a convenient way to develop convention plugins.
|
||||
// Convention plugins are located in `src/main/kotlin`, with the file extension `.gradle.kts`,
|
||||
// and are applied in the project's `build.gradle.kts` files as required.
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(21)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Add a dependency on the Kotlin Gradle plugin so that convention plugins can apply it.
|
||||
implementation(libs.kotlin.gradle.plugin)
|
||||
implementation("org.gradle.kotlin:gradle-kotlin-dsl-plugins:$expectedKotlinDslPluginsVersion")
|
||||
|
||||
// We need to declare a dependency for each plugin used in convention plugins below
|
||||
implementation(pluginMarker(libs.plugins.ktlint.gradle))
|
||||
implementation(pluginMarker(libs.plugins.buildconfig))
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
pluginManagement {
|
||||
includeBuild("../build-settings-logic")
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dfsettings.catalogs-inside-convention-plugins")
|
||||
}
|
||||
|
||||
rootProject.name = "build-logic"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
plugins { base }
|
||||
|
||||
description = "Base convention plugin which others can build on top of"
|
||||
@@ -0,0 +1,34 @@
|
||||
@file:OptIn(ExperimentalBuildToolsApi::class)
|
||||
|
||||
import org.gradle.kotlin.dsl.support.uppercaseFirstChar
|
||||
import org.jetbrains.kotlin.buildtools.api.ExperimentalBuildToolsApi
|
||||
|
||||
plugins {
|
||||
alias(convention.plugins.kotlinJvmCommon)
|
||||
alias(libs.plugins.buildconfig)
|
||||
}
|
||||
|
||||
buildConfig {
|
||||
packageName = "org.jetbrains.kotlinx.dataframe"
|
||||
className = "BuildConfig"
|
||||
buildConfigField("KOTLIN_VERSION", libs.versions.kotlin.asProvider().get())
|
||||
buildConfigField("KOTLIN_COMPILER_VERSION", kotlin.compilerVersion.get())
|
||||
buildConfigField("VERSION", "${project.version}")
|
||||
buildConfigField("DEBUG", findProperty("kotlin.dataframe.debug")?.toString()?.toBoolean() ?: false)
|
||||
}
|
||||
|
||||
// combining buildconfig with ktlint
|
||||
val buildConfigSources by kotlin.sourceSets.creating {
|
||||
kotlin.srcDir("build/generated/sources/buildConfig/main")
|
||||
}
|
||||
tasks.generateBuildConfig {
|
||||
finalizedBy(
|
||||
"runKtlintFormatOver${buildConfigSources.name.uppercaseFirstChar()}SourceSet",
|
||||
)
|
||||
}
|
||||
tasks.named { "Ktlint" in it && "Check" in it }.configureEach {
|
||||
dependsOn(
|
||||
tasks.generateBuildConfig,
|
||||
"runKtlintFormatOver${buildConfigSources.name.uppercaseFirstChar()}SourceSet",
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
alias(convention.plugins.kotlinJvmCommon)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = JvmTarget.JVM_11
|
||||
freeCompilerArgs.add("-Xjdk-release=11")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = JavaVersion.VERSION_11.toString()
|
||||
targetCompatibility = JavaVersion.VERSION_11.toString()
|
||||
options.release.set(11)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
alias(convention.plugins.kotlinJvmCommon)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = JvmTarget.JVM_1_8
|
||||
freeCompilerArgs.add("-Xjdk-release=8")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
|
||||
targetCompatibility = JavaVersion.VERSION_1_8.toString()
|
||||
options.release.set(8)
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
plugins {
|
||||
alias(convention.plugins.base)
|
||||
// enables the linter for every Kotlin module in the project
|
||||
alias(convention.plugins.ktlint)
|
||||
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
explicitApi()
|
||||
jvmToolchain(21)
|
||||
compilerOptions {
|
||||
// can be removed once kotlin.uuid.ExperimentalUuidApi is marked "stable".
|
||||
optIn.add("kotlin.uuid.ExperimentalUuidApi")
|
||||
}
|
||||
}
|
||||
|
||||
// Adds the instrumentedJars configuration/artifact to all Kotlin sub-projects.
|
||||
// This allows other modules to depend on the output of this task, aka the compiled jar of that module
|
||||
// Used in :plugins:dataframe-gradle-plugin integration tests and in :samples for compiler plugin support
|
||||
val instrumentedJars: Configuration by configurations.creating {
|
||||
isCanBeConsumed = true
|
||||
isCanBeResolved = false
|
||||
}
|
||||
artifacts {
|
||||
add("instrumentedJars", tasks.jar.get().archiveFile) {
|
||||
builtBy(tasks.jar)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
plugins {
|
||||
alias(convention.plugins.base)
|
||||
alias(libs.plugins.ktlint.gradle)
|
||||
}
|
||||
|
||||
// rules are set up through .editorconfig
|
||||
ktlint {
|
||||
version = libs.versions.ktlint.asProvider()
|
||||
}
|
||||
Reference in New Issue
Block a user