Skip to content

Commit

Permalink
Merge pull request #61 from estivensh4/release/0.7.0
Browse files Browse the repository at this point in the history
Release/0.7.1
  • Loading branch information
estivensh authored Mar 15, 2024
2 parents 2d3c1f8 + b8f4981 commit 72f9a9c
Show file tree
Hide file tree
Showing 349 changed files with 3,249 additions and 586 deletions.
2 changes: 1 addition & 1 deletion .github/template/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ runs:
path: ~/.m2/repository/io/github/estivensh4
- name: Sample - ${{ inputs.target }}
shell: bash
run: cd samples/${{ inputs.target }} && ./local-check.sh
run: cd sample/${{ inputs.target }} && ./local-check.sh
- name: Publish Test Report
uses: mikepenz/action-junit-report@v2
if: ${{ always() }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:
build-library:
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
name: code-coverage-report-${{ github.job }}
path: "**/build/reports/**/*"
check-sample-android-app:
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/')
needs: build-library
runs-on: ubuntu-latest
steps:
Expand All @@ -81,7 +81,7 @@ jobs:
target: androidapp
githubToken: ${{ secrets.GITHUB_TOKEN }}
check-sample-desktop-app:
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/')
needs: build-library
runs-on: ubuntu-latest
steps:
Expand All @@ -93,7 +93,7 @@ jobs:
target: desktopApp
githubToken: ${{ secrets.GITHUB_TOKEN }}
check-sample-wear-app:
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/')
needs: build-library
runs-on: ubuntu-latest
steps:
Expand All @@ -105,7 +105,7 @@ jobs:
target: wearapp
githubToken: ${{ secrets.GITHUB_TOKEN }}
check-sample-web-app:
# if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
# if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/')
needs: build-library
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@ permissions:

jobs:
build:
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/')
name: Build and analyze
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 17
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:
build-documentation:
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
retention-days: 7

test-documentation:
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/')
needs: build-documentation
runs-on: ubuntu-latest

Expand All @@ -62,7 +62,7 @@ jobs:
instance: ${{ env.INSTANCE }}

deploy-documentation:
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/')
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ env:

jobs:
pre-build:
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/')
name: Publish library at mavenCentral
runs-on: self-hosted
steps:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Publish library
run: ./gradlew publish --no-parallel
release:
# if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
# if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/')
name: Create release v${{ github.event.inputs.version }}
needs: pre-build
runs-on: self-hosted
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Thank you all for your work! ❤️

<a href="https://github.com/estivensh4/aws-kmp/graphs/contributors">
<img src="https://contrib.rocks/image?repo=estivensh4/aws-kmp" />
<img src="https://contrib.rocks/image?repo=estivensh4/aws-kmp" alt=""/>
</a>

[badge-android]: http://img.shields.io/badge/-android-6EDB8D.svg?style=flat
Expand Down
4 changes: 4 additions & 0 deletions aws-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ kotlin {

jvmToolchain(11)

compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}

androidTarget {
publishAllLibraryVariants()
compilations.all {
Expand Down
10 changes: 8 additions & 2 deletions aws-dynamo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ plugins {

@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class)
kotlin {
targetHierarchy.default()
applyDefaultHierarchyTemplate()

jvmToolchain(11)

compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}

androidTarget {
publishAllLibraryVariants()
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ fun AWSDynamoDBUpdateItemOutput?.toResult(): UpdateItemResult {
)
}

@Suppress("UNCHECKED_CAST")
@OptIn(ExperimentalForeignApi::class)
fun AWSDynamoDBScanOutput?.toResult(): ScanResult {
val item = this?.items as List<Map<String, AttributeValue>>
Expand All @@ -212,6 +213,7 @@ fun AWSDynamoDBScanOutput?.toResult(): ScanResult {
)
}

@Suppress("UNCHECKED_CAST")
@OptIn(ExperimentalForeignApi::class)
fun AWSDynamoDBQueryOutput?.toResult(): QueryResult {
val item = this?.items as List<Map<String, AttributeValue>>
Expand Down
4 changes: 4 additions & 0 deletions aws-s3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ kotlin {

jvmToolchain(11)

compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}

androidTarget {
publishAllLibraryVariants()
compilations.all {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ package com.estivensh4.s3

import io.mockk.mockk

actual fun createUploadFileForTest(): UploadFile {
actual fun createUploadFileForTest(): UploadFile? {
return mockk(relaxed = true)
}
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,15 @@ class AWSS3CommonTest {

@Test
fun `put object success`() = runTest {
val result = client.putObject(
bucketName = bucketName,
key = key,
uploadFile = createUploadFileForTest()
)
createUploadFileForTest()?.let {
val result = client.putObject(
bucketName = bucketName,
key = key,
uploadFile = it
)

assertNotNull(result.eTag)
}

assertNotNull(result.eTag)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

package com.estivensh4.s3

expect fun createUploadFileForTest(): UploadFile
expect fun createUploadFileForTest(): UploadFile?
9 changes: 4 additions & 5 deletions aws-s3/src/iosMain/kotlin/com/estivensh4/s3/UploadFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import kotlinx.cinterop.addressOf
import kotlinx.cinterop.usePinned
import platform.Foundation.NSData
import platform.UIKit.UIImage
import platform.UIKit.UIImageJPEGRepresentation
import platform.UIKit.UIImagePNGRepresentation
import platform.posix.memcpy

actual class UploadFile constructor(
actual class UploadFile(
private val data: NSData
) {
actual fun toByteArray(): ByteArray {
Expand All @@ -28,7 +27,7 @@ actual class UploadFile constructor(
}
}

fun UIImage.toPNGUploadFile() : UploadFile {
val data = UIImagePNGRepresentation(this) ?: throw Exception("Could not convert uiImage")
return UploadFile(data)
fun UIImage.toPNGUploadFile(): UploadFile? {
val data = UIImagePNGRepresentation(this)
return data?.let { UploadFile(it) }
}
2 changes: 1 addition & 1 deletion aws-s3/src/iosTest/kotlin/com/estivensh4/s3/UploadFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ package com.estivensh4.s3

import platform.UIKit.UIImage

actual fun createUploadFileForTest(): UploadFile {
actual fun createUploadFileForTest(): UploadFile? {
return UIImage().toPNGUploadFile()
}
2 changes: 1 addition & 1 deletion aws-s3/src/jvmTest/kotlin/com/estivensh4/s3/UploadFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ package com.estivensh4.s3

import io.mockk.mockk

actual fun createUploadFileForTest(): UploadFile {
actual fun createUploadFileForTest(): UploadFile? {
return mockk(relaxed = true)
}
4 changes: 4 additions & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ plugins {
`kotlin-dsl`
}

kotlin {
jvmToolchain(11)
}

repositories {
mavenCentral()
google()
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ plugins {
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.dokka)
id("io.kotest.multiplatform") version "5.8.0" apply false
id("org.jetbrains.kotlinx.kover") version "0.7.4"
id("org.sonarqube") version "3.5.0.2730"
id("org.jetbrains.kotlinx.kover") version "0.7.6"
id("org.sonarqube") version "4.4.1.3373"
}

val ktlintVersion = libs.versions.ktlint.version.get()
Expand Down Expand Up @@ -107,7 +107,7 @@ sonar {
property("sonar.organization", "estivensh4-1")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.sourceEncoding", "UTF-8")
property("sonar.sources", "aws-s3, aws-common, aws-dynamo")
//property("sonar.sources", "aws-s3, aws-common, aws-dynamo")
property("sonar.test", ".")
property("sonar.exclusions", "")
property("sonar.test.exclusions", "")
Expand Down
8 changes: 4 additions & 4 deletions detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ complexity:
threshold: 600
LongMethod:
active: true
threshold: 60
threshold: 100
LongParameterList:
active: true
functionThreshold: 6
Expand Down Expand Up @@ -293,7 +293,7 @@ exceptions:
- 'Throwable'
allowedExceptionNameRegex: '_|(ignore|expected).*'
TooGenericExceptionThrown:
active: true
active: false
exceptionNames:
- 'Error'
- 'Exception'
Expand Down Expand Up @@ -556,7 +556,7 @@ style:
active: true
maxJumpCount: 1
MagicNumber:
active: true
active: false
excludes: ['**/test/**', '**/*Test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts']
ignoreNumbers:
- '-1'
Expand Down Expand Up @@ -597,7 +597,7 @@ style:
NestedClassesVisibility:
active: true
NewLineAtEndOfFile:
active: true
active: false
NoTabs:
active: false
NullableBooleanCheck:
Expand Down
2 changes: 1 addition & 1 deletion doc/Writerside/writerside.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
<images dir="images" web-path="aws-kmp"/>
<categories src="c.list"/>
<vars src="v.list"/>
<instance src="akm.tree" keymaps-mode="provided" version="v0.6.0"/>
<instance src="akm.tree" keymaps-mode="provided" version="v0.7.1"/>
</ihp>
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ android.nonTransitiveRClass=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.native.cacheKind.iosArm64=none

mobile.multiplatform.iosTargetWarning=false
mobile.multiplatform.iosTargetWarning=false
org.jetbrains.compose.experimental.jscanvas.enabled=true
2 changes: 1 addition & 1 deletion gradle/aws.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
aws = "0.6.0"
aws = "0.7.1"

[libraries]
aws-common = { module = "io.github.estivensh4:aws-common", version.ref = "aws" }
Expand Down
Loading

0 comments on commit 72f9a9c

Please sign in to comment.