diff --git a/build.gradle.kts b/build.gradle.kts index 4fcf238..becc958 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,22 +21,10 @@ plugins { allprojects.onEach { project -> project.afterEvaluate { with(project.plugins) { - if (hasPlugin( - libs.plugins.jetbrainsKotlinAndroid - .get() - .pluginId - ) || - hasPlugin( - libs.plugins.jetbrainsKotlinJvm - .get() - .pluginId - ) + if (hasPlugin(libs.plugins.jetbrainsKotlinAndroid.get().pluginId) || + hasPlugin(libs.plugins.jetbrainsKotlinJvm.get().pluginId) ) { - apply( - libs.plugins.detekt - .get() - .pluginId - ) + apply(libs.plugins.detekt.get().pluginId) project.extensions.configure<DetektExtension> { config.setFrom(rootProject.files("default-detekt-config.yml")) @@ -44,9 +32,7 @@ allprojects.onEach { project -> project.dependencies.add( "detektPlugins", - libs.detekt.formatting - .get() - .toString() + libs.detekt.formatting.get().toString() ) } diff --git a/compose-app/build.gradle.kts b/compose-app/build.gradle.kts index 780b178..c91c86c 100644 --- a/compose-app/build.gradle.kts +++ b/compose-app/build.gradle.kts @@ -23,19 +23,24 @@ kotlin { jvm() + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "ComposeApp" + isStatic = true + } + } + sourceSets { commonMain.dependencies { implementation(projects.features.newsMain.ui) implementation(projects.core.common) implementation(projects.core.uikit) - - implementation(libs.koin.core) implementation(libs.koin.compose) } - - androidMain.dependencies { - implementation(libs.koin.android) - } } } diff --git a/core/common/build.gradle.kts b/core/common/build.gradle.kts index 003f6e0..17328ae 100644 --- a/core/common/build.gradle.kts +++ b/core/common/build.gradle.kts @@ -20,6 +20,17 @@ kotlin { jvm() + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "CoreCommon" + isStatic = true + } + } + sourceSets { commonMain.dependencies { api(libs.kotlinx.coroutines.core) diff --git a/core/common/src/commonMain/kotlin/dev/androidbroadcast/common/AppDispatchers.kt b/core/common/src/commonMain/kotlin/dev/androidbroadcast/common/AppDispatchers.kt index b0c5687..b856b71 100644 --- a/core/common/src/commonMain/kotlin/dev/androidbroadcast/common/AppDispatchers.kt +++ b/core/common/src/commonMain/kotlin/dev/androidbroadcast/common/AppDispatchers.kt @@ -2,6 +2,7 @@ package dev.androidbroadcast.common import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.IO import kotlinx.coroutines.MainCoroutineDispatcher public class AppDispatchers( diff --git a/core/common/src/iosMain/kotlin/dev/androidbroadcast/common/PrintLogger.kt b/core/common/src/iosMain/kotlin/dev/androidbroadcast/common/PrintLogger.kt new file mode 100644 index 0000000..5f93ccc --- /dev/null +++ b/core/common/src/iosMain/kotlin/dev/androidbroadcast/common/PrintLogger.kt @@ -0,0 +1,28 @@ +package dev.androidbroadcast.common + +import platform.Foundation.NSLog + +public class PrintLogger( +) : Logger { + private fun printMessage( + level: String, + tag: String, + message: String + ) { + NSLog("$level[$tag]: $message") + } + + override fun d( + tag: String, + message: String + ) { + printMessage("D", tag, message) + } + + override fun e( + tag: String, + message: String + ) { + printMessage("E", tag, message) + } +} diff --git a/core/data/build.gradle.kts b/core/data/build.gradle.kts index bfa67f9..bbb1308 100644 --- a/core/data/build.gradle.kts +++ b/core/data/build.gradle.kts @@ -20,6 +20,17 @@ kotlin { jvm() + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "CoreData" + isStatic = true + } + } + sourceSets { commonMain.dependencies { implementation(libs.kotlinx.coroutines.core) diff --git a/core/database/build.gradle.kts b/core/database/build.gradle.kts index 534e48d..c40d85a 100644 --- a/core/database/build.gradle.kts +++ b/core/database/build.gradle.kts @@ -19,15 +19,37 @@ kotlin { jvm() + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "CoreDatabase" + isStatic = true + } + } + sourceSets { - commonMain.dependencies { - implementation(libs.kotlinx.datetime) - api(libs.androidx.room.common) - api(libs.androidx.room.runtime) + commonMain { + dependencies { + implementation(libs.kotlinx.datetime) + api(libs.androidx.room.common) + api(libs.androidx.room.runtime) + } } androidMain.dependencies { implementation(libs.androidx.core.ktx) + implementation(libs.androidx.sqlite.bundled) + } + + jvmMain.dependencies { + implementation(libs.androidx.sqlite.bundled) + } + + iosMain.dependencies { + implementation(libs.androidx.sqlite.bundled) } } } @@ -56,5 +78,10 @@ room { } dependencies { - ksp(libs.androidx.room.compiler) + add("kspJvm", libs.androidx.room.compiler) + add("kspAndroid", libs.androidx.room.compiler) + add("kspIosSimulatorArm64", libs.androidx.room.compiler) + add("kspIosX64", libs.androidx.room.compiler) + add("kspIosArm64", libs.androidx.room.compiler) +// add("kspCommonMainMetadata", libs.androidx.room.compiler) } diff --git a/core/database/src/androidMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.android.kt b/core/database/src/androidMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.android.kt new file mode 100644 index 0000000..11ea46d --- /dev/null +++ b/core/database/src/androidMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.android.kt @@ -0,0 +1,5 @@ +package dev.androidbroadcast.news.database + +actual fun instantiateNewsRoomDatabase(): NewsRoomDatabase { + error("Not implemented in Android") +} diff --git a/core/database/src/commonMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.kt b/core/database/src/commonMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.kt index ce3373a..5a9137a 100644 --- a/core/database/src/commonMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.kt +++ b/core/database/src/commonMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.kt @@ -8,6 +8,7 @@ import dev.androidbroadcast.news.database.models.ArticleDBO import dev.androidbroadcast.news.database.utils.Converters import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.IO class NewsDatabase internal constructor(private val database: NewsRoomDatabase) { val articlesDao: ArticleDao @@ -31,3 +32,5 @@ fun NewsDatabase( .build() ) } + +public expect fun instantiateNewsRoomDatabase(): NewsRoomDatabase diff --git a/core/database/src/iosArm64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosArm64.kt b/core/database/src/iosArm64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosArm64.kt new file mode 100644 index 0000000..70c301b --- /dev/null +++ b/core/database/src/iosArm64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosArm64.kt @@ -0,0 +1,3 @@ +package dev.androidbroadcast.news.database + +actual fun instantiateNewsRoomDatabase(): NewsRoomDatabase = NewsRoomDatabase_Impl() diff --git a/core/database/src/iosSimulatorArm64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosSimulatorArm64.kt b/core/database/src/iosSimulatorArm64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosSimulatorArm64.kt new file mode 100644 index 0000000..70c301b --- /dev/null +++ b/core/database/src/iosSimulatorArm64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosSimulatorArm64.kt @@ -0,0 +1,3 @@ +package dev.androidbroadcast.news.database + +actual fun instantiateNewsRoomDatabase(): NewsRoomDatabase = NewsRoomDatabase_Impl() diff --git a/core/database/src/iosX64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosX64.kt b/core/database/src/iosX64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosX64.kt new file mode 100644 index 0000000..70c301b --- /dev/null +++ b/core/database/src/iosX64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosX64.kt @@ -0,0 +1,3 @@ +package dev.androidbroadcast.news.database + +actual fun instantiateNewsRoomDatabase(): NewsRoomDatabase = NewsRoomDatabase_Impl() diff --git a/core/database/src/jvmMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.jvm.kt b/core/database/src/jvmMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.jvm.kt new file mode 100644 index 0000000..f1534c4 --- /dev/null +++ b/core/database/src/jvmMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.jvm.kt @@ -0,0 +1,5 @@ +package dev.androidbroadcast.news.database + +actual fun instantiateNewsRoomDatabase(): NewsRoomDatabase { + error("Not implemented in JVM") +} diff --git a/core/opennews-api/build.gradle.kts b/core/opennews-api/build.gradle.kts index c847bbf..2117981 100644 --- a/core/opennews-api/build.gradle.kts +++ b/core/opennews-api/build.gradle.kts @@ -18,6 +18,17 @@ kotlin { jvm() + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "CoreOpenNewsApi" + isStatic = true + } + } + sourceSets { commonMain.dependencies { implementation(libs.kotlinx.coroutines.core) @@ -37,6 +48,10 @@ kotlin { jvmMain.dependencies { implementation(libs.ktor.client.okhttp) } + + iosMain.dependencies { + implementation(libs.ktor.client.darwin) + } } } diff --git a/core/opennews-api/src/commonMain/kotlin/dev/androidbroadcast/newsapi/NewsApi.kt b/core/opennews-api/src/commonMain/kotlin/dev/androidbroadcast/newsapi/NewsApi.kt index 712ea98..5a61b5a 100644 --- a/core/opennews-api/src/commonMain/kotlin/dev/androidbroadcast/newsapi/NewsApi.kt +++ b/core/opennews-api/src/commonMain/kotlin/dev/androidbroadcast/newsapi/NewsApi.kt @@ -24,6 +24,7 @@ import io.ktor.serialization.kotlinx.json.json import kotlinx.datetime.Instant import kotlinx.serialization.SerialName import kotlinx.serialization.json.Json +import kotlin.jvm.JvmSuppressWildcards /** * [API Documentation](https://newsapi.org/docs/get-started) diff --git a/core/platform/build.gradle.kts b/core/platform/build.gradle.kts index 3d2f739..ecd8c5c 100644 --- a/core/platform/build.gradle.kts +++ b/core/platform/build.gradle.kts @@ -20,6 +20,17 @@ kotlin { jvm() + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "CorePlatform" + isStatic = true + } + } + sourceSets { commonMain.dependencies { api(projects.core.common) @@ -32,6 +43,10 @@ kotlin { jvmMain.dependencies { implementation(libs.androidx.sqlite.bundled) } + + iosMain.dependencies { + implementation(libs.androidx.sqlite.bundled) + } } } diff --git a/core/platform/src/commonMain/kotlin/dev/androidbroadcast/news/core/KoinModules.common.kt b/core/platform/src/commonMain/kotlin/dev/androidbroadcast/news/core/KoinModules.kt similarity index 100% rename from core/platform/src/commonMain/kotlin/dev/androidbroadcast/news/core/KoinModules.common.kt rename to core/platform/src/commonMain/kotlin/dev/androidbroadcast/news/core/KoinModules.kt diff --git a/core/platform/src/iosMain/kotlin/dev/androidbroadcast/news/core/ImageLoader.ios.kt b/core/platform/src/iosMain/kotlin/dev/androidbroadcast/news/core/ImageLoader.ios.kt new file mode 100644 index 0000000..9d77d84 --- /dev/null +++ b/core/platform/src/iosMain/kotlin/dev/androidbroadcast/news/core/ImageLoader.ios.kt @@ -0,0 +1,8 @@ +package dev.androidbroadcast.news.core + +import coil3.PlatformContext +import coil3.disk.DiskCache + +internal actual fun newDiskCache(context: PlatformContext): DiskCache? { + TODO("Not yet implemented") +} diff --git a/core/platform/src/iosMain/kotlin/dev/androidbroadcast/news/core/KoinModules.ios.kt b/core/platform/src/iosMain/kotlin/dev/androidbroadcast/news/core/KoinModules.ios.kt new file mode 100644 index 0000000..abddf1a --- /dev/null +++ b/core/platform/src/iosMain/kotlin/dev/androidbroadcast/news/core/KoinModules.ios.kt @@ -0,0 +1,28 @@ +package dev.androidbroadcast.news.core + +import androidx.room.Room +import androidx.room.RoomDatabase +import androidx.sqlite.driver.bundled.BundledSQLiteDriver +import dev.androidbroadcast.common.Logger +import dev.androidbroadcast.common.PrintLogger +import dev.androidbroadcast.news.database.NewsRoomDatabase +import dev.androidbroadcast.news.database.instantiateNewsRoomDatabase +import org.koin.core.module.Module +import org.koin.dsl.module +import platform.Foundation.NSHomeDirectory + +/** + * Koin Module with target platform specifics dependencies + */ +internal actual val targetKoinModule: Module = module { + factory<RoomDatabase.Builder<NewsRoomDatabase>> { + Room.databaseBuilder<NewsRoomDatabase>( + name = "${NSHomeDirectory()}/news.db", + factory = { instantiateNewsRoomDatabase() } + ).setDriver(BundledSQLiteDriver()) + } + + factory<Logger> { + PrintLogger() + } +} diff --git a/core/uikit/build.gradle.kts b/core/uikit/build.gradle.kts index ebeeadd..8180110 100644 --- a/core/uikit/build.gradle.kts +++ b/core/uikit/build.gradle.kts @@ -20,6 +20,17 @@ kotlin { jvm() + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "CoreUiKit" + isStatic = true + } + } + sourceSets { commonMain.dependencies { api(compose.ui) diff --git a/core/uikit/src/iosMain/kotlin/dev/androidbroadcast/news/Theme.ios.kt b/core/uikit/src/iosMain/kotlin/dev/androidbroadcast/news/Theme.ios.kt new file mode 100644 index 0000000..460fc25 --- /dev/null +++ b/core/uikit/src/iosMain/kotlin/dev/androidbroadcast/news/Theme.ios.kt @@ -0,0 +1,19 @@ +package dev.androidbroadcast.news + +import androidx.compose.material3.ColorScheme +import androidx.compose.runtime.Composable + +@Composable +internal actual fun dynamicColorScheme(darkTheme: Boolean): ColorScheme { + error("Dynamic theming isn't supported") +} + +internal actual fun isPlatformWithDynamicSystemTheme(): Boolean = false + +@Composable +internal actual fun platformThemeSetup( + darkTheme: Boolean, + colorScheme: ColorScheme, +) { + // Do nothing +} diff --git a/features/news-main/ui-logic/build.gradle.kts b/features/news-main/ui-logic/build.gradle.kts index ac31b58..58201ba 100644 --- a/features/news-main/ui-logic/build.gradle.kts +++ b/features/news-main/ui-logic/build.gradle.kts @@ -20,6 +20,17 @@ kotlin { jvm() + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "FeaturesNewsMainUiLogic" + isStatic = true + } + } + sourceSets { commonMain.dependencies { api(projects.core.data) diff --git a/features/news-main/ui/build.gradle.kts b/features/news-main/ui/build.gradle.kts index 1fd58ee..adf0f70 100644 --- a/features/news-main/ui/build.gradle.kts +++ b/features/news-main/ui/build.gradle.kts @@ -20,6 +20,17 @@ kotlin { jvm() + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "FeaturesNewsMainUi" + isStatic = true + } + } + sourceSets { commonMain.dependencies { implementation(projects.features.newsMain.uiLogic) @@ -33,7 +44,6 @@ kotlin { implementation(libs.androidx.lifecycle.viewmodel) implementation(compose.components.resources) - implementation(libs.androidx.lifecycle.viewmodel.compose) } androidMain.dependencies { diff --git a/gradle.properties b/gradle.properties index 316a8ed..d45c4aa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,4 +21,6 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -org.gradle.configuration-cache=true \ No newline at end of file +org.gradle.configuration-cache=true + +kotlin.native.disableCompilerDaemon=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c89cabd..5daf585 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -83,6 +83,7 @@ kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version. ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" } +ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" } ktor-client-contentNegotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } diff --git a/iosApp/Configuration/Config.xcconfig b/iosApp/Configuration/Config.xcconfig new file mode 100644 index 0000000..73ea261 --- /dev/null +++ b/iosApp/Configuration/Config.xcconfig @@ -0,0 +1,3 @@ +TEAM_ID= +BUNDLE_ID=dev.androidbroadcast.news +APP_NAME=NewApp \ No newline at end of file diff --git a/iosApp/iosApp.xcodeproj/project.pbxproj b/iosApp/iosApp.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c8a5aff --- /dev/null +++ b/iosApp/iosApp.xcodeproj/project.pbxproj @@ -0,0 +1,403 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; }; + 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; }; + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; + 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; }; + 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = "<group>"; }; + 7555FF7B242A565900829871 /* NewApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NewApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; }; + 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; + AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B92378962B6B1156000C7307 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 058557D7273AAEEB004C7B11 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = "<group>"; + }; + 42799AB246E5F90AF97AA0EF /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = "<group>"; + }; + 7555FF72242A565900829871 = { + isa = PBXGroup; + children = ( + AB1DB47929225F7C00F7AF9C /* Configuration */, + 7555FF7D242A565900829871 /* iosApp */, + 7555FF7C242A565900829871 /* Products */, + 42799AB246E5F90AF97AA0EF /* Frameworks */, + ); + sourceTree = "<group>"; + }; + 7555FF7C242A565900829871 /* Products */ = { + isa = PBXGroup; + children = ( + 7555FF7B242A565900829871 /* NewApp.app */, + ); + name = Products; + sourceTree = "<group>"; + }; + 7555FF7D242A565900829871 /* iosApp */ = { + isa = PBXGroup; + children = ( + 058557BA273AAA24004C7B11 /* Assets.xcassets */, + 7555FF82242A565900829871 /* ContentView.swift */, + 7555FF8C242A565B00829871 /* Info.plist */, + 2152FB032600AC8F00CF470E /* iOSApp.swift */, + 058557D7273AAEEB004C7B11 /* Preview Content */, + ); + path = iosApp; + sourceTree = "<group>"; + }; + AB1DB47929225F7C00F7AF9C /* Configuration */ = { + isa = PBXGroup; + children = ( + AB3632DC29227652001CCB65 /* Config.xcconfig */, + ); + path = Configuration; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 7555FF7A242A565900829871 /* iosApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; + buildPhases = ( + F36B1CEB2AD83DDC00CB74D5 /* Compile Kotlin Framework */, + 7555FF77242A565900829871 /* Sources */, + B92378962B6B1156000C7307 /* Frameworks */, + 7555FF79242A565900829871 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = iosApp; + packageProductDependencies = ( + ); + productName = iosApp; + productReference = 7555FF7B242A565900829871 /* NewApp.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 7555FF73242A565900829871 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 1130; + LastUpgradeCheck = 1540; + ORGANIZATIONNAME = orgName; + TargetAttributes = { + 7555FF7A242A565900829871 = { + CreatedOnToolsVersion = 11.3.1; + }; + }; + }; + buildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 7555FF72242A565900829871; + packageReferences = ( + ); + productRefGroup = 7555FF7C242A565900829871 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 7555FF7A242A565900829871 /* iosApp */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 7555FF79242A565900829871 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */, + 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + F36B1CEB2AD83DDC00CB74D5 /* Compile Kotlin Framework */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Compile Kotlin Framework"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/..\"\n./gradlew :shared:embedAndSignAppleFrameworkForXcode\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7555FF77242A565900829871 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */, + 7555FF83242A565900829871 /* ContentView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 7555FFA3242A565B00829871 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 7555FFA4242A565B00829871 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 7555FFA6242A565B00829871 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; + DEVELOPMENT_TEAM = "${TEAM_ID}"; + ENABLE_PREVIEWS = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", + ); + INFOPLIST_FILE = iosApp/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.news"; + IPHONEOS_DEPLOYMENT_TARGET = 15.3; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 7555FFA7242A565B00829871 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; + DEVELOPMENT_TEAM = "${TEAM_ID}"; + ENABLE_PREVIEWS = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", + ); + INFOPLIST_FILE = iosApp/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.news"; + IPHONEOS_DEPLOYMENT_TARGET = 15.3; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; + PRODUCT_NAME = "${APP_NAME}"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7555FFA3242A565B00829871 /* Debug */, + 7555FFA4242A565B00829871 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7555FFA6242A565B00829871 /* Debug */, + 7555FFA7242A565B00829871 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 7555FF73242A565900829871 /* Project object */; +} diff --git a/iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Workspace + version = "1.0"> + <FileRef + location = "self:"> + </FileRef> +</Workspace> diff --git a/iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDEDidComputeMac32BitWarning</key> + <true/> +</dict> +</plist> diff --git a/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/krozov.xcuserdatad/UserInterfaceState.xcuserstate b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/krozov.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..ff59008 Binary files /dev/null and b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/krozov.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/krozov.xcuserdatad/xcschemes/xcschememanagement.plist b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/krozov.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..ee3458d --- /dev/null +++ b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/krozov.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict /> +</plist> diff --git a/iosApp/iosApp.xcodeproj/xcuserdata/krozov.xcuserdatad/xcschemes/iosApp.xcscheme b/iosApp/iosApp.xcodeproj/xcuserdata/krozov.xcuserdatad/xcschemes/iosApp.xcscheme new file mode 100644 index 0000000..128339f --- /dev/null +++ b/iosApp/iosApp.xcodeproj/xcuserdata/krozov.xcuserdatad/xcschemes/iosApp.xcscheme @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + version = "1.7"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "7555FF7A242A565900829871" + BuildableName = "NewApp.app" + BlueprintName = "iosApp" + ReferencedContainer = "container:iosApp.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + shouldAutocreateTestPlan = "YES"> + </TestAction> + <LaunchAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "YES" + customWorkingDirectory = "/Users/krozov/dev/projects/SampleNewsApp" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "7555FF7A242A565900829871" + BuildableName = "NewApp.app" + BlueprintName = "iosApp" + ReferencedContainer = "container:iosApp.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </LaunchAction> + <ProfileAction + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/iosApp/iosApp.xcodeproj/xcuserdata/krozov.xcuserdatad/xcschemes/xcschememanagement.plist b/iosApp/iosApp.xcodeproj/xcuserdata/krozov.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..fa59f97 --- /dev/null +++ b/iosApp/iosApp.xcodeproj/xcuserdata/krozov.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>SchemeUserState</key> + <dict> + <key>iosApp.xcscheme</key> + <dict> + <key>orderHint</key> + <integer>0</integer> + </dict> + </dict> +</dict> +</plist> diff --git a/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..ee7e3ca --- /dev/null +++ b/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..8edf56e --- /dev/null +++ b/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "app-icon-1024.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png b/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png new file mode 100644 index 0000000..53fc536 Binary files /dev/null and b/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png differ diff --git a/iosApp/iosApp/Assets.xcassets/Contents.json b/iosApp/iosApp/Assets.xcassets/Contents.json new file mode 100644 index 0000000..4aa7c53 --- /dev/null +++ b/iosApp/iosApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/iosApp/iosApp/ContentView.swift b/iosApp/iosApp/ContentView.swift new file mode 100644 index 0000000..935e187 --- /dev/null +++ b/iosApp/iosApp/ContentView.swift @@ -0,0 +1,18 @@ +import UIKit +import SwiftUI +import NewsShared + +struct ComposeView: UIViewControllerRepresentable { + func makeUIViewController(context: Context) -> UIViewController { + NewsViewControllerKt.MainViewController() + } + + func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} +} + +struct ContentView: View { + var body: some View { + ComposeView() + .ignoresSafeArea(.keyboard) // Compose has own keyboard handler + } +} \ No newline at end of file diff --git a/iosApp/iosApp/Info.plist b/iosApp/iosApp/Info.plist new file mode 100644 index 0000000..3d2c290 --- /dev/null +++ b/iosApp/iosApp/Info.plist @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CADisableMinimumFrameDurationOnPhone</key> + <true/> + <key>CFBundleDevelopmentRegion</key> + <string>$(DEVELOPMENT_LANGUAGE)</string> + <key>CFBundleExecutable</key> + <string>$(EXECUTABLE_NAME)</string> + <key>CFBundleIdentifier</key> + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>$(PRODUCT_NAME)</string> + <key>CFBundlePackageType</key> + <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleVersion</key> + <string>1</string> + <key>LSRequiresIPhoneOS</key> + <true/> + <key>UIApplicationSceneManifest</key> + <dict> + <key>UIApplicationSupportsMultipleScenes</key> + <false/> + </dict> + <key>UILaunchScreen</key> + <dict/> + <key>UIRequiredDeviceCapabilities</key> + <array> + <string>armv7</string> + </array> + <key>UISupportedInterfaceOrientations</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + </array> + <key>UISupportedInterfaceOrientations~ipad</key> + <array> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationLandscapeRight</string> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationPortraitUpsideDown</string> + </array> +</dict> +</plist> diff --git a/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..4aa7c53 --- /dev/null +++ b/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/iosApp/iosApp/iOSApp.swift b/iosApp/iosApp/iOSApp.swift new file mode 100644 index 0000000..d83dca6 --- /dev/null +++ b/iosApp/iosApp/iOSApp.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct iOSApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index aa4ecb3..a580b03 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -45,3 +45,4 @@ include(":features:news-main:ui-logic") include(":compose-app") include(":desktop") +include(":shared") diff --git a/shared/.gitignore b/shared/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/shared/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts new file mode 100644 index 0000000..5217835 --- /dev/null +++ b/shared/build.gradle.kts @@ -0,0 +1,30 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + +plugins { + alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.jetbrainsCompose) + alias(libs.plugins.compose.compiler) + alias(libs.plugins.detekt) +} + +kotlin { + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "NewsShared" + isStatic = true + } + } + + sourceSets { + commonMain.dependencies { + implementation(projects.composeApp) + implementation(projects.core.platform) + } + } +} diff --git a/shared/src/iosMain/kotlin/dev.androidbroadcast.news.compose/NewsViewController.kt b/shared/src/iosMain/kotlin/dev.androidbroadcast.news.compose/NewsViewController.kt new file mode 100644 index 0000000..a2d4d64 --- /dev/null +++ b/shared/src/iosMain/kotlin/dev.androidbroadcast.news.compose/NewsViewController.kt @@ -0,0 +1,14 @@ +import androidx.compose.ui.window.ComposeUIViewController +import dev.androidbroadcast.news.compose.NewsApp +import dev.androidbroadcast.news.core.NewsAppPlatform +import platform.UIKit.UIViewController + +fun MainViewController(): UIViewController { + val appPlatform = NewsAppPlatform() + appPlatform.start( + debug = true, + newsApiKey = "155ae65d7264461397c901103488c01e", + newsApiBaseUrl = "https://newsapi.org/v2/" + ) + return ComposeUIViewController { NewsApp() } +}