Skip to content

Commit

Permalink
fix: fix build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Jan 5, 2024
1 parent 3c7264f commit 5fb6cf3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {
val kotlinVersion = "1.9.0"
kotlin("jvm") version kotlinVersion apply false

kotlin("plugin.serialization") version "1.6.10"

id("java-library")
id("maven-publish")
publishing
Expand Down
11 changes: 4 additions & 7 deletions chapi-ast-go/src/test/kotlin/chapi/ast/goast/GoAnalyserTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,13 @@ func installController(g *gin.Engine) *gin.Engine {
@Disabled
fun analysisByDir() {
val dir = "/Users/phodal/test/iam"
val codeContainer = GoAnalyser().analysisByDir(dir)
val files = File(dir).walkTopDown().filter { it.isFile && it.extension == "go" }.toList()
val codeContainer = files.map {
GoAnalyser().analysis(it.readText(), it.name)
}.toList()
// write to file
val json = Json.encodeToString(codeContainer)
File("iam.json").writeText(json)
}
}

private fun GoAnalyser.analysisByDir(dir: String): List<CodeContainer> {
val files = File(dir).walkTopDown().filter { it.isFile && it.extension == "go" }.toList()
return files.map {
analysis(it.readText(), it.name)
}.toList()
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import chapi.domain.core.*
import chapi.infra.Stack
import org.antlr.v4.runtime.ParserRuleContext
import org.antlr.v4.runtime.tree.ParseTree
import kotlin.reflect.typeOf

data class TargetTypePackage(val targetType: String, val packageName: String)
data class JavaTargetType(var targetType: String = "", var callType: CallType = CallType.FUNCTION)
Expand Down Expand Up @@ -307,9 +306,9 @@ open class JavaFullIdentListener(fileName: String, val classes: List<String>) :
var methodName = callee

var targetTypeStr = targetType
val targetType = this.warpTargetFullType(targetTypeStr)
var callType = targetType.callType
val fullType = targetType.targetType
val wrapTargetType = this.warpTargetFullType(targetTypeStr)
var callType = wrapTargetType.callType
val fullType = wrapTargetType.targetType

if (targetTypeStr == "super" || callee == "super") {
callType = CallType.SUPER
Expand Down
2 changes: 1 addition & 1 deletion chapi-domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
// Kotlin reflection.

testImplementation(kotlin("test"))

// JUnit 5
Expand Down

0 comments on commit 5fb6cf3

Please sign in to comment.