-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup project with KotlinType operations API for plugin
- Loading branch information
Showing
5 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
plugins { | ||
kotlin("jvm") version "1.7.10" | ||
id("java") | ||
kotlin("libs.publisher") version "0.0.60-dev-30" | ||
} | ||
|
||
group = "org.jetbrains.kotlinx.dataframe" | ||
version = "0.9.0-dev" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compileOnly(kotlin("compiler-embeddable")) | ||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") | ||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") | ||
} | ||
|
||
tasks.getByName<Test>("test") { | ||
useJUnitPlatform() | ||
} | ||
|
||
kotlinPublications { | ||
publication { | ||
publicationName.set("api") | ||
artifactId.set("types-api") | ||
description.set("Data processing in Kotlin") | ||
packageName.set(artifactId) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rootProject.name = "type-api" | ||
|
46 changes: 46 additions & 0 deletions
46
type-api/src/main/kotlin/org/jetbrains/kotlinx/dataframe/Main.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.jetbrains.kotlinx.dataframe | ||
|
||
import org.jetbrains.kotlin.fir.FirSession | ||
import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLikeLookupTagImpl | ||
import org.jetbrains.kotlin.fir.types.ConeKotlinType | ||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl | ||
import org.jetbrains.kotlin.name.ClassId | ||
import org.jetbrains.kotlin.name.FqName | ||
import org.jetbrains.kotlin.name.Name | ||
|
||
val DF_CLASS_ID: ClassId | ||
get() = ClassId.topLevel(FqName.fromSegments(listOf("org", "jetbrains", "kotlinx", "dataframe", "DataFrame"))) | ||
|
||
val COLUM_GROUP_CLASS_ID: ClassId | ||
get() = ClassId(FqName("org.jetbrains.kotlinx.dataframe.columns"), Name.identifier("ColumnGroup")) | ||
|
||
class KotlinTypeFacade(private val session: FirSession) { | ||
|
||
val anyDataFrame = ConeClassLikeTypeImpl( | ||
ConeClassLikeLookupTagImpl(DF_CLASS_ID), | ||
typeArguments = arrayOf(session.builtinTypes.anyType.type), | ||
isNullable = false | ||
).wrap() | ||
|
||
fun Marker.toColumnGroup() = ConeClassLikeTypeImpl( | ||
ConeClassLikeLookupTagImpl(COLUM_GROUP_CLASS_ID), | ||
typeArguments = arrayOf(type.typeArguments[0]), | ||
isNullable = false | ||
).wrap() | ||
|
||
} | ||
|
||
class Marker(internal val type: ConeKotlinType) { | ||
override fun toString(): String { | ||
return "Marker(type=$type)" | ||
} | ||
} | ||
|
||
class LazyMarker(internal val factory: (FirSession) -> ConeKotlinType) | ||
|
||
fun ConeKotlinType.wrap(): Marker = Marker(this) | ||
|
||
//fun ConeKotlinType | ||
|
||
|
||
|