diff --git a/build.gradle.kts b/build.gradle.kts index 61da269d..737ba1b4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,7 +48,7 @@ allprojects { sourceCompatibility = JDK_VERSION targetCompatibility = JDK_VERSION } - compileSdk = 34 + compileSdk = 35 namespace = "com.fleeksoft.${project.name.replace("-", ".")}" defaultConfig { minSdk = 21 diff --git a/common.module-template.yaml b/common.module-template.yaml index 6cf2d620..102880c6 100644 --- a/common.module-template.yaml +++ b/common.module-template.yaml @@ -2,8 +2,11 @@ settings: kotlin: apiVersion: 1.9 languageVersion: 1.9 + jvm: + release: 17 android: - compileSdk: 34 + compileSdk: 35 + minSdk: 21 namespace: "com.fleeksoft.ksoup" test-dependencies: diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 50973106..e26ab759 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,10 +1,10 @@ [versions] -agp = "8.5.2" +agp = "8.7.1" kotlin = "2.0.21" -compileSdk = "34" +compileSdk = "35" minSdk = "21" -libraryVersion = "0.1.9" -ktor = "3.0.0" +libraryVersion = "0.2.0" +ktor = "3.0.1" ktor2 = "2.3.12" coroutines = "1.9.0" kotlinxDatetime = "0.6.1" @@ -15,7 +15,7 @@ kotlinx-benchmark = "0.4.12" #korlibs = "999.0.0.999" # 999.0.0.999 is local version korlibs = "6.0.1" -mavenPublish = "0.29.0" +mavenPublish = "0.30.0" stately = "2.1.0" jsoup = "1.18.1" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136..a4b76b95 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23a..df97d72b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a42..f5feea6d 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 25da30db..9d21a218 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/ksoup-engine-common/module.yaml b/ksoup-engine-common/module.yaml index be37c9cd..55118733 100644 --- a/ksoup-engine-common/module.yaml +++ b/ksoup-engine-common/module.yaml @@ -1,6 +1,6 @@ product: type: lib - platforms: [jvm, js, wasm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64] + platforms: [jvm, js, wasm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64] apply: [ ../common.module-template.yaml ] diff --git a/ksoup-engine-kotlinx/module.yaml b/ksoup-engine-kotlinx/module.yaml index aac34660..e01e5297 100644 --- a/ksoup-engine-kotlinx/module.yaml +++ b/ksoup-engine-kotlinx/module.yaml @@ -1,6 +1,6 @@ product: type: lib - platforms: [ jvm, js, wasm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + platforms: [ jvm, js, wasm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] apply: [ ../common.module-template.yaml ] diff --git a/ksoup-engine-ktor2/module.yaml b/ksoup-engine-ktor2/module.yaml index d81e7a74..17f6befd 100644 --- a/ksoup-engine-ktor2/module.yaml +++ b/ksoup-engine-ktor2/module.yaml @@ -1,11 +1,11 @@ product: type: lib - platforms: [jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64] + platforms: [ jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] apply: [ ../common.module-template.yaml ] aliases: - - jvmAndAndroid: [jvm, android] + - jvmAndAndroid: [ jvm, android ] dependencies: - ../ksoup-engine-common diff --git a/ksoup-engine-lite/module.yaml b/ksoup-engine-lite/module.yaml index 38b368a6..58f6cb14 100644 --- a/ksoup-engine-lite/module.yaml +++ b/ksoup-engine-lite/module.yaml @@ -1,6 +1,6 @@ product: type: lib - platforms: [ jvm, js, wasm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + platforms: [ jvm, js, wasm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] apply: [ ../common.module-template.yaml ] diff --git a/ksoup-engine-okio/module.yaml b/ksoup-engine-okio/module.yaml index dcecaa51..dd8dcd90 100644 --- a/ksoup-engine-okio/module.yaml +++ b/ksoup-engine-okio/module.yaml @@ -1,12 +1,12 @@ product: type: lib - platforms: [ jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + platforms: [ jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] apply: [ ../common.module-template.yaml ] aliases: - jvmAndAndroid: [ jvm, android ] - - concurrent: [ jvm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + - concurrent: [ jvm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] dependencies: - ../ksoup-engine-common diff --git a/ksoup-network-korlibs/module.yaml b/ksoup-network-korlibs/module.yaml index 5b472d7b..2e67e28f 100644 --- a/ksoup-network-korlibs/module.yaml +++ b/ksoup-network-korlibs/module.yaml @@ -1,12 +1,12 @@ product: type: lib - platforms: [ jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + platforms: [ jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] apply: [ ../common.module-template.yaml ] aliases: - jvmAndAndroid: [ jvm, android ] - - concurrent: [ jvm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + - concurrent: [ jvm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] repositories: - mavenLocal diff --git a/ksoup-network-ktor2/module.yaml b/ksoup-network-ktor2/module.yaml index 02dc982e..65dbdac6 100644 --- a/ksoup-network-ktor2/module.yaml +++ b/ksoup-network-ktor2/module.yaml @@ -1,12 +1,12 @@ product: type: lib - platforms: [ jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + platforms: [ jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] apply: [ ../common.module-template.yaml ] aliases: - jvmAndAndroid: [ jvm, android ] - - concurrent: [ jvm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + - concurrent: [ jvm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] repositories: - mavenLocal diff --git a/ksoup-network/module.yaml b/ksoup-network/module.yaml index 7f4d9bd0..3d57e65d 100644 --- a/ksoup-network/module.yaml +++ b/ksoup-network/module.yaml @@ -1,12 +1,12 @@ product: type: lib - platforms: [ jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + platforms: [ wasm, jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] apply: [ ../common.module-template.yaml ] aliases: - jvmAndAndroid: [ jvm, android ] - - concurrent: [ jvm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + - concurrent: [ jvm, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] repositories: - mavenLocal @@ -32,4 +32,8 @@ dependencies@mingw: - $libs.ktor.client.win dependencies@linux: - - $libs.ktor.client.cio \ No newline at end of file + - $libs.ktor.client.cio + +test-dependencies: + - $libs.kotlinx.coroutines.test + - ../ksoup \ No newline at end of file diff --git a/ksoup-network/src/com/fleeksoft/ksoup/network/SourceExtNetwork.kt b/ksoup-network/src/com/fleeksoft/ksoup/network/SourceExtNetwork.kt index 1b63888b..fadfb705 100644 --- a/ksoup-network/src/com/fleeksoft/ksoup/network/SourceExtNetwork.kt +++ b/ksoup-network/src/com/fleeksoft/ksoup/network/SourceExtNetwork.kt @@ -7,4 +7,4 @@ import com.fleeksoft.ksoup.io.from import io.ktor.client.statement.* import io.ktor.utils.io.* -suspend fun HttpResponse.asSourceReader() = SourceReader.from(this.bodyAsChannel().readBuffer) \ No newline at end of file +suspend fun HttpResponse.asSourceReader() = SourceReader.from(this.bodyAsChannel().readBuffer()) \ No newline at end of file diff --git a/ksoup-test/module.yaml b/ksoup-test/module.yaml index 0da4a804..10c1daa1 100644 --- a/ksoup-test/module.yaml +++ b/ksoup-test/module.yaml @@ -1,6 +1,6 @@ product: type: lib - platforms: [ jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + platforms: [ jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] apply: [ ../common.module-template.yaml ] diff --git a/ksoup/module.yaml b/ksoup/module.yaml index 633380b1..86f10f53 100644 --- a/ksoup/module.yaml +++ b/ksoup/module.yaml @@ -1,6 +1,6 @@ product: type: lib - platforms: [ jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64 ] + platforms: [jvm, js, android, linuxX64, linuxArm64, tvosArm64, tvosX64, tvosSimulatorArm64, macosX64, macosArm64, iosArm64, iosSimulatorArm64, iosX64, mingwX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64 ] apply: [ ../common.module-template.yaml ] diff --git a/ksoup/src/com/fleeksoft/ksoup/internal/SoftPool.kt b/ksoup/src/com/fleeksoft/ksoup/internal/SoftPool.kt index 8e5927ec..37a53822 100644 --- a/ksoup/src/com/fleeksoft/ksoup/internal/SoftPool.kt +++ b/ksoup/src/com/fleeksoft/ksoup/internal/SoftPool.kt @@ -22,7 +22,7 @@ class SoftPool(private val initializer: () -> T) { fun borrow(): T { val stack: ArrayDeque = stack if (!stack.isEmpty()) { - return stack.removeFirst() + return stack.removeAt(0) } return initializer() } diff --git a/ksoup/src/com/fleeksoft/ksoup/nodes/Node.kt b/ksoup/src/com/fleeksoft/ksoup/nodes/Node.kt index dd572461..0bc3f9e7 100644 --- a/ksoup/src/com/fleeksoft/ksoup/nodes/Node.kt +++ b/ksoup/src/com/fleeksoft/ksoup/nodes/Node.kt @@ -827,7 +827,7 @@ public abstract class Node protected constructor() : KCloneable { val nodesToProcess: LinkedList = mutableListOf() nodesToProcess.add(thisClone) while (nodesToProcess.isNotEmpty()) { - val currParent: Node = nodesToProcess.removeFirst() + val currParent: Node = nodesToProcess.removeAt(0) val size = currParent.childNodeSize() for (i in 0 until size) { val childNodes = currParent.ensureChildNodes() diff --git a/ksoup/src/com/fleeksoft/ksoup/parser/StreamParser.kt b/ksoup/src/com/fleeksoft/ksoup/parser/StreamParser.kt index a2e9ebd2..9b9ffa80 100644 --- a/ksoup/src/com/fleeksoft/ksoup/parser/StreamParser.kt +++ b/ksoup/src/com/fleeksoft/ksoup/parser/StreamParser.kt @@ -324,14 +324,14 @@ class StreamParser(private val parser: Parser) { // drain the current queue before stepping to get more if (!emitQueue.isEmpty()) { - next = emitQueue.removeFirst() + next = emitQueue.removeAt(0) return } // step the parser, which will hit the node listeners to add to the queue: while (treeBuilder.stepParser()) { if (!emitQueue.isEmpty()) { - next = emitQueue.removeFirst() + next = emitQueue.removeAt(0) return } }