From 5e33e00b600d2a2b7b55f3a73f7ccade80edb131 Mon Sep 17 00:00:00 2001 From: BoD Date: Sat, 23 May 2020 22:12:15 +0200 Subject: [PATCH] Add the `fileName: String` field to the `Attachment` model. --- CHANGELOG.md | 7 +++++-- README.md | 2 +- build.gradle | 2 +- gradle/misc.gradle | 2 +- gradle/versions.gradle | 8 ++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew.bat | 3 +++ library/build.gradle | 2 +- .../model/attachments/ApiAttachmentEnvelopeConverter.kt | 1 + .../internal/model/attachments/AttachmentImpl.kt | 1 + .../org/jraf/klibqonto/model/attachments/Attachment.kt | 5 +++++ 11 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d95082..df90db6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,13 @@ # Changelog +## 2.1.0 +Add the `fileName: String` field to the `Attachment` model. + ## v2.0.1 -Minor comment fix, and dependency updates +Minor comment fix, and dependency updates. ## v2.0.0 -Migrated the project to Kotlin Multiplatform +Migrated the project to Kotlin Multiplatform: - Removed Flow based client (was not really useful) - Added a Callback based client (useful for Swift) - Tweaked the API a bit to make it work well with Multiplatform diff --git a/README.md b/README.md index a2293c5..8bc5914 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ repositories { ```groovy dependencies { /* ... */ - implementation 'org.jraf:klibqonto:2.0.1' + implementation 'org.jraf:klibqonto:2.1.0' } ``` diff --git a/build.gradle b/build.gradle index 4e457ad..71dc808 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ buildscript { allprojects { group = 'org.jraf' - version = '2.0.1' + version = '2.1.0' repositories.addRepos() diff --git a/gradle/misc.gradle b/gradle/misc.gradle index b5635ed..52c7b75 100644 --- a/gradle/misc.gradle +++ b/gradle/misc.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.github.ben-manes.versions' dependencyUpdates.resolutionStrategy = { componentSelection { rules -> rules.all { selection -> - boolean rejected = ['alpha', 'beta', 'rc'].any { qualifier -> + boolean rejected = ['alpha', 'beta', 'rc', 'm1'].any { qualifier -> selection.candidate.version.toLowerCase() ==~ /.*-${qualifier}.*/ } if (rejected) { diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 89f600b..dd40538 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -6,7 +6,7 @@ def plugins = [:] plugins.with { gradleVersions = '0.28.0' dokka = '0.10.1' - android = '3.6.1' + android = '3.6.3' } versions.plugins = plugins @@ -20,7 +20,7 @@ versions.buildLibs = buildLibs // Build parameters def build = [:] build.with { - gradle = '6.2.2' + gradle = '6.4.1' kotlinJvmTarget = '1.8' } versions.build = build @@ -35,9 +35,9 @@ versions.testing = testing // Other dependencies versions.with { - kotlin = '1.3.70' + kotlin = '1.3.72' ktor = '1.3.2' - coroutines = '1.3.3' + coroutines = '1.3.7' retrofit = '2.6.1' okHttp = '4.1.1' gson = '2.8.5' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 84a9066..21e622d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat index 9618d8d..62bd9b9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" diff --git a/library/build.gradle b/library/build.gradle index 8490249..3c9b1f6 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,6 +1,6 @@ plugins { id 'org.jetbrains.kotlin.multiplatform' - id 'org.jetbrains.kotlin.plugin.serialization' version '1.3.70' + id 'org.jetbrains.kotlin.plugin.serialization' version '1.3.72' } apply plugin: 'com.android.library' diff --git a/library/src/commonMain/kotlin/org/jraf/klibqonto/internal/api/model/attachments/ApiAttachmentEnvelopeConverter.kt b/library/src/commonMain/kotlin/org/jraf/klibqonto/internal/api/model/attachments/ApiAttachmentEnvelopeConverter.kt index 24dced0..d089fc8 100644 --- a/library/src/commonMain/kotlin/org/jraf/klibqonto/internal/api/model/attachments/ApiAttachmentEnvelopeConverter.kt +++ b/library/src/commonMain/kotlin/org/jraf/klibqonto/internal/api/model/attachments/ApiAttachmentEnvelopeConverter.kt @@ -32,6 +32,7 @@ import org.jraf.klibqonto.model.attachments.Attachment internal object ApiAttachmentEnvelopeConverter : ApiConverter() { override fun apiToModel(apiModel: ApiAttachmentEnvelope) = AttachmentImpl( apiModel.attachment.id, + apiModel.attachment.file_name, ApiDateConverter.apiToModel(apiModel.attachment.created_at)!!, apiModel.attachment.file_size, apiModel.attachment.file_content_type, diff --git a/library/src/commonMain/kotlin/org/jraf/klibqonto/internal/model/attachments/AttachmentImpl.kt b/library/src/commonMain/kotlin/org/jraf/klibqonto/internal/model/attachments/AttachmentImpl.kt index 34bec6c..e6744e3 100644 --- a/library/src/commonMain/kotlin/org/jraf/klibqonto/internal/model/attachments/AttachmentImpl.kt +++ b/library/src/commonMain/kotlin/org/jraf/klibqonto/internal/model/attachments/AttachmentImpl.kt @@ -29,6 +29,7 @@ import org.jraf.klibqonto.model.dates.Date internal data class AttachmentImpl( override val id: String, + override val fileName: String, override val createdDate: Date, override val size: Long, override val contentType: String, diff --git a/library/src/commonMain/kotlin/org/jraf/klibqonto/model/attachments/Attachment.kt b/library/src/commonMain/kotlin/org/jraf/klibqonto/model/attachments/Attachment.kt index 22249e9..ea8ccbd 100644 --- a/library/src/commonMain/kotlin/org/jraf/klibqonto/model/attachments/Attachment.kt +++ b/library/src/commonMain/kotlin/org/jraf/klibqonto/model/attachments/Attachment.kt @@ -32,6 +32,11 @@ interface Attachment { */ val id: String + /** + * Name of the file + */ + val fileName: String + /** * Timestamp of the file upload */