Skip to content

Commit e4bb7cb

Browse files
committed
Cleanup and use compose-jb
1 parent daa474d commit e4bb7cb

File tree

281 files changed

+833
-16331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

281 files changed

+833
-16331
lines changed

androidApp/build.gradle.kts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ plugins {
44
}
55

66
android {
7-
compileSdkVersion(AndroidSdk.compile)
7+
compileSdk = AndroidSdk.compile
88
defaultConfig {
99
applicationId = "com.rouge41.kmm.compose.androidApp"
10-
minSdkVersion(AndroidSdk.min)
11-
targetSdkVersion(AndroidSdk.target)
10+
minSdk = AndroidSdk.min
11+
targetSdk = AndroidSdk.target
1212
versionCode = 1
1313
versionName = "1.0"
1414
}
@@ -28,21 +28,18 @@ android {
2828
compose = true
2929
}
3030
composeOptions {
31-
kotlinCompilerExtensionVersion = Version.compose
31+
kotlinCompilerExtensionVersion = Version.compose_compiler
3232
}
3333
}
3434

3535
dependencies {
36-
implementation(Android.appcompact)
37-
implementation(Android.material)
38-
39-
implementation(project(":multiplatform-compose"))
4036
implementation(project(":test"))
4137

38+
implementation(Android.appcompat)
39+
implementation(Android.material)
40+
4241
implementation(Compose.runtime)
4342
implementation(Compose.ui)
4443
implementation(Compose.foundationLayout)
4544
implementation(Compose.material)
46-
implementation(Compose.runtimeLiveData)
47-
implementation(Compose.navigation)
48-
}
45+
}

androidApp/src/main/java/com/rouge41/kmm/compose/androidApp/MainActivity.kt

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,20 @@ package com.rouge41.kmm.compose.androidApp
22

33
import android.graphics.Color
44
import android.os.Bundle
5-
import android.view.View
6-
import androidx.appcompat.app.AppCompatActivity
7-
import androidx.compose.ui.platform.ComposeView
8-
import com.rouge41.kmm.compose.test.Content
9-
import com.rouge41.kmm.compose.test.Resources
5+
import com.rouge41.kmm.compose.RootView
6+
import moe.tlaster.precompose.lifecycle.PreComposeActivity
7+
import moe.tlaster.precompose.lifecycle.setContent
108

11-
class MainActivity : AppCompatActivity() {
9+
class MainActivity : PreComposeActivity() {
1210
override fun onCreate(savedInstanceState: Bundle?) {
1311
super.onCreate(savedInstanceState)
14-
setContentView(R.layout.activity_main)
1512

16-
//has to be set in code or in theme
13+
// has to be set in code or in theme
1714
window.decorView.setBackgroundColor(Color.WHITE)
1815
window.statusBarColor = Color.parseColor("#cc7000")
19-
//window.statusBarColor = Color.WHITE
20-
//window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
2116

22-
val cv: ComposeView = findViewById(R.id.compose_view)
23-
val resources = Resources(logo = R.drawable.logo)
24-
25-
cv.setContent {
26-
Content(resources)
17+
setContent {
18+
RootView()
2719
}
2820
}
2921
}

androidApp/src/main/res/layout/activity_main.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.

build.gradle.kts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
buildscript {
22
repositories {
33
gradlePluginPortal()
4-
jcenter()
54
google()
5+
jcenter()
66
mavenCentral()
7+
maven("https://jitpack.io")
8+
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
79
}
810
dependencies {
9-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Version.kotlin}")
10-
classpath("com.android.tools.build:gradle:7.1.2")
11+
classpath(Kotlin.gradle)
12+
classpath(Android.gradle)
13+
classpath(Kotlin.serialization)
1114
}
1215
}
1316

@@ -16,5 +19,6 @@ allprojects {
1619
google()
1720
jcenter()
1821
mavenCentral()
22+
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
1923
}
2024
}

buildSrc/build.gradle.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
repositories {
2-
jcenter()
2+
mavenCentral()
33
}
44

55
plugins {
66
`kotlin-dsl`
77
}
8-
9-
kotlinDslPluginOptions {
10-
experimentalWarning.set(false)
11-
}
Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11

22
object Version {
3-
const val kotlin = "1.6.10"
4-
3+
const val kotlin = "1.7.20"
4+
const val gradle = "7.3.1"
55
const val appcompat = "1.4.0"
66
const val material = "1.4.0"
7-
8-
const val compose = "1.1.0"
9-
const val nav_compose = "2.4.1"
10-
11-
const val yoga = "~> 1.7"
12-
13-
const val junit = "4.13"
14-
15-
const val coil = "1.4.0"
16-
const val coroutines = "1.5.2"
7+
const val compose = "1.2.1"
8+
const val compose_compiler = "1.3.2"
9+
const val precompose = "1.3.9"
10+
const val ktor = "2.1.2"
1711
}
1812

1913

2014
object AndroidSdk {
21-
const val min = 24
22-
const val compile = 31
15+
const val min = 21
16+
const val compile = 33
2317
const val target = compile
2418
}
2519

@@ -28,23 +22,32 @@ object iOSSdk {
2822
}
2923

3024
object Android {
31-
const val appcompact = "androidx.appcompat:appcompat:${Version.appcompat}"
25+
const val appcompat = "androidx.appcompat:appcompat:${Version.appcompat}"
3226
const val material = "com.google.android.material:material:${Version.material}"
27+
const val gradle = "com.android.tools.build:gradle:${Version.gradle}"
3328
}
3429

3530
object Compose {
3631
const val runtime = "androidx.compose.runtime:runtime:${Version.compose}"
3732
const val ui = "androidx.compose.ui:ui:${Version.compose}"
3833
const val foundationLayout = "androidx.compose.foundation:foundation-layout:${Version.compose}"
3934
const val material = "androidx.compose.material:material:${Version.compose}"
40-
const val runtimeLiveData = "androidx.compose.runtime:runtime-livedata:${Version.compose}"
41-
const val navigation = "androidx.navigation:navigation-compose:${Version.nav_compose}"
4235
}
4336

44-
object Coil {
45-
const val coil = "io.coil-kt:coil:${Version.coil}"
37+
object Kotlin {
38+
const val gradle = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Version.kotlin}"
39+
const val serialization = "org.jetbrains.kotlin:kotlin-serialization:${Version.kotlin}"
4640
}
4741

48-
object Kotlinx {
49-
const val coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Version.coroutines}"
50-
}
42+
const val precompose = "moe.tlaster:precompose:${Version.precompose}"
43+
44+
object Ktor {
45+
const val client_core = "io.ktor:ktor-client-core:${Version.ktor}"
46+
const val client_content_negotiation = "io.ktor:ktor-client-content-negotiation:${Version.ktor}"
47+
const val client_logging = "io.ktor:ktor-client-logging:${Version.ktor}"
48+
const val serialization_json = "io.ktor:ktor-serialization-kotlinx-json:${Version.ktor}"
49+
const val client_logging_jvm = "io.ktor:ktor-client-logging-jvm:${Version.ktor}"
50+
const val client_json_jvm = "io.ktor:ktor-client-json-jvm:${Version.ktor}"
51+
const val client_android = "io.ktor:ktor-client-android:${Version.ktor}"
52+
const val client_ios = "io.ktor:ktor-client-ios:${Version.ktor}"
53+
}

gradle.properties

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
#Gradle
2+
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
3+
14
kotlin.code.style=official
2-
xcodeproj=./iosApp
35
android.useAndroidX=true
6+
7+
#MPP
8+
xcodeproj=./iosApp
49
kotlin.mpp.enableGranularSourceSetsMetadata=true
5-
kotlin.native.enableDependencyPropagation=false
10+
kotlin.native.enableDependencyPropagation=false
11+
kotlin.native.binary.memoryModel=experimental
12+
kotlin.mpp.enableCInteropCommonization=true
13+
org.jetbrains.compose.experimental.uikit.enabled=true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Jan 22 09:15:46 CET 2021
1+
#Fri Nov 18 11:12:20 CET 2022
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

iosApp/Podfile

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,16 @@
1-
# Uncomment the next line to define a global platform for your project
2-
platform :ios, '9.0'
3-
inhibit_all_warnings!
1+
source 'https://cdn.cocoapods.org'
2+
platform :ios, '11.0'
43

54
target 'iosApp' do
6-
# Comment the next line if you don't want to use dynamic frameworks
75
use_frameworks!
8-
9-
# pod 'multiplatform_compose', :path => '../multiplatform-compose'
106
pod 'test', :path => '../test'
11-
12-
target 'iosAppTests' do
13-
inherit! :search_paths
14-
# Pods for testing
15-
end
16-
17-
target 'iosAppUITests' do
18-
# Pods for testing
19-
end
20-
217
end
228

23-
# See https://stackoverflow.com/questions/37160688/set-deployment-target-for-cocoapodss-pod/51416359#51416359
249
post_install do |installer|
2510
installer.pods_project.targets.each do |target|
2611
target.build_configurations.each do |config|
27-
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
2812
# Force CocoaPods targets to always build for x86_64
2913
config.build_settings['ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
3014
end
3115
end
3216
end
33-

iosApp/Podfile.lock

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
11
PODS:
2-
- test (0.0.1):
3-
- YogaKit (~> 1.7)
4-
- Yoga (1.14.0)
5-
- YogaKit (1.18.1):
6-
- Yoga (~> 1.14)
2+
- test (0.0.1)
73

84
DEPENDENCIES:
95
- test (from `../test`)
106

11-
SPEC REPOS:
12-
trunk:
13-
- Yoga
14-
- YogaKit
15-
167
EXTERNAL SOURCES:
178
test:
189
:path: "../test"
1910

2011
SPEC CHECKSUMS:
21-
test: 72859298f3559094e4087550d7dc622688572e28
22-
Yoga: cff67a400f6b74dc38eb0bad4f156673d9aa980c
23-
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
12+
test: 66942bf3e61e1e990f5e0fe8ca47b3dbf12d7d21
2413

25-
PODFILE CHECKSUM: 7550d818c61fa360b8651061baef62b99f2fe5b7
14+
PODFILE CHECKSUM: 70f60dbd5c685328388ed16cc67b87bab84535fc
2615

27-
COCOAPODS: 1.11.2
16+
COCOAPODS: 1.11.3

iosApp/Pods/Local Podspecs/multiplatform_compose.podspec.json

Lines changed: 0 additions & 41 deletions
This file was deleted.

iosApp/Pods/Local Podspecs/test.podspec.json

Lines changed: 2 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)