<commit_before>import build.kotlinVersion

plugins {
    `java-gradle-plugin`
    id("com.gradle.plugin-publish") version "0.9.7"
}

apply<plugins.GskModule>()

base {
    archivesBaseName = "gradle-script-kotlin-plugins"
}

dependencies {

    implementation(kotlin("stdlib"))
    implementation(kotlin("gradle-plugin"))

    testImplementation(project(":test-fixtures"))
}

tasks {
    "generateEmbeddedKotlinMetadata"(WriteProperties::class) {
        val metadataPropertiesFile = file("$buildDir/generated-resources/main/embedded-kotlin-metadata.properties")

        outputFile = file(metadataPropertiesFile)
        properties(mapOf("embeddedKotlinVersion" to kotlinVersion))

        val main by java.sourceSets
        main.resources.srcDir(metadataPropertiesFile.parentFile)

        val processResources by tasks
        processResources.dependsOn(this)
    }
    "test" {
        val customInstallation by rootProject.tasks
        dependsOn(customInstallation)
    }
}

// --- Plugin declaration ----------------------------------------------
val pluginId = "org.gradle.script.lang.kotlin.plugins.embedded-kotlin"

gradlePlugin {
    (plugins) {
        pluginId {
            id = pluginId
            implementationClass = "org.gradle.script.lang.kotlin.plugins.embedded.EmbeddedKotlinPlugin"
        }
    }
}

pluginBundle {
    (plugins) {
        pluginId {
            id = pluginId
            displayName = "Embedded Kotlin Gradle Plugin"
        }
    }
}

// --- Utility functions -----------------------------------------------
fun kotlin(module: String) = "org.jetbrains.kotlin:kotlin-$module:$kotlinVersion"<commit_msg>Refine plugin declaration in :plugins build script<commit_after>import build.kotlinVersion

plugins {
    `java-gradle-plugin`
    id("com.gradle.plugin-publish") version "0.9.7"
}

apply<plugins.GskModule>()

base {
    archivesBaseName = "gradle-script-kotlin-plugins"
}

dependencies {

    implementation(kotlin("stdlib"))
    implementation(kotlin("gradle-plugin"))

    testImplementation(project(":test-fixtures"))
}

tasks {
    "generateEmbeddedKotlinMetadata"(WriteProperties::class) {
        val metadataPropertiesFile = file("$buildDir/generated-resources/main/embedded-kotlin-metadata.properties")

        outputFile = file(metadataPropertiesFile)
        properties(mapOf("embeddedKotlinVersion" to kotlinVersion))

        val main by java.sourceSets
        main.resources.srcDir(metadataPropertiesFile.parentFile)

        val processResources by tasks
        processResources.dependsOn(this)
    }
    "test" {
        val customInstallation by rootProject.tasks
        dependsOn(customInstallation)
    }
}


// --- Plugins declaration ----------------------------------------------

data class GradlePlugin(val displayName: String, val id: String, val implementationClass: String)

val plugins = listOf(
    GradlePlugin("Embedded Kotlin Gradle Plugin",
                 "org.gradle.script.lang.kotlin.plugins.embedded-kotlin",
                 "org.gradle.script.lang.kotlin.plugins.embedded.EmbeddedKotlinPlugin"))

plugins.forEach { plugin ->

    gradlePlugin {
        (plugins) {
            plugin.id {
                id = plugin.id
                implementationClass = plugin.implementationClass
            }
        }
    }

    pluginBundle {
        (plugins) {
            plugin.id {
                id = plugin.id
                displayName = plugin.displayName
            }
        }
    }
}


// --- Utility functions -----------------------------------------------
fun kotlin(module: String) = "org.jetbrains.kotlin:kotlin-$module:$kotlinVersion"
{'fraction_non_alphanumeric': 0.1509485839978004, 'fraction_numerical': 0.0016497113005224085, 'mean_word_length': 2.3284537968892955, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7024576', 'n_tokens_mistral': 1049, 'n_tokens_neox': 966, 'n_words': 159}