Skip to content

Commit 89d267f

Browse files
Library updates & deprecation fixes (#128)
1 parent 54669eb commit 89d267f

File tree

231 files changed

+219
-162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+219
-162
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
uses: actions/setup-java@v4
2525
with:
2626
distribution: 'temurin'
27-
java-version: '17.0.15+6'
28-
- name: Select XCode 16.3
27+
java-version: '17.0.16+8'
28+
- name: Select XCode 16.4
2929
run: |
30-
sudo xcode-select -s /Applications/Xcode_16.3.app/Contents/Developer
30+
sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
3131
xcodebuild -version
3232
- name: Gradle Cache
3333
uses: actions/cache@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ of Ashampoo Photo Organizer, which, in turn, is driven by user community feedbac
3939
## Installation
4040

4141
```
42-
implementation("com.ashampoo:kim:0.25")
42+
implementation("com.ashampoo:kim:0.26")
4343
```
4444

4545
For the targets `wasmJs` & `js` you also need to specify this:

build.gradle.kts

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
44
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
55

66
plugins {
7-
kotlin("multiplatform") version "2.2.0"
8-
id("com.android.library") version "8.9.3"
7+
alias(libs.plugins.kotlin.multiplatform)
8+
alias(libs.plugins.android.library)
99
id("signing")
10-
id("io.gitlab.arturbosch.detekt") version "1.23.8"
11-
id("org.jetbrains.kotlinx.kover") version "0.9.1"
12-
id("com.asarkar.gradle.build-time-tracker") version "5.0.1"
13-
id("me.qoomon.git-versioning") version "6.4.4"
14-
id("com.goncalossilva.resources") version "0.10.0"
15-
id("com.github.ben-manes.versions") version "0.52.0"
16-
id("com.vanniktech.maven.publish") version "0.34.0"
10+
alias(libs.plugins.detekt)
11+
alias(libs.plugins.kover)
12+
alias(libs.plugins.build.time.tracker)
13+
alias(libs.plugins.git.versioning)
14+
alias(libs.plugins.resources)
15+
alias(libs.plugins.versions)
16+
alias(libs.plugins.maven.publish)
1717
}
1818

1919
repositories {
@@ -23,11 +23,6 @@ repositories {
2323

2424
val productName: String = "Ashampoo Kim"
2525

26-
val ktorVersion: String = "3.2.1"
27-
val xmpCoreVersion: String = "1.5.2"
28-
val dateTimeVersion: String = "0.7.1"
29-
val kotlinxIoVersion: String = "0.8.0"
30-
3126
description = productName
3227
group = "com.ashampoo"
3328
version = "0.0.0"
@@ -70,7 +65,7 @@ kover {
7065
}
7166

7267
dependencies {
73-
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.8")
68+
detektPlugins(libs.detekt.formatting)
7469
}
7570

7671
kotlin {
@@ -142,10 +137,10 @@ kotlin {
142137
dependencies {
143138

144139
/* Date handling */
145-
implementation("org.jetbrains.kotlinx:kotlinx-datetime:$dateTimeVersion")
140+
implementation(libs.kotlinx.datetime)
146141

147142
/* XMP handling */
148-
api("com.ashampoo:xmpcore:$xmpCoreVersion")
143+
api(libs.xmpcore)
149144
}
150145
}
151146

@@ -156,7 +151,7 @@ kotlin {
156151
/* Kotlin Test */
157152
implementation(kotlin("test"))
158153

159-
implementation("org.jetbrains.kotlinx:kotlinx-io-core:$kotlinxIoVersion")
154+
implementation(libs.kotlinx.io.core)
160155
}
161156
}
162157

@@ -202,14 +197,14 @@ kotlin {
202197
*
203198
* Not available in commonMain due to missing WASM support.
204199
*/
205-
api("io.ktor:ktor-io:$ktorVersion")
200+
api(libs.ktor.io)
206201

207202
/*
208203
* Multiplatform file access
209204
*
210205
* Not available in commonMain due to missing JS browser support.
211206
*/
212-
api("org.jetbrains.kotlinx:kotlinx-io-core:$kotlinxIoVersion")
207+
api(libs.kotlinx.io.core)
213208
}
214209
}
215210

@@ -309,9 +304,9 @@ kotlin {
309304

310305
dependencies {
311306

312-
implementation("org.jetbrains.kotlinx:kotlinx-browser:0.3")
307+
implementation(libs.kotlinx.browser)
313308

314-
implementation(npm("pako", "2.1.0"))
309+
implementation(npm("pako", libs.versions.pako.get()))
315310
}
316311
}
317312
}
@@ -331,13 +326,13 @@ android {
331326

332327
namespace = "com.ashampoo.kim"
333328

334-
// For API 35 tests fail. Something seems incompatible.
335-
compileSdk = 34
329+
compileSdk = libs.versions.android.compile.sdk.get().toInt()
330+
buildToolsVersion = libs.versions.android.build.tools.get()
336331

337332
sourceSets["main"].res.srcDirs("src/commonMain/resources")
338333

339334
defaultConfig {
340-
minSdk = 21
335+
minSdk = libs.versions.android.min.sdk.get().toInt()
341336
}
342337

343338
compileOptions {
@@ -375,7 +370,7 @@ mavenPublishing {
375370

376371
name = productName
377372
description = "Kotlin Multiplatform library for image metadata manipulation"
378-
url = "https://github.com/Ashampoo/kim"
373+
url = "https://github.com/Software-Rangers/kim"
379374

380375
licenses {
381376
license {
@@ -384,16 +379,25 @@ mavenPublishing {
384379
}
385380
}
386381

382+
organization {
383+
name = "Software Rangers GmbH"
384+
url = "https://software-rangers.com/"
385+
}
386+
387387
developers {
388388
developer {
389-
name = "Ashampoo GmbH & Co. KG"
390-
url = "https://www.ashampoo.com/"
389+
name = "Stefan Oltmann"
390+
url = "https://stefan-oltmann.de/"
391+
organization = "Software Rangers GmbH"
392+
organizationUrl = "https://software-rangers.com/"
393+
roles = listOf("maintainer", "developer")
394+
properties = mapOf("github" to "StefanOltmann")
391395
}
392396
}
393397

394398
scm {
395-
url = "https://github.com/Ashampoo/kim"
396-
connection = "scm:git:git://github.com/Ashampoo/kim.git"
399+
url = "https://github.com/Software-Rangers/kim"
400+
connection = "scm:git:git://github.com/Software-Rangers/kim.git"
397401
}
398402
}
399403
}

gradle/libs.versions.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[versions]
2+
kotlin = "2.2.0"
3+
android-gradle = "8.9.3"
4+
android-compile-sdk = "36"
5+
android-build-tools = "36.0.0"
6+
android-min-sdk = "21"
7+
detekt = "1.23.8"
8+
kover = "0.9.1"
9+
build-time-tracker = "5.0.1"
10+
git-versioning = "6.4.4"
11+
resources = "0.10.1"
12+
versions-plugin = "0.52.0"
13+
maven-publish = "0.34.0"
14+
15+
ktor = "3.2.2"
16+
xmpcore = "1.6.0"
17+
kotlinx-datetime = "0.7.1"
18+
kotlinx-io = "0.8.0"
19+
kotlinx-browser = "0.3"
20+
pako = "2.1.0"
21+
22+
[libraries]
23+
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
24+
xmpcore = { module = "com.ashampoo:xmpcore", version.ref = "xmpcore" }
25+
kotlinx-io-core = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version.ref = "kotlinx-io" }
26+
ktor-io = { module = "io.ktor:ktor-io", version.ref = "ktor" }
27+
kotlinx-browser = { module = "org.jetbrains.kotlinx:kotlinx-browser", version.ref = "kotlinx-browser" }
28+
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
29+
30+
[plugins]
31+
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
32+
android-library = { id = "com.android.library", version.ref = "android-gradle" }
33+
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
34+
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
35+
build-time-tracker = { id = "com.asarkar.gradle.build-time-tracker", version.ref = "build-time-tracker" }
36+
git-versioning = { id = "me.qoomon.git-versioning", version.ref = "git-versioning" }
37+
resources = { id = "com.goncalossilva.resources", version.ref = "resources" }
38+
versions = { id = "com.github.ben-manes.versions", version.ref = "versions-plugin" }
39+
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }

src/commonMain/kotlin/com/ashampoo/kim/common/LocalDateTimeExtensions.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
package com.ashampoo.kim.common
1717

1818
import kotlinx.datetime.LocalDateTime
19+
import kotlinx.datetime.number
1920

2021
private const val YEAR_LENGTH = 4
2122

2223
internal fun LocalDateTime.toExifDateString(): String {
2324

2425
return year.toString().padStart(YEAR_LENGTH, '0') + ":" +
25-
monthNumber.toString().padStart(2, '0') + ":" +
26-
dayOfMonth.toString().padStart(2, '0') + " " +
26+
month.number.toString().padStart(2, '0') + ":" +
27+
day.toString().padStart(2, '0') + " " +
2728
hour.toString().padStart(2, '0') + ":" +
2829
minute.toString().padStart(2, '0') + ":" +
2930
second.toString().padStart(2, '0')

src/commonMain/kotlin/com/ashampoo/kim/format/tiff/write/TiffWriterLossless.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,11 @@ public class TiffWriterLossless(
248248

249249
while (unplacedItems.isNotEmpty()) {
250250

251-
/* Pop off largest unplaced item. */
252-
val outputItem = unplacedItems.removeFirst()
251+
/*
252+
* Pop off largest unplaced item.
253+
* Note: Don't use removeFirst() for Android compatibility here.
254+
*/
255+
val outputItem = unplacedItems.removeAt(0)
253256

254257
val outputItemLength = outputItem.getItemLength()
255258

@@ -336,7 +339,10 @@ public class TiffWriterLossless(
336339

337340
newExifBytesLength -= lastRange.length
338341

339-
filteredRewritableSpaceRanges.removeLast()
342+
/*
343+
* Note: Don't use removeLast() here due to Android incompatibility.
344+
*/
345+
filteredRewritableSpaceRanges.removeAt(filteredRewritableSpaceRanges.size - 1)
340346
}
341347

342348
return filteredRewritableSpaceRanges to newExifBytesLength

src/commonMain/kotlin/com/ashampoo/kim/input/PrePendingByteReader.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal class PrePendingByteReader(
3232
override fun readByte(): Byte? {
3333

3434
if (prependedBytesBuffer.isNotEmpty())
35-
return prependedBytesBuffer.removeFirst()
35+
return prependedBytesBuffer.removeAt(0)
3636

3737
return delegate.readByte()
3838
}
@@ -48,7 +48,7 @@ internal class PrePendingByteReader(
4848
/* Read prepended bytes first */
4949
while (bytesRead < count && prependedBytesBuffer.isNotEmpty()) {
5050

51-
bytes[bytesRead] = prependedBytesBuffer.removeFirst()
51+
bytes[bytesRead] = prependedBytesBuffer.removeAt(0)
5252

5353
bytesRead++
5454
}

src/commonTest/resources/com/ashampoo/kim/testdata/xmp/acdsee_sample_mod.xmp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
2-
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
2+
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
33
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
44
<rdf:Description rdf:about=""
55
xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/"

src/commonTest/resources/com/ashampoo/kim/testdata/xmp/digikam_sample_mod.xmp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
2-
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
2+
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
33
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
44
<rdf:Description rdf:about=""
55
xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"

src/commonTest/resources/com/ashampoo/kim/testdata/xmp/exiftool_sample_mod.xmp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
2-
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.5.2">
2+
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Ashampoo XMP Core 1.6.0">
33
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
44
<rdf:Description rdf:about=""
55
xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/"

0 commit comments

Comments
 (0)