Skip to content

Commit

Permalink
First iteration of the new generator with Gradle plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cupertank committed Jul 10, 2024
1 parent d021715 commit fc03e2b
Show file tree
Hide file tree
Showing 84 changed files with 1,773 additions and 2,205 deletions.
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.kotlinMpp) 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

0 comments on commit fc03e2b

Please sign in to comment.