Skip to content

Patch 1 #58

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

Open
wants to merge 12 commits into
base: mlykotom/update-versions
Choose a base branch
from
Open

Conversation

beyanpixel
Copy link

No description provided.

mlykotom and others added 12 commits January 17, 2025 11:48
* Deprecate DiceRoller

* Delete DiceRoller directory

* Delete .github/workflows/DiceRoller.yaml
* Update versions

* Remove deprecated properties

* Fix ios build

* Select xcode version

* Update Fruitties.yaml

* Remove pods + use xcodeproj

* Revert daemon

* Disable native toolchain
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Move Fruitties to first
* Use SKIE Observing to collect state flows in SwiftUI

This commit updates the `ContentView` to use
`Observing` from the SKIE library to collect the `StateFlow`
exposed by the `MainViewModel` into SwiftUI.

- This replaces the `.collect` method, which is no longer needed
  when using `Observing`.
- Adds a comment to reference the SKIE documentation for flows in
  SwiftUI.

* Adds a comment about ViewModel and the StateFlow for SwiftUI
* Chore: Code maintenance, dependency updates, and build config

This commit bundles several updates:

1.  **Apply Spotless Formatting:**
    * Ran `./gradlew :androidApp:spotlessApply` to enforce code style consistency.

2.  **Configure ktlint via `.editorconfig`:**
    * Added `.editorconfig` to the Fruitties project.
    * Configured ktlint to ignore function naming rules for Composable functions.
    * Disabled the standard multiline expression wrapping rule to allow for better readability in specific assignment cases.

3.  **Update Dependencies:**
    * Updated various dependencies in `libs.versions.toml`:
        * agp: 8.9.1
        * androidx-activityCompose: 1.10.1
        * androidx-paging: 3.3.6
        * androidx-room: to 2.7.0
        * androidx-lifecycle: 2.9.0-beta01
        * compose: 1.7.8
        * compose-material3: 1.3.2
        * dataStore: 1.1.4
        * kotlin: 2.1.10
        * ksp: 2.1.10-1.0.30
        * pagingComposeAndroid: 3.3.6
        * skie: 0.10.1
        * sqlite: 2.5.0

4.  **Set iOS Framework Bundle ID:**
    * Explicitly set the `bundleId` for iOS frameworks to `com.example.fruitties.ios` using `binaryOptions["bundleId"]`.
    * This resolves the compiler warning: "Please specify the bundle ID explicitly using the -Xbinary=bundleId=<id> compiler flag."
* Update all dependencies

* Use compose-bom + keep kotlin 2.1.10

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tomáš Mlynarič <[email protected]>
Copy link

google-cla bot commented May 12, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @beyanpixel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request migrates the DiceRoller project to the Fruitties project, which uses Kotlin Multiplatform with ViewModel, Room, DataStore, and Ktor. The changes include updating Gradle configurations, source code, and project structure to align with the new project's dependencies and architecture. The DiceRoller project is deprecated and removed from the main branch, but can still be accessed in the history.

Highlights

  • Project Migration: Migrated the DiceRoller project to the Fruitties project, which uses Kotlin Multiplatform with ViewModel, Room, DataStore, and Ktor.
  • Gradle Configuration Updates: Updated Gradle configurations, including build.gradle.kts, gradle.properties, settings.gradle.kts, and gradle-wrapper.properties, to align with the new project's dependencies and architecture.
  • Source Code Updates: Updated source code in both androidApp and shared modules to align with the new project's architecture and dependencies. This includes changes to UI components, data models, and data access layers.
  • Project Structure Changes: Modified the project structure, including adding new files and directories, removing deprecated files, and reorganizing existing files to align with the new project's architecture.
  • iOS App Updates: Updated the iOS app to align with the new project's architecture and dependencies. This includes changes to the project's configuration, source code, and resources.
  • Dependency Updates: Updated dependencies in both androidApp and shared modules to align with the new project's requirements. This includes adding new dependencies, removing deprecated dependencies, and updating existing dependencies to the latest versions.
  • Code Style and Formatting: Added .editorconfig to enforce code style and formatting rules.
  • Security Policy: Added SECURITY.md to outline the project's security policy and reporting procedures.
  • Renovate Configuration: Added renovate.json to configure Renovate bot for dependency updates.

Changelog

Click here to see the changelog
  • .github/CODEOWNERS
    • Added @android/kmp-devrel as code owner.
  • .gitignore
    • Removed various Android Studio and Xcode related files and directories.
    • Added build directory to the shared module.
  • SECURITY.md
    • Added SECURITY.md to outline the project's security policy and reporting procedures.
  • androidApp/build.gradle.kts
    • Updated dependencies to align with the new project's requirements.
    • Added compose bom to manage compose dependencies
  • androidApp/src/main/AndroidManifest.xml
    • Added fullBackupContent and dataExtractionRules attributes to the application tag.
  • androidApp/src/main/java/com/example/fruitties/android/di/App.kt
    • Modified the App class to align with the new project's architecture.
  • androidApp/src/main/java/com/example/fruitties/android/ui/ListScreen.kt
    • Updated UI components and layout to align with the new project's design.
    • Removed save string
  • androidApp/src/main/res/values/strings.xml
    • Removed unused string resources.
  • androidApp/src/main/res/xml/data_extraction_rules.xml
    • Added data extraction rules to exclude certain domains from backup and transfer.
  • androidApp/src/main/res/xml/full_backup_content.xml
    • Added full backup content to exclude certain domains from backup.
  • build.gradle.kts
    • Updated plugins to align with the new project's requirements.
    • Added androidKmpLibrary plugin
  • gradle.properties
    • Removed kotlin.mpp.androidGradlePluginCompatibility.nowarn=true.
    • Disabled kotlin native toolchain
  • gradle/libs.versions.toml
    • Updated versions of various dependencies, including AGP, Compose, Kotlin, Ktor, and Room.
    • Added new dependencies, such as androidx-runner, androidx-core, and androidx-junit.
    • Removed kotlinCocoapods plugin
  • gradle/wrapper/gradle-wrapper.properties
    • Updated Gradle distribution URL to version 8.14.
  • gradlew
    • Modified the Gradle wrapper script to align with the new project's requirements.
    • Fixed issue with APP_HOME variable
    • Removed CLASSPATH variable
    • Updated set command
  • gradlew.bat
    • Modified the Gradle wrapper batch script to align with the new project's requirements.
    • Removed CLASSPATH variable
    • Updated set command
  • iosApp/iosApp.xcodeproj/project.pbxproj
    • Updated project configuration to align with the new project's requirements.
    • Renamed ShellScript to Compile Kotlin Multiplatform
    • Updated PRODUCT_BUNDLE_IDENTIFIER
  • iosApp/iosApp/CartView.swift
    • Added SKIE Observing to access StateFlow in SwiftUI.
  • iosApp/iosApp/ContentView.swift
    • Removed State and collect() and replaced with Observing for StateFlow access.
  • iosApp/iosApp/Info.plist
    • Added UILaunchScreen key
  • renovate.json
    • Added renovate.json to configure Renovate bot for dependency updates.
  • shared/.gitignore
    • Added /build to gitignore
  • shared/build.gradle.kts
    • Updated plugins and dependencies to align with the new project's requirements.
    • Added androidKmpLibrary plugin
    • Configured androidLibrary
    • Configured ios targets
    • Configured cocoapods
    • Configured sourceSets
  • shared/src/androidMain/AndroidManifest.xml
    • Added AndroidManifest.xml
  • shared/src/androidMain/kotlin/com/example/fruitties/di/Factory.android.kt
    • Modified the Factory class to align with the new project's architecture.
  • shared/src/commonMain/kotlin/com/example/fruitties/DataRepository.kt
    • Simplified loadData function
  • shared/src/commonMain/kotlin/com/example/fruitties/database/AppDatabase.kt
    • Renamed dbFileName to DB_FILE_NAME
  • shared/src/commonMain/kotlin/com/example/fruitties/database/CartDataStore.kt
    • Added comments
    • Updated CartDataStore
  • shared/src/commonMain/kotlin/com/example/fruitties/database/FruittieDao.kt
    • Removed extra line
  • shared/src/commonMain/kotlin/com/example/fruitties/di/Factory.kt
    • Updated Factory
  • shared/src/commonMain/kotlin/com/example/fruitties/network/FruittieApi.kt
    • Updated FruittieNetworkApi
  • shared/src/commonMain/kotlin/com/example/fruitties/viewmodel/MainViewModel.kt
    • Updated MainViewModel
    • Added comments
  • shared/src/iosMain/kotlin/com/example/fruitties/di/Factory.native.kt
    • Renamed dbFileName to DB_FILE_NAME
    • Updated CartDataStore
  • shared/src/iosMain/kotlin/com/example/fruitties/di/viewmodel/IOSViewModelOwner.kt
    • Updated IOSViewModelOwner
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


From dice to fruit, a change so grand,
KMP's power, across the land.
Room, Ktor, and more,
A fruitful core,
Code shared with a steady hand.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request includes several updates and refactorings to modernize the project, including upgrading Gradle, migrating to Compose BOM, and implementing KMP view models. The changes seem well-structured, but careful verification is needed to ensure compatibility and correctness.

Summary of Findings

  • Upgrade Gradle Version: The Gradle version is being upgraded from 8.10 to 8.14. Ensure compatibility with all dependencies and plugins.
  • KMP Android Gradle Plugin Compatibility: The property kotlin.mpp.androidGradlePluginCompatibility.nowarn was removed from gradle.properties. Verify that this change does not introduce any compatibility issues.
  • Data Extraction Rules and Full Backup Content: New files data_extraction_rules.xml and full_backup_content.xml were added to androidApp/src/main/res/xml. Ensure these files are correctly configured to handle data backup and extraction.
  • Compose BOM Implementation: The implementation of Compose BOM was updated in androidApp/build.gradle.kts. Verify that this change does not introduce any compatibility issues.
  • Use of KMP View Model: The iOS implementation was updated to use the KMP view model. Verify that the iOS implementation is working as expected.

Merge Readiness

The pull request includes significant updates, including Gradle version upgrades and KMP ViewModel implementations. While the changes appear well-structured, thorough testing is essential to ensure compatibility and correctness across all platforms. Due to the potential for compatibility issues, I recommend that the pull request not be merged until these are addressed. I am unable to approve this pull request, and recommend that others review and approve this code before merging.

Comment on lines +21 to +22
android:fullBackupContent="@xml/full_backup_content"
android:dataExtractionRules="@xml/data_extraction_rules"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's great that you've added fullBackupContent and dataExtractionRules. Make sure these files are correctly configured to handle data backup and extraction according to the app's requirements. Are you excluding any sensitive data?

Comment on lines +73 to +74
val composeBom = platform(libs.compose.bom)
implementation(composeBom)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Good job on implementing the Compose BOM! This helps manage Compose dependencies more effectively. Just double-check that all Compose dependencies are compatible with the BOM version.

@@ -332,7 +333,7 @@
"-framework",
shared,
);
PRODUCT_BUNDLE_IDENTIFIER = orgIdentifier.iosApp;
PRODUCT_BUNDLE_IDENTIFIER = com.example.fruitties.ios;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Why was the PRODUCT_BUNDLE_IDENTIFIER changed? Please verify that this change is intentional and doesn't affect the app's identity or provisioning profiles.

@@ -361,7 +362,7 @@
"-framework",
shared,
);
PRODUCT_BUNDLE_IDENTIFIER = orgIdentifier.iosApp;
PRODUCT_BUNDLE_IDENTIFIER = com.example.fruitties.ios;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Why was the PRODUCT_BUNDLE_IDENTIFIER changed? Please verify that this change is intentional and doesn't affect the app's identity or provisioning profiles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants