Compare commits
9 Commits
v124113301
...
0f0ded2b74
Author | SHA1 | Date | |
---|---|---|---|
|
0f0ded2b74 | ||
|
aad93ef722 | ||
9e83af0302 | |||
|
24b86e66b4 | ||
641c444061 | |||
0902c61544 | |||
|
6790152a0b | ||
|
46d1ba418e | ||
436373d0ad |
9
.gitea/workflows/assets/docker-compose.yml
Normal file
9
.gitea/workflows/assets/docker-compose.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
selfoss:
|
||||||
|
container_name: selfoss
|
||||||
|
image: rsprta/selfoss
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "8888:8888"
|
||||||
|
|
@@ -35,6 +35,11 @@ jobs:
|
|||||||
|
|
||||||
$(cat CHANGELOG.md)" > CHANGELOG.md
|
$(cat CHANGELOG.md)" > CHANGELOG.md
|
||||||
git add CHANGELOG.md
|
git add CHANGELOG.md
|
||||||
|
touch ./fastlane/metadata/android/en\-US/changelogs/$VER.txt
|
||||||
|
echo "**$VER**
|
||||||
|
|
||||||
|
$CHANGELOG" > ./fastlane/metadata/android/en\-US/changelogs/$VER.txt
|
||||||
|
git add ./fastlane/metadata/android/en\-US/changelogs/$VER.txt
|
||||||
git commit -m "Changelog for $VER"
|
git commit -m "Changelog for $VER"
|
||||||
- name: Push changes
|
- name: Push changes
|
||||||
uses: appleboy/git-push-action@v1.0.0
|
uses: appleboy/git-push-action@v1.0.0
|
||||||
@@ -107,6 +112,7 @@ jobs:
|
|||||||
files: signed.apk
|
files: signed.apk
|
||||||
token: ${{ secrets.API_KEY }}
|
token: ${{ secrets.API_KEY }}
|
||||||
tag_name: ${{ steps.version.outputs.VERSION }}
|
tag_name: ${{ steps.version.outputs.VERSION }}
|
||||||
|
name: ${{ steps.version.outputs.VERSION }}
|
||||||
- name: Send mail
|
- name: Send mail
|
||||||
uses: https://github.com/dawidd6/action-send-mail@v4
|
uses: https://github.com/dawidd6/action-send-mail@v4
|
||||||
with:
|
with:
|
||||||
@@ -116,5 +122,5 @@ jobs:
|
|||||||
subject: Mapping file
|
subject: Mapping file
|
||||||
priority: high
|
priority: high
|
||||||
convert_markdown: true
|
convert_markdown: true
|
||||||
body: Nouveau fichier de mapping
|
body: Nouveau fichier de mapping pour la version ${{ steps.version.outputs.VERSION }}
|
||||||
attachments: androidApp/build/outputs/mapping/githubConfigRelease/mapping.txt
|
attachments: androidApp/build/outputs/mapping/githubConfigRelease/mapping.txt
|
36
.gitea/workflows/on_push_testing.yml
Normal file
36
.gitea/workflows/on_push_testing.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: Check master code
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- testing
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checkout:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
# - name: Fetch tags
|
||||||
|
# run: git fetch --tags -p
|
||||||
|
# - uses: actions/setup-java@v4
|
||||||
|
# with:
|
||||||
|
# distribution: 'temurin'
|
||||||
|
# java-version: '17'
|
||||||
|
# - name: Setup Android SDK
|
||||||
|
# uses: android-actions/setup-android@v3
|
||||||
|
# - name: Configure gradle...
|
||||||
|
# run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true\nsystemProp.org.gradle.internal.http.connectionTimeout=180000\nsystemProp.org.gradle.internal.http.socketTimeout=180000" >> ~/.gradle/gradle.properties
|
||||||
|
- name: Init compose
|
||||||
|
uses: KengoTODA/actions-setup-docker-compose@v1
|
||||||
|
with:
|
||||||
|
version: "2.23.3"
|
||||||
|
- name: run selfoss
|
||||||
|
run: |
|
||||||
|
pwd
|
||||||
|
docker-compose up -d -f .gitea/workflows/assets/docker-compose.yml
|
||||||
|
sleep 2m
|
||||||
|
wget -O- http://localhost:8888
|
||||||
|
# - name: Build and test
|
||||||
|
# run: ./gradlew build --stacktrace
|
25
CHANGELOG.md
25
CHANGELOG.md
@@ -1,3 +1,28 @@
|
|||||||
|
**v124123421
|
||||||
|
|
||||||
|
- fix: Trying to fix the serialization issue.
|
||||||
|
- Changelog for v124113311
|
||||||
|
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
|
**v124113311
|
||||||
|
|
||||||
|
- chore: update versions. (#165)
|
||||||
|
- chore: fastlane changelog.
|
||||||
|
- chore: fastlane fixes.
|
||||||
|
- Changelog for v124113301
|
||||||
|
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
|
**v124113301**
|
||||||
|
|
||||||
|
- chore: Gitea Action
|
||||||
|
- Merge pull request 'chore: Gitea Action' (#164) from runner into master
|
||||||
|
- chore: Gitea Action
|
||||||
|
- chore: Readme update.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
**v124041081**
|
**v124041081**
|
||||||
|
|
||||||
- chore: comment.
|
- chore: comment.
|
||||||
|
@@ -7,10 +7,10 @@ buildscript {
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
//trick: for the same plugin versions in all sub-modules
|
//trick: for the same plugin versions in all sub-modules
|
||||||
id("com.android.application").version("8.1.2").apply(false)
|
id("com.android.application").version("8.7.3").apply(false)
|
||||||
id("com.android.library").version("8.1.2").apply(false)
|
id("com.android.library").version("8.7.3").apply(false)
|
||||||
id("org.jetbrains.kotlin.android").version("1.9.10").apply(false)
|
id("org.jetbrains.kotlin.android").version("2.1.0").apply(false)
|
||||||
kotlin("multiplatform").version("1.9.10").apply(false)
|
kotlin("multiplatform").version("2.1.0").apply(false)
|
||||||
id("com.mikepenz.aboutlibraries.plugin").version("10.5.1").apply(false)
|
id("com.mikepenz.aboutlibraries.plugin").version("10.5.1").apply(false)
|
||||||
id("org.jetbrains.kotlinx.kover").version("0.6.1").apply(true)
|
id("org.jetbrains.kotlinx.kover").version("0.6.1").apply(true)
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ allprojects {
|
|||||||
|
|
||||||
|
|
||||||
tasks.register("clean", Delete::class) {
|
tasks.register("clean", Delete::class) {
|
||||||
delete(rootProject.buildDir)
|
delete(layout.buildDirectory)
|
||||||
}
|
}
|
||||||
|
|
||||||
koverMerged {
|
koverMerged {
|
||||||
|
0
fastlane/metadata/android/en-US/changelogs/.gitkeep
Normal file
0
fastlane/metadata/android/en-US/changelogs/.gitkeep
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
**v124113311**
|
||||||
|
|
||||||
|
- chore: update versions. (#165)
|
||||||
|
- chore: fastlane changelog.
|
||||||
|
- chore: fastlane fixes.
|
||||||
|
- Changelog for v124113301
|
@@ -0,0 +1,4 @@
|
|||||||
|
**v124123421**
|
||||||
|
|
||||||
|
- fix: Trying to fix the serialization issue.
|
||||||
|
- Changelog for v124113311
|
BIN
fastlane/metadata/android/en-US/images/icon.png
Normal file
BIN
fastlane/metadata/android/en-US/images/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 294 KiB |
@@ -1 +1 @@
|
|||||||
A new RSS reader for <a href="http://selfoss.aditu.de/">selfoss</a>.
|
A new RSS reader for selfoss (http://selfoss.aditu.de/)
|
||||||
|
@@ -18,7 +18,6 @@ kotlin.code.style=official
|
|||||||
#Android
|
#Android
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
#android.nonTransitiveRClass=true
|
#android.nonTransitiveRClass=true
|
||||||
android.enableJetifier=true
|
|
||||||
android.nonTransitiveRClass=false
|
android.nonTransitiveRClass=false
|
||||||
#MPP
|
#MPP
|
||||||
kotlin.mpp.enableCInteropCommonization=true
|
kotlin.mpp.enableCInteropCommonization=true
|
||||||
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
#Thu Jul 13 11:41:19 CEST 2023
|
#Mon Nov 25 22:48:24 CET 2024
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@@ -173,7 +173,7 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "cd \"$SRCROOT/..\"\n./gradlew :shared:embedAndSignAppleFrameworkForXcode\n";
|
shellScript = "export JAVA_HOME=/Users/amine/.sdkman/candidates/java/17.0.8.1-jbr\ncd \"$SRCROOT/..\"\n./gradlew :shared:embedAndSignAppleFrameworkForXcode --stacktrace\n";
|
||||||
};
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
@@ -52,6 +52,9 @@ kotlin {
|
|||||||
|
|
||||||
// Sql
|
// Sql
|
||||||
implementation(SqlDelight.runtime)
|
implementation(SqlDelight.runtime)
|
||||||
|
|
||||||
|
// Sql
|
||||||
|
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val commonTest by getting {
|
val commonTest by getting {
|
||||||
@@ -80,10 +83,6 @@ kotlin {
|
|||||||
val iosArm64Main by getting
|
val iosArm64Main by getting
|
||||||
// val iosSimulatorArm64Main by getting
|
// val iosSimulatorArm64Main by getting
|
||||||
val iosMain by creating {
|
val iosMain by creating {
|
||||||
dependsOn(commonMain)
|
|
||||||
iosX64Main.dependsOn(this)
|
|
||||||
iosArm64Main.dependsOn(this)
|
|
||||||
// iosSimulatorArm64Main.dependsOn(this)
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(SqlDelight.native)
|
implementation(SqlDelight.native)
|
||||||
@@ -94,10 +93,6 @@ kotlin {
|
|||||||
val iosArm64Test by getting
|
val iosArm64Test by getting
|
||||||
// val iosSimulatorArm64Test by getting
|
// val iosSimulatorArm64Test by getting
|
||||||
val iosTest by creating {
|
val iosTest by creating {
|
||||||
dependsOn(commonTest)
|
|
||||||
iosX64Test.dependsOn(this)
|
|
||||||
iosArm64Test.dependsOn(this)
|
|
||||||
// iosSimulatorArm64Test.dependsOn(this)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -6,33 +6,8 @@ import kotlinx.datetime.*
|
|||||||
|
|
||||||
actual class DateUtils {
|
actual class DateUtils {
|
||||||
actual companion object {
|
actual companion object {
|
||||||
// Possible formats are
|
|
||||||
// yyyy-mm-dd hh:mm:ss format
|
|
||||||
private val oldVersionFormat = "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}(.()\\d*)?".toRegex()
|
|
||||||
|
|
||||||
// yyyy-MM-dd'T'HH:mm:ss[.SSS]XXX (RFC3339)
|
|
||||||
private val newVersionFormat = "(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2})[+-](\\d{2}(:\\d{2})?)?".toRegex()
|
|
||||||
|
|
||||||
// TODO: do not fix any more issues here. Move everything to plateform specific code.
|
|
||||||
actual fun parseDate(dateString: String): Long {
|
|
||||||
var isoDateString: String =
|
|
||||||
try {
|
|
||||||
if (dateString.matches(oldVersionFormat)) {
|
|
||||||
dateString.replace(" ", "T")
|
|
||||||
} else if (dateString.matches(newVersionFormat)) {
|
|
||||||
newVersionFormat.find(dateString)?.groups?.get(1)?.value ?: throw Exception("Couldn't parse $dateString")
|
|
||||||
} else {
|
|
||||||
throw Exception("Unrecognized format for $dateString")
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
|
||||||
throw Exception("parseDate failed for $dateString", e)
|
|
||||||
}
|
|
||||||
|
|
||||||
return LocalDateTime.parse(isoDateString).toInstant(TimeZone.currentSystemDefault()).toEpochMilliseconds()
|
|
||||||
}
|
|
||||||
|
|
||||||
actual fun parseRelativeDate(dateString: String): String {
|
actual fun parseRelativeDate(dateString: String): String {
|
||||||
val date = parseDate(dateString)
|
val date = dateString.toParsedDate()
|
||||||
|
|
||||||
return " " +
|
return " " +
|
||||||
DateUtils.getRelativeTimeSpanString(
|
DateUtils.getRelativeTimeSpanString(
|
||||||
|
@@ -191,7 +191,7 @@ class SelfossModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val descriptor: SerialDescriptor
|
override val descriptor: SerialDescriptor
|
||||||
get() = PrimitiveSerialDescriptor("b", PrimitiveKind.BOOLEAN)
|
get() = PrimitiveSerialDescriptor("BooleanOrIntForSomeSelfossVersions", PrimitiveKind.BOOLEAN)
|
||||||
|
|
||||||
override fun serialize(
|
override fun serialize(
|
||||||
encoder: Encoder,
|
encoder: Encoder,
|
||||||
|
@@ -74,7 +74,7 @@ class Repository(
|
|||||||
dbItems = dbItems.filter { it.sourcetitle == sourceFilter.value!!.title }
|
dbItems = dbItems.filter { it.sourcetitle == sourceFilter.value!!.title }
|
||||||
}
|
}
|
||||||
val itemsList = ArrayList(dbItems.map { it.toView() })
|
val itemsList = ArrayList(dbItems.map { it.toView() })
|
||||||
itemsList.sortByDescending { DateUtils.parseDate(it.datetime) }
|
itemsList.sortByDescending { it.datetime.toParsedDate() }
|
||||||
fetchedItems =
|
fetchedItems =
|
||||||
StatusAndData.succes(
|
StatusAndData.succes(
|
||||||
itemsList,
|
itemsList,
|
||||||
|
@@ -1,9 +1,35 @@
|
|||||||
package bou.amine.apps.readerforselfossv2.utils
|
package bou.amine.apps.readerforselfossv2.utils
|
||||||
|
|
||||||
|
import kotlinx.datetime.LocalDateTime
|
||||||
|
import kotlinx.datetime.TimeZone
|
||||||
|
import kotlinx.datetime.toInstant
|
||||||
|
|
||||||
|
fun String.toParsedDate(): Long {
|
||||||
|
// Possible formats are
|
||||||
|
// yyyy-mm-dd hh:mm:ss format
|
||||||
|
val oldVersionFormat = "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}(.()\\d*)?".toRegex()
|
||||||
|
|
||||||
|
// yyyy-MM-dd'T'HH:mm:ss[.SSS]XXX (RFC3339)
|
||||||
|
val newVersionFormat = "(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2})[+-](\\d{2}(:\\d{2})?)?".toRegex()
|
||||||
|
|
||||||
|
val isoDateString: String =
|
||||||
|
try {
|
||||||
|
if (this.matches(oldVersionFormat)) {
|
||||||
|
this.replace(" ", "T")
|
||||||
|
} else if (this.matches(newVersionFormat)) {
|
||||||
|
newVersionFormat.find(this)?.groups?.get(1)?.value ?: throw Exception("Couldn't parse $this")
|
||||||
|
} else {
|
||||||
|
throw Exception("Unrecognized format for $this")
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
throw Exception("parseDate failed for $this", e)
|
||||||
|
}
|
||||||
|
|
||||||
|
return LocalDateTime.parse(isoDateString).toInstant(TimeZone.currentSystemDefault()).toEpochMilliseconds()
|
||||||
|
}
|
||||||
|
|
||||||
expect class DateUtils() {
|
expect class DateUtils() {
|
||||||
companion object {
|
companion object {
|
||||||
fun parseDate(dateString: String): Long
|
|
||||||
|
|
||||||
fun parseRelativeDate(dateString: String): String
|
fun parseRelativeDate(dateString: String): String
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
66
shared/src/commonTest/kotlin/DatesTest.kt
Normal file
66
shared/src/commonTest/kotlin/DatesTest.kt
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
package bou.amine.apps.readerforselfossv2.repository
|
||||||
|
|
||||||
|
import bou.amine.apps.readerforselfossv2.utils.toParsedDate
|
||||||
|
import kotlinx.datetime.LocalDateTime
|
||||||
|
import kotlinx.datetime.TimeZone
|
||||||
|
import kotlinx.datetime.toInstant
|
||||||
|
import kotlin.test.Test
|
||||||
|
import kotlin.test.assertEquals
|
||||||
|
|
||||||
|
class DatesTest {
|
||||||
|
private val newVersionDateVariant = "2022-12-24T17:00:08+00"
|
||||||
|
private val newVersionDate = "2013-04-07T13:43:00+01:00"
|
||||||
|
private val newVersionDate2 = "2013-04-07T13:43:00-01:00"
|
||||||
|
private val oldVersionDate = "2013-05-07 13:46:00"
|
||||||
|
private val oldVersionDateVariant = "2021-03-21 10:32:00.000000"
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun new_version_date_should_be_parsed() {
|
||||||
|
val date = newVersionDate.toParsedDate()
|
||||||
|
val expected =
|
||||||
|
LocalDateTime(2013, 4, 7, 13, 43, 0, 0).toInstant(TimeZone.currentSystemDefault())
|
||||||
|
.toEpochMilliseconds()
|
||||||
|
|
||||||
|
assertEquals(expected, date)
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
fun new_version_date2_should_be_parsed() {
|
||||||
|
val date = newVersionDate2.toParsedDate()
|
||||||
|
val expected =
|
||||||
|
LocalDateTime(2013, 4, 7, 13, 43, 0, 0).toInstant(TimeZone.currentSystemDefault())
|
||||||
|
.toEpochMilliseconds()
|
||||||
|
|
||||||
|
assertEquals(expected, date)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun old_version_date_should_be_parsed() {
|
||||||
|
val date = oldVersionDate.toParsedDate()
|
||||||
|
val expected =
|
||||||
|
LocalDateTime(2013, 5, 7, 13, 46, 0, 0).toInstant(TimeZone.currentSystemDefault())
|
||||||
|
.toEpochMilliseconds()
|
||||||
|
|
||||||
|
assertEquals(expected, date)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun old_version_variant_date_should_be_parsed() {
|
||||||
|
val date = oldVersionDateVariant.toParsedDate()
|
||||||
|
val expected =
|
||||||
|
LocalDateTime(2021, 3, 21, 10, 32, 0, 0).toInstant(TimeZone.currentSystemDefault())
|
||||||
|
.toEpochMilliseconds()
|
||||||
|
|
||||||
|
assertEquals(expected, date)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun new_version_variant_date_should_be_parsed() {
|
||||||
|
val date = newVersionDateVariant.toParsedDate()
|
||||||
|
val expected =
|
||||||
|
LocalDateTime(2022, 12, 24, 17, 0, 8, 0).toInstant(TimeZone.currentSystemDefault())
|
||||||
|
.toEpochMilliseconds()
|
||||||
|
|
||||||
|
assertEquals(expected, date)
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,9 @@
|
|||||||
|
package bou.amine.apps.readerforselfossv2.utils
|
||||||
|
|
||||||
|
actual class DateUtils actual constructor() {
|
||||||
|
actual companion object {
|
||||||
|
actual fun parseRelativeDate(dateString: String): String {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user