Skip to content

Commit

Permalink
KMP rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Flisar authored and Michael Flisar committed Oct 28, 2024
1 parent e4ec46b commit e30cdff
Show file tree
Hide file tree
Showing 149 changed files with 4,814 additions and 2,809 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish
on:
release:
types: [published]

env:
TAG: ${{ github.event.release.tag_name }}

jobs:
publish:
name: Publish
runs-on: macos-latest

steps:

- name: Checkout repository
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

- name: Grant Permission to Execute Gradle
run: chmod +x gradlew

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build

- name: Publish Library
run: |
echo "TAG: $TAG"
echo "Publishing library 🚀"
echo ""
./gradlew publish --no-daemon --no-parallel
echo "Published✅"
# echo "Releasing repository... 🚀"
# ./gradlew closeAndReleaseRepository
# echo "Released✅"
env:
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
/.kotlin
/.idea
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/deploymentTargetSelector.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/kotlinc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/migrations.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/misc.xml

This file was deleted.

24 changes: 12 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
mavenCentral()
google()
gradlePluginPortal()
maven("https://jitpack.io")
}
dependencies {
classpath(libs.gradle)
classpath(libs.kotlin.gradle.plugin)
classpath(libs.kotlin.serialization)
}
plugins {
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.compose) apply false
alias(libs.plugins.gradle.maven.publish.plugin) apply false
alias(libs.plugins.dokka) apply false
}
File renamed without changes.
41 changes: 21 additions & 20 deletions demo/build.gradle.kts → demo/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-parcelize")
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlin.compose)
}

android {
Expand Down Expand Up @@ -51,10 +51,6 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

composeOptions {
kotlinCompilerExtensionVersion = compose.versions.compiler.get()
}
}

dependencies {
Expand All @@ -65,21 +61,24 @@ dependencies {

implementation(libs.kotlin)

implementation(libs.kotlinx.datetime)

// ------------------------
// AndroidX
// ------------------------

// Compose
implementation(platform(compose.bom))
implementation(compose.material3)
implementation(compose.activity)
implementation(compose.material.extendedicons)
implementation(compose.drawablepainter)

implementation(androidx.datastore.preferences)
implementation(libs.compose.material3)
implementation(libs.compose.material.icons.core)
implementation(libs.compose.material.icons.extended)
implementation(libs.drawablepainter)

implementation(libs.androidx.activity.compose)
implementation(libs.androidx.datastore.preferences)

implementation(compose.ui.tooling)
implementation(compose.ui.tooling.preview)
implementation(libs.compose.ui.tooling)
implementation(libs.compose.ui.tooling.preview.android)

// ------------------------
// Libraries
Expand All @@ -97,24 +96,26 @@ dependencies {
implementation(project(":ComposePreferences:Modules:KotPreferences"))

// KotPreferences
// implementation(deps.kotpreferences.core) already included by the kotpreferences module!
implementation(deps.kotpreferences.datastore)
implementation(deps.kotpreferences.compose)
implementation(libs.kotpreferences.core)
implementation(libs.kotpreferences.storage.datastore)
implementation(libs.kotpreferences.extension.compose)

// Dialogs
implementation(deps.composedialogs.core)
implementation(deps.composedialogs.dialog.list)
implementation(libs.composedialogs.core)
implementation(libs.composedialogs.dialog.list)

// ------------------------
// Desugar
// ------------------------

coreLibraryDesugaring(deps.desugar)
coreLibraryDesugaring(libs.desugar)

// ------------------------
// Others
// ------------------------

// a minimal library that provides some useful composables that I use inside demo activities
implementation(deps.composedemobaseactivity)
implementation(libs.toolbox.core)
implementation(libs.toolbox.ui)
implementation(libs.toolbox.android.demo.app)
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.michaelflisar.composepreferences.demo

import android.app.Application

class DemoApp : Application() {
class DemoApp : com.michaelflisar.toolbox.androiddemoapp.DemoApp() {
override fun onCreate() {
super.onCreate()
}
Expand Down
Loading

0 comments on commit e30cdff

Please sign in to comment.