Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose multiplatfrom migration #101

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {

android {
namespace 'com.himanshoe.chartysample'
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "com.himanshoe.chartysample"
minSdk 24
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"

Expand All @@ -37,7 +37,7 @@ android {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.4.7'
kotlinCompilerExtensionVersion '1.5.9'
}
packagingOptions {
resources {
Expand All @@ -48,18 +48,18 @@ android {

dependencies {
implementation(project(":charty"))
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.5.1'
implementation platform('androidx.compose:compose-bom:2022.10.00')
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
implementation 'androidx.activity:activity-compose:1.8.2'
implementation platform('androidx.compose:compose-bom:2024.02.00')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material3:material3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00')
androidTestImplementation platform('androidx.compose:compose-bom:2024.02.00')
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'
Expand Down
14 changes: 0 additions & 14 deletions build.gradle

This file was deleted.

16 changes: 16 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.0")
classpath("org.jlleitschuh.gradle:ktlint-gradle:11.3.2")
}
}

plugins {
id("com.android.application").version("8.2.0") apply false
id("com.android.library").version("8.2.0") apply false
id("org.jetbrains.kotlin.android").version("1.9.21") apply false
kotlin("multiplatform").version("1.9.21") apply false
id("org.jetbrains.compose").version("1.6.11") apply false
id("org.jetbrains.dokka").version("1.9.0")
}
76 changes: 0 additions & 76 deletions charty/build.gradle

This file was deleted.

86 changes: 86 additions & 0 deletions charty/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
kotlin("multiplatform")
id("com.android.library")
id("org.jetbrains.compose")
id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish") version "0.25.3"
}

apply("../quality/static-check.gradle")

kotlin {
androidTarget() {
publishLibraryVariants("release")
}

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "charty"
isStatic = true
}
}

sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.materialIconsExtended)
implementation(compose.ui)
implementation("org.jetbrains.compose.ui:ui-util:1.6.11")
}
}
}
}

android {
namespace = "com.himanshoe.charty"
compileSdk = 34

defaultConfig {
minSdk = 24
targetSdk = 34

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(17)
}
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()
}

dependencies {
debugImplementation("androidx.compose.ui:ui-tooling")
dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:1.8.20")
lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}
2 changes: 1 addition & 1 deletion charty/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
Loading