diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d424bff..1bc60af2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: - name: Set up JDK 11 uses: actions/setup-java@v2 with: - java-version: 11 + java-version: 17 distribution: 'temurin' - name: Grant execute permissions for gradlew run: chmod +x ./gradlew diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 47384f13..39b8e556 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: - name: Set up JDK 11 uses: actions/setup-java@v2 with: - java-version: 11 + java-version: 17 distribution: 'temurin' - name: Grant execute permissions for gradlew run: chmod +x ./gradlew diff --git a/gradle.properties b/gradle.properties index e504bdd7..c5aeba91 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Gradle Releases -> https://github.com/gradle/gradle/releases libraryGroup = com.simiacryptus.skyenet -libraryVersion = 1.2.8 +libraryVersion = 1.2.9 gradleVersion = 7.6.1 kotlin.daemon.jvmargs=-Xmx4g diff --git a/settings.gradle.kts b/settings.gradle.kts index 409d77e6..50b2d786 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,8 +4,6 @@ include("core") include("groovy") include("scala") include("kotlin") -//include("kotlin-hack") -//include("kotlin-hack-test") include("webui") //includeBuild("../jo-penai/") diff --git a/webui/build.gradle.kts b/webui/build.gradle.kts index f432d91b..9e3d0d45 100644 --- a/webui/build.gradle.kts +++ b/webui/build.gradle.kts @@ -12,8 +12,8 @@ plugins { id("org.jetbrains.kotlin.jvm") version "2.0.20" `maven-publish` id("signing") - id("io.freefair.sass-base") version "8.4" - id("io.freefair.sass-java") version "8.4" + id("io.freefair.sass-base") version "8.10.2" + id("io.freefair.sass-java") version "8.10.2" } repositories { @@ -44,16 +44,15 @@ dependencies { implementation(project(":kotlin")) implementation("org.apache.pdfbox:pdfbox:2.0.27") - implementation("org.seleniumhq.selenium:selenium-chrome-driver:4.16.1") + compileOnly("org.seleniumhq.selenium:selenium-chrome-driver:4.16.1") compileOnly("org.jsoup:jsoup:1.17.2") implementation("com.google.zxing:core:3.5.3") implementation("com.google.zxing:javase:3.5.3") compileOnly(group = "software.amazon.awssdk", name = "aws-sdk-java", version = "2.27.23") - runtimeOnly(group = "software.amazon.awssdk", name = "aws-sdk-java", version = "2.27.23") - implementation("org.openapitools:openapi-generator:7.3.0") { + compileOnly("org.openapitools:openapi-generator:7.3.0") { exclude(group = "org.slf4j") } compileOnly("org.openapitools:openapi-generator-cli:7.3.0") { @@ -69,7 +68,8 @@ dependencies { implementation(group = "org.eclipse.jetty.websocket", name = "websocket-servlet", version = jetty_version) implementation(group = "org.eclipse.jetty", name = "jetty-webapp", version = jetty_version) - implementation(group = "com.vladsch.flexmark", name = "flexmark-all", version = "0.64.8") + implementation(group = "com.vladsch.flexmark", name = "flexmark", version = "0.64.8") + implementation(group = "com.vladsch.flexmark", name = "flexmark-ext-tables", version = "0.64.8") compileOnly(group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version = "1.8.0-RC") @@ -89,9 +89,9 @@ dependencies { implementation(group = "com.fasterxml.jackson.core", name = "jackson-annotations", version = jackson_version) implementation(group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin", version = jackson_version) - implementation(group = "com.google.api-client", name = "google-api-client", version = "1.35.2" /*"1.35.2"*/) - implementation(group = "com.google.oauth-client", name = "google-oauth-client-jetty", version = "1.34.1") - implementation(group = "com.google.apis", name = "google-api-services-oauth2", version = "v2-rev157-1.25.0") + compileOnly(group = "com.google.api-client", name = "google-api-client", version = "1.35.2" /*"1.35.2"*/) + compileOnly(group = "com.google.oauth-client", name = "google-oauth-client-jetty", version = "1.34.1") + compileOnly(group = "com.google.apis", name = "google-api-services-oauth2", version = "v2-rev157-1.25.0") implementation(group = "commons-io", name = "commons-io", version = "2.15.0") implementation(group = "commons-codec", name = "commons-codec", version = "1.16.0") diff --git a/webui/src/main/kotlin/com/simiacryptus/diff/IterativePatchUtil.kt b/webui/src/main/kotlin/com/simiacryptus/diff/IterativePatchUtil.kt index 459c6acd..8ef79c7c 100644 --- a/webui/src/main/kotlin/com/simiacryptus/diff/IterativePatchUtil.kt +++ b/webui/src/main/kotlin/com/simiacryptus/diff/IterativePatchUtil.kt @@ -97,7 +97,7 @@ object IterativePatchUtil { log.info("Starting patch application process") // Parse the source and patch texts into lists of line records val sourceLines = parseLines(source) - var patchLines = parsePatchLines(patch) + var patchLines = parsePatchLines(patch, sourceLines) log.debug("Parsed source lines: ${sourceLines.size}, initial patch lines: ${patchLines.size}") link(sourceLines, patchLines, LevenshteinDistance()) @@ -634,7 +634,7 @@ private fun generatePatchedText( * @param text The patch text to parse. * @return The list of line records with types set. */ - private fun parsePatchLines(text: String): List { + private fun parsePatchLines(text: String, sourceLines: List): List { log.debug("Starting to parse patch lines") val patchLines = setLinks(text.lines().mapIndexed { index, line -> LineRecord( @@ -644,6 +644,7 @@ private fun generatePatchedText( it.trimStart().startsWith("+++") -> null it.trimStart().startsWith("---") -> null it.trimStart().startsWith("@@") -> null + sourceLines.find { patchLine -> normalizeLine(patchLine.line ?: "") == normalizeLine(it) } != null -> it it.trimStart().startsWith("+") -> it.trimStart().substring(1) it.trimStart().startsWith("-") -> it.trimStart().substring(1) else -> it