From c4e8e61e0e7b2b48ab2de085a42fa66ccba1d22c Mon Sep 17 00:00:00 2001 From: Joseph Sanjaya Date: Sat, 16 Aug 2025 10:51:58 +0700 Subject: [PATCH] feat(#174): initiate games module --- .gitmodules | 4 ++++ app/build.gradle.kts | 7 +++++++ build.gradle.kts | 1 + gradle/libs.versions.toml | 3 ++- modules/games | 1 + settings.gradle.kts | 18 ++++++++++++++++++ 6 files changed, 33 insertions(+), 1 deletion(-) create mode 160000 modules/games diff --git a/.gitmodules b/.gitmodules index 17190631..bd038a83 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,7 @@ [submodule "app/src/main/jni/core"] path = app/src/main/jni/core url = https://github.com/brainwallet-co/core.git +[submodule "modules/games"] + path = modules/games + url = https://github.com/gruntsoftware/android-games.git + update = none diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2032355a..a15a6cae 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -188,6 +188,13 @@ dependencies { } } + val gamesModule = findProject(":modules:games:content") + if (gamesModule != null) { + implementation(gamesModule) + } else { + logger.lifecycle("⚠️ Submodule ':modules:games:content' not found — skipping dependency") + } + implementation("androidx.webkit:webkit:1.9.0") implementation(libs.androidx.core) implementation(libs.androidx.appcompat) diff --git a/build.gradle.kts b/build.gradle.kts index 8cbe07fb..a34bb719 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.library) apply false alias(libs.plugins.jetbrains.kotlin.android) apply false alias(libs.plugins.jetbrains.kotlin.compose) apply false alias(libs.plugins.jetbrains.kotlin.kapt) apply false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fc956caf..c234152d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -135,10 +135,11 @@ squareup-okhttp = ["squareup-okhttp", "squareup-okhttp-logging-interceptor"] [plugins] android-application = { id = "com.android.application", version.ref = "agp" } +android-library = { id = "com.android.library", version.ref = "agp" } jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } jetbrains-kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } jetbrains-kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version = "2.1.0" } jetbrains-kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } google-services = { id = "com.google.gms.google-services", version = "4.4.2" } firebase-crashlytics = { id = "com.google.firebase.crashlytics", version = "3.0.2" } -ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } \ No newline at end of file +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } diff --git a/modules/games b/modules/games new file mode 160000 index 00000000..a5f408cc --- /dev/null +++ b/modules/games @@ -0,0 +1 @@ +Subproject commit a5f408cc093f729b32f351e29d010a31242eef8e diff --git a/settings.gradle.kts b/settings.gradle.kts index b3356345..2ee160e5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -11,15 +11,33 @@ pluginManagement { gradlePluginPortal() } } + dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() } + + versionCatalogs { + val gamesToml = file("modules/games/gradle/libs.versions.toml") + if (gamesToml.exists()) { + create("games") { + from(files(gamesToml)) + } + } else { + logger.lifecycle("⚠️ Submodule catalog 'games' not loaded — file not found: $gamesToml") + } + } } rootProject.name = "Brainwallet Android" include(":app") include(":install_time_asset_pack") +val gamesDir = file("modules/games/content") +if (gamesDir.exists()) { + include(":modules:games:content") +} else { + logger.lifecycle("⚠️ Submodule ':modules:games:content' not included — folder not found: $gamesDir") +} \ No newline at end of file