Skip to content

Commit

Permalink
Merge pull request #7
Browse files Browse the repository at this point in the history
ASAA-221 - Desktop
  • Loading branch information
BottleRocket-Colin authored May 20, 2024
2 parents a40ef72 + a5ab01c commit e82307b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 21 deletions.
1 change: 0 additions & 1 deletion .github/auto_assign.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ reviewers:
- br-Emery
- BottleRocket-Colin
- harishrpatel
- MMurrayAtBR

# A list of keywords to be skipped the process that add reviewers if pull requests include it
skipKeywords:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
name: Gradle Package

on:
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
push:
branches: [ "deploy" ]

jobs:
build:
Expand All @@ -36,11 +34,13 @@ jobs:
with:
arguments: build


# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish to GitHub Packages
uses: gradle/[email protected]
with:
arguments: publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_PUBLISH_USERNAME: ${{ secrets.REPO_READ_WRITE_USER }}
GH_PUBLISH_PASSWORD: ${{ secrets.REPO_READ_WRITE_TOKEN }}
11 changes: 8 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[versions]
# Publishing version
launchpad-compose = "0.1.0"

# Android SDK versions
compile-sdk = "34"
min-sdk = "24"

# Dependency versions
agp = "8.2.2"
androidx-window = "1.2.0"
compose-plugin = "1.5.12"
Expand All @@ -7,9 +15,6 @@ kt-lint-gradle = "11.6.1"
navigation-compose = "2.7.7"
precompose = "1.5.11"

compile-sdk = "34"
min-sdk = "24"
launchpad-compose = "0.0.4"

[libraries]
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigation-compose" }
Expand Down
20 changes: 8 additions & 12 deletions kmp-launchpad-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ kotlin {
}
}

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "kmp-launchpad-compose"
isStatic = true
}
}
jvm("desktop")
task("testClasses")

iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
androidMain.dependencies {
Expand Down Expand Up @@ -81,8 +77,8 @@ publishing {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/BottleRocketStudios/KMP-LaunchPad-Compose")
credentials {
username = System.getenv("REPO_READ_WRITE_USER")
password = System.getenv("REPO_READ_WRITE_TOKEN")
username = System.getenv("REPO_READ_WRITE_USER") ?: System.getenv("GH_PUBLISH_USERNAME")
password = System.getenv("REPO_READ_WRITE_TOKEN") ?: System.getenv("GH_PUBLISH_PASSWORD")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.bottlerocketstudios.launchpad.compose.util

import java.text.NumberFormat
import java.util.Currency
import java.util.Locale

/**
* Kotlin Multiplatform function - convertToCurrencyString
*
* This function takes a Double value representing a raw amount of currency,
* and returns a String representing that amount formatted appropriately as
* currency for the current locale of the device running the code.
*
* @param [amount] The raw amount of currency as a Double
* @return A string representing that amount in the appropriate currency
* format for the device's current locale.
*/
actual fun Double?.toCurrency(): String {
val numberFormat = NumberFormat.getCurrencyInstance()
numberFormat.currency = Currency.getInstance(Locale.getDefault())
return numberFormat.format(this ?: 0.0)
}

0 comments on commit e82307b

Please sign in to comment.