Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.2.1 #100

Merged
merged 69 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
fb98a0d
Restructure and relocate exception classes
itboy87 Oct 24, 2024
74fc75d
refactored exception import
itboy87 Oct 24, 2024
6fab081
Refactor charset and use com.fleeksoft.charset
itboy87 Oct 24, 2024
225c0e1
Migrated StreamDecoder to an expect/actual
itboy87 Oct 24, 2024
45e99d3
Simplify resource reading in test cases.
itboy87 Oct 24, 2024
89ca0af
minor tweaks and code cleanup
itboy87 Oct 24, 2024
ef2e650
add wasm target and nonJvm
itboy87 Oct 24, 2024
cde1c8d
add fleeksoft-charset dep
itboy87 Oct 24, 2024
0f9f3cc
replace IO classes with com.fleeksoft.io
itboy87 Oct 24, 2024
1fffd8d
Deprecate SourceReader and replace with com.fleeksoft.io.InputStream
itboy87 Oct 24, 2024
561ea4a
add wasm targets
itboy87 Oct 24, 2024
5c1d09d
use fleeksoft.io for exception
itboy87 Nov 1, 2024
f66c6e3
minor tweak and clean code
itboy87 Nov 1, 2024
4b19365
use fleeksoft.charset
itboy87 Nov 1, 2024
9333f44
implement ControllableInputStream
itboy87 Nov 1, 2024
dfcf0c1
Remove WASM support and clean up dependencies
itboy87 Nov 1, 2024
dfc4772
Remove ktor.io dep
itboy87 Nov 1, 2024
a9fa840
clean up code
itboy87 Nov 1, 2024
82405b1
rename test method name from `testParseMetaDataFromSourceReader` to `…
itboy87 Nov 1, 2024
c854ed9
Simplified the testXwiki method by delegating resource parsing to the…
itboy87 Nov 1, 2024
30b6dd8
update parseMetaData to allow charset and replace StreamParser
itboy87 Nov 2, 2024
9a153ac
Update AGP version to 8.7.2
itboy87 Nov 2, 2024
17a1a03
Add .fleet to .gitignore
itboy87 Nov 5, 2024
6ab0ec3
Add mavenLocal repository to build script
itboy87 Nov 5, 2024
2074c8f
Renamed fleeksoft-kotlinx-io to fleeksoft-io-kotlinx for consistency.…
itboy87 Nov 5, 2024
bcfdf5e
Remove libBuildType conditional logic for library dependencies
itboy87 Nov 5, 2024
669ee61
add wasm and various watchOS architectures
itboy87 Nov 5, 2024
90cc240
remove KsoupEngine and code cleanup
itboy87 Nov 5, 2024
c9598b7
Add ksoup-io to move all core IO functionalities.
itboy87 Nov 5, 2024
03f5433
refactor ksoup-engine-kotlinx to ksoup-kotlinx
itboy87 Nov 5, 2024
cd24cdd
clean up io code from core
itboy87 Nov 5, 2024
587b09c
Remove FileSource files
itboy87 Nov 5, 2024
56c1134
Refactor project structure and file dependencies
itboy87 Nov 5, 2024
146e47a
Remove obsolete comments
itboy87 Nov 5, 2024
1bda23a
Increase Mocha test timeout to 12 seconds
itboy87 Nov 5, 2024
04021b2
enable amper and disable gradle
itboy87 Nov 5, 2024
9bbbc15
Add mavenLocal repository to module configurations
itboy87 Nov 5, 2024
3bd0318
Update Kotlin api and language version to 2.0
itboy87 Nov 5, 2024
0f95d13
merge ksoup-common module into ksoup
itboy87 Nov 5, 2024
24b143f
Remove unused import and reformat code
itboy87 Nov 5, 2024
9da9281
Add watchOS simulator target to concurrent alias
itboy87 Nov 5, 2024
d9d57ab
Modified test workflow tasks to use 'wasmTest' instead of 'wasmJsTest'
itboy87 Nov 5, 2024
65ab414
Enable ksoup-test and ksoup-benchmark modules
itboy87 Nov 5, 2024
6a652ca
update scripts
itboy87 Nov 29, 2024
d98d59d
update tests
itboy87 Nov 29, 2024
27689da
disable amper
itboy87 Nov 29, 2024
4cff725
update buildType
itboy87 Nov 29, 2024
e37d96f
rename ksoup-lite to ksoup
itboy87 Nov 29, 2024
1f190ac
clean up
itboy87 Nov 29, 2024
dec3c5b
add fleeksoft.io dep
itboy87 Nov 29, 2024
a31e528
remove ksoup.Charsets and use fleeksoft.io.Charsets
itboy87 Nov 29, 2024
a5fd3a4
rename lite with core
itboy87 Nov 29, 2024
dd50038
bump kotlin: 2.1.0, ktor2: 2.3.13, kotlinx-io: 0.6.0
itboy87 Nov 29, 2024
c61aee3
increase test js timeout
itboy87 Nov 30, 2024
a42c99a
update with jsoup 1.18.2
itboy87 Nov 30, 2024
dcbc5d9
update jsoup and fleeksoft-io version
itboy87 Nov 30, 2024
37ddace
update fleeksoft-io dep
itboy87 Nov 30, 2024
f67120c
add fleeksoft-io-core
itboy87 Nov 30, 2024
a442538
add ksoup maven dep for testin
itboy87 Nov 30, 2024
c5641a9
cleanup
itboy87 Nov 30, 2024
9b505e1
add jsTest
itboy87 Nov 30, 2024
d5eaa6d
remove performance file
itboy87 Nov 30, 2024
3a62f3e
update release 0.2.1
itboy87 Nov 30, 2024
4e17a4d
bump library version to 0.2.1
itboy87 Nov 30, 2024
9a0542d
fix abs path for test resource
itboy87 Nov 30, 2024
632427a
update doc for charsets
itboy87 Nov 30, 2024
868f855
remove ktor2 from test and deploy
itboy87 Nov 30, 2024
54ed035
update benchmark
itboy87 Nov 30, 2024
f1efddd
temporary disable extended charset for issue KT-72429
itboy87 Nov 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ jobs:
strategy:
matrix:
buildType:
- "common"
- "lite"
- "core"
- "kotlinx"
- "korlibs"
- "ktor2"
- "okio"
runs-on: macos-latest
name: Publish ${{ matrix.buildType }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
{ target: windows, os: windows-latest, tasks: mingwX64Test, continueOnError: false },
{ target: linux, os: ubuntu-latest, tasks: linuxX64Test, continueOnError: false },
]
libBuildType: [ "lite", "korlibs", "kotlinx", "okio", "ktor2" ]
libBuildType: [ "core", "korlibs", "kotlinx", "okio" ]
runs-on: ${{ matrix.config.os }}
name: Build ${{ matrix.config.target }} with libBuildType=${{ matrix.libBuildType }}
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ xcuserdata
/gpg/
/kotlin-js-store/
.kotlin
.fleet
39 changes: 12 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Ksoup** is a Kotlin Multiplatform library for working with real-world HTML and XML. It's a port of the renowned Java library, **jsoup**, and offers an easy-to-use API for URL fetching, data parsing, extraction, and manipulation using DOM and CSS selectors.

[![Kotlin](https://img.shields.io/badge/Kotlin-2.0.20-blue.svg?style=flat&logo=kotlin)](https://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/Kotlin-2.0.21-blue.svg?style=flat&logo=kotlin)](https://kotlinlang.org)
[![Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.fleeksoft.ksoup/ksoup.svg)](https://central.sonatype.com/artifact/com.fleeksoft.ksoup/ksoup)

Expand Down Expand Up @@ -32,20 +32,20 @@ Ksoup is adept at handling all varieties of HTML found in the wild.
Include the dependency in `commonMain`. Latest version [![Maven Central](https://img.shields.io/maven-central/v/com.fleeksoft.ksoup/ksoup.svg)](https://central.sonatype.com/artifact/com.fleeksoft.ksoup/ksoup)

Ksoup published in four variants. Pick the one that suits your needs and start building!
1. **This variant is built without any external IO or Network dependencies. Use this if you want to parse HTML from a string.**
1. **Lightweight variant: Use this if you only need to parse HTML from a string.**
```kotlin
implementation("com.fleeksoft.ksoup:ksoup-lite:<version>")
implementation("com.fleeksoft.ksoup:ksoup:<version>")
```
2. **This variant built with [kotlinx-io](https://github.com/Kotlin/kotlinx-io) and [Ktor 3](https://github.com/ktorio/ktor)**
2. **This variant use [kotlinx-io](https://github.com/Kotlin/kotlinx-io) for I/O and [Ktor 3](https://github.com/ktorio/ktor) for networking**
```kotlin
implementation("com.fleeksoft.ksoup:ksoup:<version>")
implementation("com.fleeksoft.ksoup:ksoup-kotlinx:<version>")

// Optional: Include only if you need to use network request functions such as
// Ksoup.parseGetRequest, Ksoup.parseSubmitRequest, and Ksoup.parsePostRequest
implementation("com.fleeksoft.ksoup:ksoup-network:<version>")
```

3. **This variant is built with [korlibs-io](https://github.com/korlibs/korlibs-io)**
3. **This variant use [korlibs-io](https://github.com/korlibs/korlibs-io) for I/O and networking**
```kotlin
implementation("com.fleeksoft.ksoup:ksoup-korlibs:<version>")

Expand All @@ -54,15 +54,15 @@ Ksoup published in four variants. Pick the one that suits your needs and start b
implementation("com.fleeksoft.ksoup:ksoup-network-korlibs:<version>")
```

4. **This variant built with [kotlinx-io](https://github.com/Kotlin/kotlinx-io) and [Ktor 2](https://github.com/ktorio/ktor)**
4. **This variant use [kotlinx-io](https://github.com/Kotlin/kotlinx-io) for I/O and [Ktor 2](https://github.com/ktorio/ktor) for networking**
```kotlin
implementation("com.fleeksoft.ksoup:ksoup-ktor2:<version>")

// Optional: Include only if you need to use network request functions such as
// Ksoup.parseGetRequest, Ksoup.parseSubmitRequest, and Ksoup.parsePostRequest
implementation("com.fleeksoft.ksoup:ksoup-network-ktor2:<version>")
```
5. **This variant built with [okio](https://github.com/square/okio) and [Ktor 2](https://github.com/ktorio/ktor)**
5. **This variant use [okio](https://github.com/square/okio) for I/O and [Ktor 2](https://github.com/ktorio/ktor) for networking**
```kotlin
implementation("com.fleeksoft.ksoup:ksoup-okio:<version>")

Expand All @@ -71,8 +71,8 @@ Ksoup published in four variants. Pick the one that suits your needs and start b
implementation("com.fleeksoft.ksoup:ksoup-network-ktor2:<version>")
```

**NOTE:** Variants built with kotlinx do not support gzip files.

#### Ksoup supports [Charsets](https://github.com/fleeksoft/fleeksoft-io/blob/main/CharsetsReadme.md)
- Standard charsets are already supported by **Ksoup IO**, but for extended charsets, plesae add `com.fleeksoft.charset:charset-ext`, For more details, visit the [Charsets Documentation](https://github.com/fleeksoft/fleeksoft-io/blob/main/CharsetsReadme.md)

### Parsing HTML from a String with Ksoup
For API documentation you can check [Jsoup](https://jsoup.org/). Most of the APIs work without any changes.
Expand Down Expand Up @@ -139,10 +139,8 @@ In this example, `Ksoup.parseGetRequest` fetches and parses HTML content from Wi

#### For further documentation, please check here: [Jsoup](https://jsoup.org/)

### Ksoup vs. Jsoup Performance: Parsing & Selecting 448KB HTML File [test.tx](https://github.com/fleeksoft/ksoup/blob/develop/ksoup-test/testResources/test.txt)
![Ksoup vs Jsoup](performance1.png)

![Ksoup vs Jsoup](performance.png)
### Ksoup vs. Jsoup Benchmarks: Parsing & Selecting 448KB HTML File [test.tx](https://github.com/fleeksoft/ksoup/blob/develop/ksoup-test/testResources/test.txt)
![Ksoup vs Jsoup](benchmark1.png)

## Open source
Ksoup is an open source project, a Kotlin Multiplatform port of jsoup, distributed under the Apache License, Version 2.0. The source code of Ksoup is available on [GitHub](https://github.com/fleeksoft/ksoup).
Expand All @@ -155,19 +153,6 @@ If you wish to contribute, please read the [Contributing Guidelines](CONTRIBUTIN

To report any issues, visit our [GitHub issues](https://github.com/fleeksoft/ksoup/issues), Please ensure to check for duplicates before submitting a new issue.

## Library Status

| Platform | Status | Notes |
|----------------|--------------|--------------------------|
| Android | Stable | |
| JVM | Stable | |
| iOS | Stable | |
| JS | Alpha | |
| WasmJs | Alpha | not supported with ktor2 |
| Native MacOS | Alpha | |
| Linux | Experimental | |
| Native Windows | Experimental | |



## License
Expand Down
Binary file added benchmark1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ allprojects {
mavenCentral()
google()
gradlePluginPortal()
mavenLocal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
}
version = REAL_VERSION
group = GROUP
Expand Down Expand Up @@ -249,14 +251,14 @@ class MicroAmper(val project: Project) {
browser {
testTask {
useMocha {
timeout = "9s"
timeout = "15s"
}
}
}
nodejs {
testTask {
useMocha {
timeout = "9s"
timeout = "15s"
}
}
}
Expand All @@ -267,14 +269,14 @@ class MicroAmper(val project: Project) {
browser {
testTask {
useMocha {
timeout = "9s"
timeout = "15s"
}
}
}
nodejs {
testTask {
useMocha {
timeout = "9s"
timeout = "15s"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions common.module-template.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
settings:
kotlin:
apiVersion: 1.9
languageVersion: 1.9
apiVersion: 2.0
languageVersion: 2.0
jvm:
release: 17
android:
Expand Down
8 changes: 2 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ android.nonTransitiveRClass=true
kotlin.native.ignoreIncorrectDependencies=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.applyDefaultHierarchyTemplate=false
# dev, common, lite, kotlinx, korlibs, okio, ktor2
# dev will include all modules in settings.gradle.kts but use kotlinx dep for engine
libBuildType=lite


SONATYPE_HOST=CENTRAL_PORTAL
RELEASE_SIGNING_ENABLED=true
# core, kotlinx, korlibs, okio, ktor2
libBuildType=core
19 changes: 13 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[versions]
agp = "8.7.1"
kotlin = "2.0.21"
agp = "8.7.2"
kotlin = "2.1.0"
compileSdk = "35"
minSdk = "21"
libraryVersion = "0.2.0"
libraryVersion = "0.2.1"
ktor = "3.0.1"
ktor2 = "2.3.12"
ktor2 = "2.3.13"
coroutines = "1.9.0"
kotlinxDatetime = "0.6.1"
kotlinx-io = "0.5.4"
kotlinx-io = "0.6.0"
okio = "3.9.1"
dokka = "1.9.20"
kotlinx-benchmark = "0.4.12"
Expand All @@ -18,7 +18,8 @@ korlibs = "6.0.1"
mavenPublish = "0.30.0"

stately = "2.1.0"
jsoup = "1.18.1"
jsoup = "1.18.2"
fleeksoft-io = "0.0.2"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
Expand Down Expand Up @@ -50,6 +51,12 @@ jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }
okio = { module = "com.squareup.okio:okio", version.ref = "okio" }
okio-nodefilesystem = { module = "com.squareup.okio:okio-nodefilesystem", version.ref = "okio" }
kotlinx-benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime", version.ref = "kotlinx-benchmark" }
fleeksoft-io-core = { module = "com.fleeksoft.io:io-core", version.ref = "fleeksoft-io" }
fleeksoft-io = { module = "com.fleeksoft.io:io", version.ref = "fleeksoft-io" }
fleeksoft-io-kotlinx = { module = "com.fleeksoft.io:kotlinx-io", version.ref = "fleeksoft-io" }
fleeksoft-io-okio = { module = "com.fleeksoft.io:okio", version.ref = "fleeksoft-io" }
fleeksoft-charset = { module = "com.fleeksoft.charset:charset", version.ref = "fleeksoft-io" }
fleeksoft-charset-ext = { module = "com.fleeksoft.charset:charset-ext", version.ref = "fleeksoft-io" }

[plugins]
androidLibrary = { id = "com.android.library", version.ref = "agp" }
Expand Down
1 change: 0 additions & 1 deletion ksoup-benchmark/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ repositories:
dependencies:
- $libs.kotlinx.io
- $libs.kotlinx.benchmark.runtime
# - com.fleeksoft.ksoup:ksoup-lite:0.1.8
- ../ksoup

dependencies@jvm:
Expand Down
8 changes: 0 additions & 8 deletions ksoup-engine-common/module.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions ksoup-engine-common/src/com/fleeksoft/ksoup/engine/KsoupEngine.kt

This file was deleted.

This file was deleted.

27 changes: 0 additions & 27 deletions ksoup-engine-common/src/com/fleeksoft/ksoup/io/Charset.kt

This file was deleted.

9 changes: 0 additions & 9 deletions ksoup-engine-common/src/com/fleeksoft/ksoup/io/FileSource.kt

This file was deleted.

Loading
Loading