Skip to content

Commit

Permalink
Merge pull request #25 from syxc/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
syxc committed May 23, 2024
2 parents 6c4a358 + 52399c9 commit 19bf8ec
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 56 deletions.
15 changes: 0 additions & 15 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
* text=auto eol=lf
*.bat text eol=crlf

README text
LICENSE text
CONTRIBUTING text

.gitignore text
*.gitattributes text
*.xcconfig text
*.md text diff=markdown

#
# Exclude files from exporting
#
.gitattributes export-ignore
.gitignore export-ignore

*.jar binary
*.png binary
*.jpg binary
Expand Down
9 changes: 2 additions & 7 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ plugins {

repositories {
mavenCentral()
google {
content {
includeGroupByRegex(".*google.*")
includeGroupByRegex(".*android.*")
}
}
google()
}

group = "com.jithub.app.buildlogic"
group = "com.jithub.app.build-logic"

kotlin {
jvmToolchain(17)
Expand Down
11 changes: 7 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ org.gradle.caching=true
org.gradle.configureondemand=true
org.gradle.configuration-cache=true

# This is needed for the JB Compose runtime to link on native targets. They also use this flag
# in their samples. Over time it should be removed once they figure out why it was needed.
kotlin.native.cacheKind=none

# Kotlin
kotlin.code.style=official
kotlin.incremental.native=true
#kotlin.js.compiler=ir

# This is needed for the JB Compose runtime to link on native targets. They also use this flag
# in their samples. Over time it should be removed once they figure out why it was needed.
kotlin.native.cacheKind=none

# https://github.com/Kotlin/kotlinx-atomicfu/issues/141
kotlin.native.ignoreIncorrectDependencies=true

# MPP
kotlin.mpp.stability.nowarn=true
kotlin.mpp.enableCInteropCommonization=true
Expand Down
33 changes: 16 additions & 17 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ redwood = "0.11.0"
androidx-activityCompose = "1.9.0"
androidx-appcompat = "1.6.1"
androidx-constraintlayout = "2.1.4"
androidx-core-ktx = "1.13.0"
androidx-material = "1.11.0"

jetpackCompose = "1.6.6"
jetbrainsCompose = "1.6.2"
androidx-core-ktx = "1.13.1"
androidx-material = "1.12.0"

jbr-compose = "1.6.2"
androidx-compose = "1.6.6"
compose-material3 = "1.2.1"

androidx-espresso-core = "3.5.1"
Expand All @@ -30,17 +29,17 @@ androidx-activity-compose = { module = "androidx.activity:activity-compose", ver

# JetBrains Compose: https://github.com/JetBrains/compose-multiplatform
jetbrains-compose-compiler = "org.jetbrains.compose.compiler:compiler:1.5.14"
jetbrains-compose-gradlePlugin = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "jetbrainsCompose" }
jetbrains-compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "jetbrainsCompose" }
jetbrains-compose-runtime-saveable = { module = "org.jetbrains.compose.runtime:runtime-saveable", version.ref = "jetbrainsCompose" }
jetbrains-compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "jetbrainsCompose" }
jetbrains-compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "jetbrainsCompose" }
jetbrains-compose-ui-tooling = { module = "org.jetbrains.compose.ui:ui-tooling", version.ref = "jetbrainsCompose" }
jetbrains-compose-ui-tooling-preview = { module = "org.jetbrains.compose.ui:ui-tooling-preview", version.ref = "jetbrainsCompose" }
jetbrains-compose-material = { module = "org.jetbrains.compose.material:material", version.ref = "jetbrainsCompose" }
jetbrains-compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "jetbrainsCompose" }
jetbrains-compose-animation = { module = "org.jetbrains.compose.animation:animation-core", version.ref = "jetbrainsCompose" }
jetbrains-components-resources = { module = "org.jetbrains.compose.components:components-resources", version.ref = "jetbrainsCompose" }
jetbrains-compose-gradlePlugin = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "jbr-compose" }
jetbrains-compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "jbr-compose" }
jetbrains-compose-runtime-saveable = { module = "org.jetbrains.compose.runtime:runtime-saveable", version.ref = "jbr-compose" }
jetbrains-compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "jbr-compose" }
jetbrains-compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "jbr-compose" }
jetbrains-compose-ui-tooling = { module = "org.jetbrains.compose.ui:ui-tooling", version.ref = "jbr-compose" }
jetbrains-compose-ui-tooling-preview = { module = "org.jetbrains.compose.ui:ui-tooling-preview", version.ref = "jbr-compose" }
jetbrains-compose-material = { module = "org.jetbrains.compose.material:material", version.ref = "jbr-compose" }
jetbrains-compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "jbr-compose" }
jetbrains-compose-animation = { module = "org.jetbrains.compose.animation:animation-core", version.ref = "jbr-compose" }
jetbrains-components-resources = { module = "org.jetbrains.compose.components:components-resources", version.ref = "jbr-compose" }

# Redwood: https://github.com/cashapp/redwood
redwood-compose = { module = "app.cash.redwood:redwood-compose", version.ref = "redwood" }
Expand All @@ -64,7 +63,7 @@ android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-cocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "jetbrainsCompose" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "jbr-compose" }

cashapp-redwood = { id = "app.cash.redwood", version.ref = "redwood" }

Expand Down
2 changes: 1 addition & 1 deletion iosApp/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ EXTERNAL SOURCES:
:path: "../shared"

SPEC CHECKSUMS:
shared: 825978f2a80ce00aa0d9e76613eb649352d916b5
shared: 322de44d4a2cd8a0315d0b724307402aaa406311
SwiftFormat: d30e6e1c9a85f4bce83394af184e2c1d03032605

PODFILE CHECKSUM: c865212f162b25efab1f4c3a7c4b85bdb722c41e
Expand Down
4 changes: 2 additions & 2 deletions iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@
"-ObjC",
"-l\"c++\"",
"-framework",
"\"shared\"",
"\"SharedKit\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
PRODUCT_NAME = "${APP_NAME}";
Expand Down Expand Up @@ -476,7 +476,7 @@
"-ObjC",
"-l\"c++\"",
"-framework",
"\"shared\"",
"\"SharedKit\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
PRODUCT_NAME = "${APP_NAME}";
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2024 jithub.com. All rights reserved.
//

import shared
import SharedKit
import UIKit

@main
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/ContentView.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import shared
import SharedKit
import SwiftUI

struct ContentView: View {
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/CounterViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import shared
import SharedKit
import UIKit

class CounterViewController: UIViewController {
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/MokoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2024 jithub.com. All rights reserved.
//

import shared
import SharedKit
import SwiftUI

struct MokoView: View {
Expand Down
4 changes: 2 additions & 2 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ kotlin {
ios.deploymentTarget = "13.0"
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "shared"
baseName = "SharedKit"
binaryOptions["bundleId"] = "com.jithub.app.shared"
isStatic = true
export(moko.resources)
Expand Down Expand Up @@ -67,7 +67,7 @@ kotlin {
}

iosMain.dependencies {
// redwood
// Redwood
implementation(libs.redwood.layout.uiview)
}
}
Expand Down
8 changes: 4 additions & 4 deletions shared/shared.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ Pod::Spec.new do |spec|
spec.authors = ''
spec.license = ''
spec.summary = 'Some description for the Shared Module'
spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework'
spec.vendored_frameworks = 'build/cocoapods/framework/SharedKit.framework'
spec.libraries = 'c++'
spec.ios.deployment_target = '13.0'


if !Dir.exist?('build/cocoapods/framework/shared.framework') || Dir.empty?('build/cocoapods/framework/shared.framework')
if !Dir.exist?('build/cocoapods/framework/SharedKit.framework') || Dir.empty?('build/cocoapods/framework/SharedKit.framework')
raise "
Kotlin framework 'shared' doesn't exist yet, so a proper Xcode project can't be generated.
Kotlin framework 'SharedKit' doesn't exist yet, so a proper Xcode project can't be generated.
'pod install' should be executed after running ':generateDummyFramework' Gradle task:
./gradlew :shared:generateDummyFramework
Expand All @@ -24,7 +24,7 @@ Pod::Spec.new do |spec|

spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => ':shared',
'PRODUCT_MODULE_NAME' => 'shared',
'PRODUCT_MODULE_NAME' => 'SharedKit',
}

spec.script_phases = [
Expand Down

0 comments on commit 19bf8ec

Please sign in to comment.