Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primitives Generator as Gradle Plugin #10

Merged
merged 6 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ build
.idea
.gradle
*.iml
**/kotlin-gen/**
**/kotlin-gen/**
**/.kotlin
**/.fleet
17 changes: 0 additions & 17 deletions .run/Compile With Debug.run.xml

This file was deleted.

78 changes: 31 additions & 47 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,67 +1,51 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

group = "io.kinference.primitives"
//also change version in PluginConstants.kt
version = "0.1.26"
group = property("GROUP").toString()
version = property("VERSION").toString()

plugins {
kotlin("multiplatform") version "1.9.21" apply false
`maven-publish` apply true
alias(libs.plugins.kotlin.mpp) apply false
}

subprojects {
if (this.subprojects.isNotEmpty()) return@subprojects
if (this.name == "kotlin-plugin-test") {
apply {
plugin("org.jetbrains.kotlin.multiplatform")

}
return@subprojects
}


allprojects {
repositories {
mavenCentral()
gradlePluginPortal()
}
}

apply {
plugin("org.jetbrains.kotlin.multiplatform")
plugin("maven-publish")
subprojects {
tasks.withType(JavaCompile::class.java).all {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}

publishing {
repositories {
maven {
name = "SpacePackages"
url = uri("https://packages.jetbrains.team/maven/p/ki/maven")

credentials {
username = System.getenv("JB_SPACE_CLIENT_ID") ?: ""
password = System.getenv("JB_SPACE_CLIENT_SECRET") ?: ""
}/**/
tasks.withType(KotlinCompilationTask::class.java).all {
compilerOptions {
if (this is KotlinJvmCompilerOptions) {
jvmTarget.set(JvmTarget.JVM_1_8)
}

apiVersion.set(KotlinVersion.KOTLIN_2_0)
languageVersion.set(KotlinVersion.KOTLIN_2_0)
}
}
}

tasks.register("publish") {
group = "publishing"

extensions.getByType(KotlinMultiplatformExtension::class.java).apply {
sourceSets.all {
languageSettings {
optIn("kotlin.RequiresOptIn")
}
dependsOn(gradle.includedBuild("plugin-build").task(":publish"))
}

languageSettings {
apiVersion = "1.9"
languageVersion = "1.9"
}
}
tasks.register("publishToMavenLocal") {
group = "publishing"

tasks.withType<KotlinJvmCompile> {
kotlinOptions {
jvmTarget = "17"
}
}
}
dependsOn(
gradle.includedBuild("plugin-build").task(":publishToMavenLocal")
)
}

79 changes: 0 additions & 79 deletions detekt.yml

This file was deleted.

45 changes: 0 additions & 45 deletions gradle-plugin-test/build.gradle.kts

This file was deleted.

Binary file removed gradle-plugin-test/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading
Loading