From 71acca85c386cb335901fd0051205ccebd417a30 Mon Sep 17 00:00:00 2001 From: tkadziolka Date: Wed, 30 Jul 2025 21:06:36 +0200 Subject: [PATCH 1/8] Migrated to use gradle 8.5 --- build.gradle.kts | 2 ++ gradle/wrapper/gradle-wrapper.properties | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 46ecd3a..4548f40 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,6 +18,8 @@ kotlin { jvm { compilations.all { kotlinOptions.jvmTarget = "1.8" + java.sourceCompatibility = JavaVersion.VERSION_1_8 + java.targetCompatibility = JavaVersion.VERSION_1_8 } withJava() testRuns["test"].executionTask.configure { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb87..1af9e09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 65ef375c33bd453362901d9b6d3ca8b39ded0f03 Mon Sep 17 00:00:00 2001 From: tkadziolka Date: Wed, 30 Jul 2025 20:53:22 +0200 Subject: [PATCH 2/8] Fixed keyword highlight when appeared on end --- .../dev/snipme/highlights/internal/Extensions.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/commonMain/kotlin/dev/snipme/highlights/internal/Extensions.kt b/src/commonMain/kotlin/dev/snipme/highlights/internal/Extensions.kt index a03aa3c..b9a3534 100644 --- a/src/commonMain/kotlin/dev/snipme/highlights/internal/Extensions.kt +++ b/src/commonMain/kotlin/dev/snipme/highlights/internal/Extensions.kt @@ -2,9 +2,9 @@ package dev.snipme.highlights.internal import dev.snipme.highlights.model.CodeHighlight import dev.snipme.highlights.model.PhraseLocation +import kotlinx.coroutines.Job import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json -import kotlinx.coroutines.Job import kotlin.coroutines.cancellation.CancellationException fun List.toJson(): String { @@ -74,15 +74,21 @@ fun String.isIndependentPhrase( if (index == code.lastIndex) return true if (code.length == this.length) return true - val charBefore = code[maxOf(index - 1, 0)] + // Token is at start of the code val charAfter = code[minOf(index + this.length, code.lastIndex)] - if (index == 0) { return charAfter.isDigit().not() && charAfter.isLetter().not() } + // Token is at end of the code + val charBefore = code[maxOf(index - 1, 0)] + if (index + this.length == code.length) { + return charBefore.isLetter().not() + } + + // Token is in the middle of the code return charBefore.isLetter().not() && - charAfter.isDigit().not() && (charAfter == code.last() || charAfter.isLetter().not()) + charAfter.isDigit().not() && charAfter.isLetter().not() } fun Set.toRangeSet(): Set = From 2e35bcccd07d7daaf365762b8ff775e6eb72fb44 Mon Sep 17 00:00:00 2001 From: tkadziolka Date: Sat, 16 Aug 2025 23:19:57 +0200 Subject: [PATCH 3/8] Added test of code from issue --- .../snipme/highlights/internal/CodeSamples.kt | 23 +++++++++++++++++++ .../internal/language/PythonTest.kt | 21 +++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/commonTest/kotlin/dev/snipme/highlights/internal/language/PythonTest.kt diff --git a/src/commonTest/kotlin/dev/snipme/highlights/internal/CodeSamples.kt b/src/commonTest/kotlin/dev/snipme/highlights/internal/CodeSamples.kt index fd89b17..a97828b 100644 --- a/src/commonTest/kotlin/dev/snipme/highlights/internal/CodeSamples.kt +++ b/src/commonTest/kotlin/dev/snipme/highlights/internal/CodeSamples.kt @@ -1312,3 +1312,26 @@ val longJavaCode = """ } } """.trimIndent() + +val longPythonCode = """ + import polars as pl + + def transform_dataframe(df: pl.DataFrame, max_seq_len: int, end_action_value: int) -> pl.DataFrame: + end_val = pl.lit(end_action_value) + max_len = pl.lit(max_seq_len) + df_with_ends = df.with_columns( + end_indices=pl.col("actionType").list.eval( + pl.int_range(0, pl.len()).filter(pl.element() == end_val) + ) + ) + df_exploded = df_with_ends.explode("end_indices") + start_offset = (pl.col("end_indices") + 1 - max_len).clip(lower_bound=0) + slice_len = pl.col("end_indices") - start_offset + 1 + list_cols = ["actionType", "engagementTimeMs", "actionTweetIds"] + for col in list_cols: + df_exploded = df_exploded.with_columns( + pl.col(col).list.slice(start_offset, slice_len).alias(col) + ) + result = df_exploded.select(["userId", "actionType", "engagementTimeMs", "actionTweetIds"]) + return result +""".trimIndent() \ No newline at end of file diff --git a/src/commonTest/kotlin/dev/snipme/highlights/internal/language/PythonTest.kt b/src/commonTest/kotlin/dev/snipme/highlights/internal/language/PythonTest.kt new file mode 100644 index 0000000..bd692b9 --- /dev/null +++ b/src/commonTest/kotlin/dev/snipme/highlights/internal/language/PythonTest.kt @@ -0,0 +1,21 @@ +package dev.snipme.highlights.internal.language + +import dev.snipme.highlights.Highlights +import dev.snipme.highlights.internal.longPythonCode +import dev.snipme.highlights.model.SyntaxLanguage +import kotlin.test.Test +import kotlin.test.assertEquals + +class PythonTest { + + @Test + fun test() { + val result = Highlights.Builder() + .code(longPythonCode) + .language(SyntaxLanguage.PYTHON) + .build() + .getCodeStructure() + + assertEquals(6, result.keywords.size) + } +} \ No newline at end of file From dbcf4988eda05b3ad883ac539c662d6ce31b7721 Mon Sep 17 00:00:00 2001 From: tkadziolka Date: Sun, 17 Aug 2025 12:49:00 +0200 Subject: [PATCH 4/8] Covered other keyword locating cases --- .../snipme/highlights/internal/Extensions.kt | 67 +++++++++++++++++-- .../internal/locator/KeywordLocator.kt | 14 +--- .../internal/locator/NumericLiteralLocator.kt | 58 +++++++++++----- .../highlights/internal/ExtensionsKtTest.kt | 26 ++++++- .../internal/locator/KeywordLocatorTest.kt | 18 +++-- .../locator/NumericLiteralLocatorTest.kt | 9 +++ 6 files changed, 151 insertions(+), 41 deletions(-) diff --git a/src/commonMain/kotlin/dev/snipme/highlights/internal/Extensions.kt b/src/commonMain/kotlin/dev/snipme/highlights/internal/Extensions.kt index b9a3534..692691a 100644 --- a/src/commonMain/kotlin/dev/snipme/highlights/internal/Extensions.kt +++ b/src/commonMain/kotlin/dev/snipme/highlights/internal/Extensions.kt @@ -1,5 +1,8 @@ package dev.snipme.highlights.internal +import dev.snipme.highlights.internal.locator.NUMBER_TYPE_CHARACTERS +import dev.snipme.highlights.internal.SyntaxTokens.MARK_CHARACTERS +import dev.snipme.highlights.internal.SyntaxTokens.PUNCTUATION_CHARACTERS import dev.snipme.highlights.model.CodeHighlight import dev.snipme.highlights.model.PhraseLocation import kotlinx.coroutines.Job @@ -15,7 +18,7 @@ fun String.phraseLocationSetFromJson(): Set { return Json.decodeFromString(this) } -inline operator fun Set.get(i: Int): E? { +operator fun Set.get(i: Int): E? { this.forEachIndexed { index, t -> if (i == index) return t } @@ -77,18 +80,72 @@ fun String.isIndependentPhrase( // Token is at start of the code val charAfter = code[minOf(index + this.length, code.lastIndex)] if (index == 0) { - return charAfter.isDigit().not() && charAfter.isLetter().not() + return charAfter.isDigit().not() && charAfter.isLetter().not() && charAfter != '_' } // Token is at end of the code val charBefore = code[maxOf(index - 1, 0)] if (index + this.length == code.length) { - return charBefore.isLetter().not() + return (charBefore.isLetter().not() && charBefore != '_') || isAfterNumericSuffix(code, index) } // Token is in the middle of the code - return charBefore.isLetter().not() && - charAfter.isDigit().not() && charAfter.isLetter().not() + return ((charBefore.isLetter().not() || isAfterNumericSuffix(code, index)) && + charAfter.isDigit().not() && charAfter.isLetter().not() && charAfter != '_') +} + +private fun String.isAfterNumericSuffix(code: String, keywordIndex: Int): Boolean { + if (keywordIndex == 0) return false + + val charBefore = code[keywordIndex - 1] + + // Check if the character before is a valid numeric suffix + val validSuffixes = NUMBER_TYPE_CHARACTERS + if (charBefore !in validSuffixes) return false + + // Walk backwards to validate the number structure + var i = keywordIndex - 2 + var hasDigit = false + var hasDot = false + + while (i >= 0) { + val char = code[i] + + when { + char.isDigit() -> { + hasDigit = true + i-- + } + char == '.' -> { + if (hasDot) return false + hasDot = true + i-- + } + char == '-' -> { + if (i == 0) { + break + } else { + val prevChar = code[i - 1] + if (prevChar.isLetterOrDigit() || prevChar == '_') { + return false + } else { + break + } + } + } + char == '_' -> { + i-- + } + char.isLetter() -> { + return false + } + else -> { + break + } + } + } + + return hasDigit } fun Set.toRangeSet(): Set = diff --git a/src/commonMain/kotlin/dev/snipme/highlights/internal/locator/KeywordLocator.kt b/src/commonMain/kotlin/dev/snipme/highlights/internal/locator/KeywordLocator.kt index 4a5b3a1..41cba51 100644 --- a/src/commonMain/kotlin/dev/snipme/highlights/internal/locator/KeywordLocator.kt +++ b/src/commonMain/kotlin/dev/snipme/highlights/internal/locator/KeywordLocator.kt @@ -13,9 +13,8 @@ internal object KeywordLocator { ignoreRanges: Set = emptySet(), ): Set { val locations = mutableSetOf() - val foundKeywords = findKeywords(code, keywords) - foundKeywords.forEach { keyword -> + keywords.forEach { keyword -> val indices = code .indicesOf(keyword) .filterNot { index -> ignoreRanges.any { index in it } } @@ -28,15 +27,4 @@ internal object KeywordLocator { return locations } - - private fun findKeywords(code: String, keywords: Set): Set = - TOKEN_DELIMITERS.toTypedArray().let { delimiters -> - code.split(*delimiters, ignoreCase = true) // Split into words - .asSequence() // Reduce amount of operations - .filter { it.isNotBlank() } // Remove empty - .map { it.trim() } // Remove whitespaces from phrase - .map { it.lowercase() } // Standardize - .filter { it in keywords } // Get supported - .toSet() // Filter duplicates - } } \ No newline at end of file diff --git a/src/commonMain/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocator.kt b/src/commonMain/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocator.kt index 572bc56..056772d 100644 --- a/src/commonMain/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocator.kt +++ b/src/commonMain/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocator.kt @@ -5,9 +5,9 @@ import dev.snipme.highlights.internal.indicesOf import dev.snipme.highlights.model.PhraseLocation private val NUMBER_START_CHARACTERS = listOf('-', '.') -private val NUMBER_TYPE_CHARACTERS = listOf('e', 'u', 'f', 'l') private val HEX_NUMBER_CHARACTERS = listOf('a', 'b', 'c', 'd', 'e', 'f') private val NUMBER_SPECIAL_CHARACTERS = listOf('_') +public val NUMBER_TYPE_CHARACTERS = listOf('e', 'u', 'f', 'l') internal object NumericLiteralLocator { @@ -67,8 +67,6 @@ internal object NumericLiteralLocator { } private fun calculateNumberLength(number: String): Int { - val letters = number.filter { it.isLetter() } - if (number.startsWith("0x")) { return getLengthOfSubstringFor(number) { it.isDigit() || HEX_NUMBER_CHARACTERS.contains(it) @@ -81,23 +79,47 @@ internal object NumericLiteralLocator { } } - // Highlight only 4f when e.g. number is like 4fff - if (NUMBER_TYPE_CHARACTERS.any { letters.contains(it) }) { - var length = 1 // Single letter - length += number.count { it.isDigit() } - length += number.count { NUMBER_START_CHARACTERS.contains(it) } - length += number.count { NUMBER_SPECIAL_CHARACTERS.contains(it) } - if ("e+" in number) length++ - return length + var length = 0 + var foundE = false + var foundSignAfterE = false + var foundDot = false + var suffixCount = 0 + val maxSuffixes = 1 + + for (i in number.indices) { + val char = number[i] + when { + char.isDigit() -> { + length++ + } + ((char == '-' && i == 0) || char == '_') -> { + length++ + } + char == '.' && !foundDot -> { + foundDot = true + length++ + } + (char.lowercaseChar() == 'e' && !foundE) -> { + foundE = true + length++ + } + ((char == '+' || char == '-') && foundE && !foundSignAfterE) -> { + foundSignAfterE = true + length++ + } + NUMBER_TYPE_CHARACTERS.contains(char) -> { + if (suffixCount < maxSuffixes) { + length++ + suffixCount++ + } else { + break + } + } + else -> break + } } - return number.filter { - it.isDigit() || - NUMBER_START_CHARACTERS.contains(it) || - NUMBER_TYPE_CHARACTERS.contains(it) || - NUMBER_SPECIAL_CHARACTERS.contains(it) - - }.length + return length } private fun getLengthOfSubstringFor(number: String, condition: (Char) -> Boolean): Int { diff --git a/src/commonTest/kotlin/dev/snipme/highlights/internal/ExtensionsKtTest.kt b/src/commonTest/kotlin/dev/snipme/highlights/internal/ExtensionsKtTest.kt index 49f054e..efa606d 100644 --- a/src/commonTest/kotlin/dev/snipme/highlights/internal/ExtensionsKtTest.kt +++ b/src/commonTest/kotlin/dev/snipme/highlights/internal/ExtensionsKtTest.kt @@ -238,8 +238,32 @@ internal class ExtensionsKtTest { val index = 1 val result = "class".isIndependentPhrase(code, index) - assertEquals(true, result) } + + @Test + fun `Returns false for phrase after underscore`() { + val code = "int_class" + val index = 4 + + val result = "class".isIndependentPhrase(code, index) + + assertEquals(false, result) + } + + @Test + fun `Returns true for phrase after number with suffix`() { + val testCases = listOf( + Triple("9eclass", 2, "class"), + Triple("9uclass", 2, "class"), + Triple("9fclass", 2, "class"), + Triple("9lclass", 2, "class") + ) + + testCases.forEach { (code, keywordIndex, keyword) -> + val result = keyword.isIndependentPhrase(code, keywordIndex) + assertEquals(true, result, "Failed for: '$code' at index $keywordIndex for keyword '$keyword'") + } + } } } \ No newline at end of file diff --git a/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/KeywordLocatorTest.kt b/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/KeywordLocatorTest.kt index f2413fb..2e37a1c 100644 --- a/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/KeywordLocatorTest.kt +++ b/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/KeywordLocatorTest.kt @@ -44,7 +44,7 @@ internal class KeywordLocatorTest { @Test fun `Returns location of all keyword next to each other`() { val testCode = "this.class.abcd ) new" - val keywords = setOf("this", "new", "class") + val keywords = setOf("this", "class", "new") val result = KeywordLocator.locate(testCode, keywords) @@ -75,15 +75,15 @@ internal class KeywordLocatorTest { static class Example2 {} } """.trimIndent() - val keywords = setOf("static", "class", "extends") + val keywords = setOf("class", "static", "extends") val result = KeywordLocator.locate(testCode, keywords) assertEquals(4, result.size) assertEquals(PhraseLocation(0, 5), result[0]) assertEquals(PhraseLocation(42, 47), result[1]) - assertEquals(PhraseLocation(14, 21), result[2]) - assertEquals(PhraseLocation(35, 41), result[3]) + assertEquals(PhraseLocation(35, 41), result[2]) + assertEquals(PhraseLocation(14, 21), result[3]) } @Test @@ -147,4 +147,14 @@ internal class KeywordLocatorTest { assertEquals(0, result.size) } + + @Test + fun `Finds keywords after numeric literals`() { + val testCode = "9class" + val keywords = setOf("class") + val result = KeywordLocator.locate(testCode, keywords) + + assertEquals(1, result.size) + assertEquals(PhraseLocation(1, 6), result.first()) + } } \ No newline at end of file diff --git a/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocatorTest.kt b/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocatorTest.kt index bbdfb10..71aa221 100644 --- a/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocatorTest.kt +++ b/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocatorTest.kt @@ -189,4 +189,13 @@ internal class NumericLiteralLocatorTest { assertEquals(PhraseLocation(31, 38), result[5]) assertEquals(PhraseLocation(39, 45), result[6]) } + + @Test + fun `Returns location of the number with keyword after`() { + val testCode = "9class" + + val result = NumericLiteralLocator.locate(testCode) + + assertEquals(PhraseLocation(0, 1), result[0]) + } } \ No newline at end of file From 1eca0c4fa125b8df223196f6082a420e977a8817 Mon Sep 17 00:00:00 2001 From: tkadziolka Date: Fri, 29 Aug 2025 23:09:43 +0200 Subject: [PATCH 5/8] Bumped kotlin version to 2.2.0 --- README.md | 2 +- build.gradle.kts | 13 ++++--------- sample/build.gradle.kts | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3395b7c..ec074aa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![highlights_banner_opaque](https://github.com/SnipMeDev/Highlights/assets/8405055/e123ce0f-6f58-451a-9e0a-893c0809b909) [![Maven Central](https://img.shields.io/maven-central/v/dev.snipme/highlights)](https://mvnrepository.com/artifact/dev.snipme) -[![Kotlin](https://img.shields.io/badge/kotlin-2.0.20-blue.svg?logo=kotlin)](http://kotlinlang.org) +[![Kotlin](https://img.shields.io/badge/kotlin-2.2.0-blue.svg?logo=kotlin)](http://kotlinlang.org) [![GitHub License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) # Highlights diff --git a/build.gradle.kts b/build.gradle.kts index 4548f40..9be6134 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,11 @@ +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework apply(from = "publish-root.gradle") plugins { - kotlin("multiplatform") version "2.0.20" - kotlin("plugin.serialization") version "2.0.20" + kotlin("multiplatform") version "2.2.0" + kotlin("plugin.serialization") version "2.2.0" id("maven-publish") id("io.github.gradle-nexus.publish-plugin") version "1.3.0" id("signing") @@ -16,18 +17,11 @@ version = "1.0.0" kotlin { // Android jvm { - compilations.all { - kotlinOptions.jvmTarget = "1.8" - java.sourceCompatibility = JavaVersion.VERSION_1_8 - java.targetCompatibility = JavaVersion.VERSION_1_8 - } - withJava() testRuns["test"].executionTask.configure { useJUnitPlatform() } } // iOS - val xcf = XCFramework() val iosTargets = listOf(iosX64(), iosArm64(), iosSimulatorArm64()) @@ -48,6 +42,7 @@ kotlin { browser() nodejs() } + @OptIn(ExperimentalWasmDsl::class) wasmJs() // Dependencies sourceSets { diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index eb44742..e03a44e 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - kotlin("jvm") version "2.0.20" + kotlin("jvm") version "2.2.0" application } From 21c174586968af310b800910767a5eda3b952843 Mon Sep 17 00:00:00 2001 From: tkadziolka Date: Sun, 31 Aug 2025 21:12:36 +0200 Subject: [PATCH 6/8] Updated changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad0e202..2687b29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [1.1.0] + +### Changed +- Kotlin version to 2.2.0 + +### Fixed +- keywords found at start and end of the input + ## [1.0.0] ### Added From bf8e07af06f3f1cac093f5615464a4ac7b422a65 Mon Sep 17 00:00:00 2001 From: tkadziolka Date: Sun, 31 Aug 2025 21:13:48 +0200 Subject: [PATCH 7/8] Updated version number --- README.md | 2 +- build.gradle.kts | 2 +- sample/build.gradle.kts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ec074aa..5d9d1eb 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ repositories { ``` ```shell -implementation("dev.snipme:highlights:1.0.0") +implementation("dev.snipme:highlights:1.1.0") ``` ## Features ✨ diff --git a/build.gradle.kts b/build.gradle.kts index 9be6134..902c94a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ plugins { } group = "dev.snipme" -version = "1.0.0" +version = "1.1.0" kotlin { // Android diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index e03a44e..2ec9fcd 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -15,7 +15,7 @@ repositories { } dependencies { - implementation("dev.snipme:highlights:1.0.0") + implementation("dev.snipme:highlights:1.1.0") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0") testImplementation(kotlin("test")) From 7f273757944ee29a6c06372ff95aabbf7a469819 Mon Sep 17 00:00:00 2001 From: tkadziolka Date: Sun, 31 Aug 2025 22:45:45 +0200 Subject: [PATCH 8/8] Updated new Maven settings --- build.gradle.kts | 30 ++++++++++++++++++++++++++++++ publish-root.gradle | 4 ++-- sample/build.gradle.kts | 1 - 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 902c94a..8c20f74 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -121,4 +121,34 @@ signing { rootProject.ext["signing.password"] as String ) sign(publishing.publications) +} + +tasks.withType { + dependsOn(":signIosSimulatorArm64Publication") + dependsOn(":signIosArm64Publication") + dependsOn(":signIosX64Publication") + dependsOn(":signMacosArm64Publication") + dependsOn(":signMacosX64Publication") + dependsOn(":signJvmPublication") + dependsOn(":signJsPublication") + dependsOn(":signLinuxArm64Publication") + dependsOn(":signLinuxX64Publication") + dependsOn(":signMingwX64Publication") + dependsOn(":signWasmJsPublication") + dependsOn(":signKotlinMultiplatformPublication") +} + +tasks.withType { + dependsOn(":signIosSimulatorArm64Publication") + dependsOn(":signIosArm64Publication") + dependsOn(":signIosX64Publication") + dependsOn(":signMacosArm64Publication") + dependsOn(":signMacosX64Publication") + dependsOn(":signJvmPublication") + dependsOn(":signJsPublication") + dependsOn(":signLinuxArm64Publication") + dependsOn(":signLinuxX64Publication") + dependsOn(":signMingwX64Publication") + dependsOn(":signWasmJsPublication") + dependsOn(":signKotlinMultiplatformPublication") } \ No newline at end of file diff --git a/publish-root.gradle b/publish-root.gradle index cd43973..9291e5d 100644 --- a/publish-root.gradle +++ b/publish-root.gradle @@ -21,8 +21,8 @@ nexusPublishing { stagingProfileId = sonatypeStagingProfileId username = ossrhUsername password = ossrhPassword - nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots/")) } } } \ No newline at end of file diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 2ec9fcd..9ca55b0 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -11,7 +11,6 @@ version = "1.0-SNAPSHOT" repositories { mavenCentral() mavenLocal() - maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") } dependencies {