Skip to content

Commit

Permalink
Rename everything else
Browse files Browse the repository at this point in the history
  • Loading branch information
TarCV authored and TarCV committed Oct 28, 2023
1 parent 6ba572f commit d64cd3e
Show file tree
Hide file tree
Showing 27 changed files with 59 additions and 60 deletions.
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {

val gitVersion: groovy.lang.Closure<*> by extra

group = "io.koalaql"
group = "com.github.tarcv"
version = gitVersion()

check("$version".isNotBlank() && version != "unspecified")
Expand Down
12 changes: 6 additions & 6 deletions kotbridge-plugin-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ gradlePlugin {
vcsUrl.set("https://github.com/mfwgenerics/kapshot.git")

plugins {
create("kapshotPlugin") {
id = "io.koalaql.kapshot-plugin"
displayName = "Kapshot Plugin"
description = "Kotlin Compiler Plugin for source capture in closure blocks"
implementationClass = "io.koalaql.kapshot.GradlePlugin"
create("kotbridgePlugin") {
id = "com.github.tarcv.kotbridge-plugin"
displayName = "Kotbridge Plugin"
description = "Kotlin Compiler Plugin for compiling source fragments as Kotlin/JS"
implementationClass = "com.github.tarcv.kotbridge.GradlePlugin"

tags.set(listOf("kotlin", "kapshot", "jvm"))
tags.set(listOf("kotlin", "kotbridge", "jvm"))
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.koalaql.kapshot
package com.github.tarcv.kotbridge

import io.koalaql.kapshot_plugin_gradle.BuildConfig
import com.github.tarcv.kotbridge_plugin_gradle.BuildConfig
import org.gradle.api.Project
import org.gradle.api.provider.Provider
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
Expand All @@ -11,18 +11,18 @@ import org.jetbrains.kotlin.gradle.plugin.SubpluginOption
class GradlePlugin : KotlinCompilerPluginSupportPlugin {
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean = true

override fun getCompilerPluginId(): String = "io.koalaql.kapshot-plugin"
override fun getCompilerPluginId(): String = "com.github.tarcv.kotbridge-plugin"

override fun getPluginArtifact(): SubpluginArtifact = SubpluginArtifact(
groupId = "io.koalaql",
artifactId = "kapshot-plugin-kotlin",
groupId = "com.github.tarcv",
artifactId = "kotbridge-plugin-kotlin",
version = BuildConfig.VERSION
)

override fun apply(target: Project) {
/* make sure we don't try to add dependency until it has been configured by kotlin plugin */
target.plugins.withId("org.jetbrains.kotlin.jvm") {
target.dependencies.add("implementation", "io.koalaql:kapshot-runtime:${BuildConfig.VERSION}")
target.dependencies.add("implementation", "com.github.tarcv:kotbridge-runtime:${BuildConfig.VERSION}")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot.plugin
package com.github.tarcv.kotbridge.plugin

import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
Expand Down Expand Up @@ -47,9 +47,9 @@ class CaptureTransformer(
private val projectDir: Path,
private val extractedTargetDir: Path,
private val addSourceToBlock: IrSimpleFunctionSymbol,
private val capturableFqn: String = "io.koalaql.kapshot.Capturable",
private val captureSourceFqn: String = "io.koalaql.kapshot.CaptureSource",
private val converterInfoFqn: String = "io.koalaql.kapshot.Converters"
private val capturableFqn: String = "com.github.tarcv.kotbridge.Capturable",
private val captureSourceFqn: String = "com.github.tarcv.kotbridge.CaptureSource",
private val converterInfoFqn: String = "com.github.tarcv.kotbridge.Converters"
): IrElementTransformerVoidWithContext() {

private fun currentFileText(): String {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot.plugin
package com.github.tarcv.kotbridge.plugin

import com.google.auto.service.AutoService
import org.jetbrains.kotlin.compiler.plugin.AbstractCliOption
Expand All @@ -10,7 +10,7 @@ import org.jetbrains.kotlin.config.CompilerConfiguration
@AutoService(CommandLineProcessor::class)
@OptIn(ExperimentalCompilerApi::class)
class CliProcessor: CommandLineProcessor {
override val pluginId: String = "io.koalaql.kapshot-plugin"
override val pluginId: String = "com.github.tarcv.kotbridge-plugin"

override val pluginOptions: Collection<CliOption> = listOf(
CliOption(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot.plugin
package com.github.tarcv.kotbridge.plugin

import org.jetbrains.kotlin.config.CompilerConfigurationKey

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot.plugin
package com.github.tarcv.kotbridge.plugin

import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
Expand All @@ -17,7 +17,7 @@ class GenerationExtension(
override fun generate(moduleFragment: IrModuleFragment, pluginContext: IrPluginContext) {
val addSourceToBlock = pluginContext
.referenceFunctions(CallableId(
packageName = FqName("io.koalaql.kapshot"),
packageName = FqName("com.github.tarcv.kotbridge"),
callableName = Name.identifier("addSourceToBlock")
))
.first()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot.plugin
package com.github.tarcv.kotbridge.plugin

import org.jetbrains.kotlin.config.CompilerConfigurationKey

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot.plugin
package com.github.tarcv.kotbridge.plugin

import com.google.auto.service.AutoService
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot
package com.github.tarcv.kotbridge

interface Capturable<T : Capturable<T>> {
val source: Source get() = error("there is no source code for this block")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot
package com.github.tarcv.kotbridge

@Target(
AnnotationTarget.CLASS,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot
package com.github.tarcv.kotbridge

fun interface CapturedBlock<T>: Capturable<CapturedBlock<T>> {
operator fun invoke(): T
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot
package com.github.tarcv.kotbridge

fun parseLocation(location: String): SourceLocation {
fun parseOffset(offset: String): SourceOffset = offset
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot
package com.github.tarcv.kotbridge

/**
* Ignore an annotated element when checking if it should be imported in a KtJs fragment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot
package com.github.tarcv.kotbridge

class Source(
val location: SourceLocation,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot
package com.github.tarcv.kotbridge

class SourceLocation(
val path: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot
package com.github.tarcv.kotbridge

class SourceOffset(
val char: Int,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.koalaql.kapshot
package com.github.tarcv.kotbridge

import kotlin.reflect.*

Expand Down
7 changes: 3 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
pluginManagement {
includeBuild("kapshot-plugin-gradle")
includeBuild("kotbridge-plugin-gradle")
}

includeBuild("kapshot-runtime")
includeBuild("kapshot-plugin-kotlin")
includeBuild("kotbridge-runtime")
includeBuild("kotbridge-plugin-kotlin")

include("testing")
include("readme")
2 changes: 1 addition & 1 deletion testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.jetbrains.kotlin.incremental.createDirectory
import org.jetbrains.kotlin.incremental.deleteDirectoryContents

plugins {
id("io.koalaql.kapshot-plugin")
id("com.github.tarcv.kotbridge-plugin")

kotlin("jvm")

Expand Down
8 changes: 4 additions & 4 deletions testing/src/test/kotlin/CaptureSourceTests.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import io.koalaql.kapshot.CaptureSource
import io.koalaql.kapshot.sourceOf
import com.github.tarcv.kotbridge.CaptureSource
import com.github.tarcv.kotbridge.sourceOf
import kotlin.test.Test
import kotlin.test.assertEquals

Expand Down Expand Up @@ -36,11 +36,11 @@ class CaptureSourceTests {

assertEquals("src/test/kotlin/CaptureSourceTests.kt", location.path)

assertEquals(182, location.from.char)
assertEquals(198, location.from.char)
assertEquals(7, location.from.line)
assertEquals(4, location.from.column)

assertEquals(329, location.to.char)
assertEquals(345, location.to.char)
assertEquals(14, location.to.line)
assertEquals(5, location.to.column)

Expand Down
6 changes: 3 additions & 3 deletions testing/src/test/kotlin/CapturedBlockTests.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import io.koalaql.kapshot.Capturable
import io.koalaql.kapshot.CapturedBlock
import io.koalaql.kapshot.Source
import com.github.tarcv.kotbridge.Capturable
import com.github.tarcv.kotbridge.CapturedBlock
import com.github.tarcv.kotbridge.Source
import kotlinx.coroutines.runBlocking
import org.junit.jupiter.api.Test
import kotlin.coroutines.resume
Expand Down
14 changes: 7 additions & 7 deletions testing/src/test/kotlin/CapturedLocationTests.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import io.koalaql.kapshot.CapturedBlock
import com.github.tarcv.kotbridge.CapturedBlock
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals

Expand All @@ -14,11 +14,11 @@ class CapturedLocationTests {
assertEquals("2 + 2", block.source.text)
assertEquals("src/test/kotlin/CapturedLocationTests.kt", location.path)

assertEquals(223, location.from.char)
assertEquals(231, location.from.char)
assertEquals(12, location.from.column)
assertEquals(8, location.from.line)

assertEquals(228, location.to.char)
assertEquals(236, location.to.char)
assertEquals(17, location.to.column)
assertEquals(8, location.to.line)
}
Expand All @@ -34,11 +34,11 @@ class CapturedLocationTests {
assertEquals("", block.source.text)
assertEquals("src/test/kotlin/CapturedLocationTests.kt", location.path)

assertEquals(763, location.from.char)
assertEquals(771, location.from.char)
assertEquals(35, location.from.column)
assertEquals(27, location.from.line)

assertEquals(763, location.to.char)
assertEquals(771, location.to.char)
assertEquals(35, location.to.column)
assertEquals(27, location.to.line)
}
Expand All @@ -52,11 +52,11 @@ class CapturedLocationTests {
assertEquals("", block.source.text)
assertEquals("src/test/kotlin/CapturedLocationTests.kt", location.path)

assertEquals(1303, location.from.char)
assertEquals(1311, location.from.char)
assertEquals(35, location.from.column)
assertEquals(47, location.from.line)

assertEquals(1303, location.to.char)
assertEquals(1311, location.to.char)
assertEquals(35, location.to.column)
assertEquals(47, location.to.line)
}
Expand Down
2 changes: 1 addition & 1 deletion testing/src/test/kotlin/FrameworkExtensions.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import com.microsoft.playwright.ElementHandle
import io.koalaql.kapshot.KtJsNoImport
import com.github.tarcv.kotbridge.KtJsNoImport
import org.openqa.selenium.WebElement
import org.w3c.dom.Node

Expand Down
6 changes: 3 additions & 3 deletions testing/src/test/kotlin/PlaywrightDemoTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import com.microsoft.playwright.ElementHandle
import com.microsoft.playwright.Locator
import com.microsoft.playwright.Page
import com.microsoft.playwright.Playwright
import io.koalaql.kapshot.Capturable
import io.koalaql.kapshot.Converters
import io.koalaql.kapshot.Source
import com.github.tarcv.kotbridge.Capturable
import com.github.tarcv.kotbridge.Converters
import com.github.tarcv.kotbridge.Source
import org.intellij.lang.annotations.Language
import org.junit.jupiter.api.Test
import org.w3c.dom.asList
Expand Down
6 changes: 3 additions & 3 deletions testing/src/test/kotlin/SeleniumDemoTests.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import io.koalaql.kapshot.Capturable
import io.koalaql.kapshot.Converters
import io.koalaql.kapshot.Source
import com.github.tarcv.kotbridge.Capturable
import com.github.tarcv.kotbridge.Converters
import com.github.tarcv.kotbridge.Source
import org.intellij.lang.annotations.Language
import org.junit.jupiter.api.Test
import org.openqa.selenium.By
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
)
package org.w3c.dom

import io.koalaql.kapshot.KtJsNoImport
import com.github.tarcv.kotbridge.KtJsNoImport

// Stubs of kt/js only APIs

Expand Down

0 comments on commit d64cd3e

Please sign in to comment.