Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"projects": {
"staging": "smoke-analytics-staging",
"prod": "smoke-analytics"
},
"targets": {
"smoke-analytics-staging": {
"hosting": {
"staging": [
"smoke-analytics-staging"
]
}
},
"smoke-analytics": {
"hosting": {
"prod": [
"smoke-analytics"
]
}
}
},
"etags": {}
}
47 changes: 47 additions & 0 deletions .github/workflows/deploy-web-hosting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Web (Firebase Hosting)

on:
workflow_dispatch:
inputs:
env:
description: "Target environment"
required: true
type: choice
options: [staging, prod]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17

- name: Build web bundle + prepare hosting dir
run: ./gradlew :apps:web:prepareFirebaseHosting -Psmoke.env=${{ inputs.env }} --no-configuration-cache --rerun-tasks

- name: Deploy to Firebase Hosting (staging)
if: ${{ inputs.env == 'staging' }}
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SMOKE_ANALYTICS_STAGING }}
projectId: smoke-analytics-staging
target: staging
channelId: live

- name: Deploy to Firebase Hosting (prod)
if: ${{ inputs.env == 'prod' }}
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SMOKE_ANALYTICS }}
projectId: smoke-analytics
target: prod
channelId: live
22 changes: 11 additions & 11 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ jobs:
- name: Run Gradle checks
run: ./gradlew check --stacktrace

- name: Cache SonarQube packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
# - name: Cache SonarQube packages
# uses: actions/cache@v3
# with:
# path: ~/.sonar/cache
# key: ${{ runner.os }}-sonar
# restore-keys: ${{ runner.os }}-sonar

- name: Cache Gradle packages
uses: actions/cache@v3
Expand All @@ -75,8 +75,8 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Build and analyze with SonarQube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonar --stacktrace
# - name: Build and analyze with SonarQube
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: ./gradlew sonar --stacktrace
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,17 @@ playstore.credentials.json
/buildSrc/build/
/buildSrc/build/classes/kotlin/main/
/playstore.credentiales.json

# --- Kotlin compiler internals ---
.kotlin/

# --- Kotlin JS / Compose Web ---
kotlin-js-store/
node_modules/
yarn.lock

# --- Compose Multiplatform ---
compose-build/

# Firebase local cache
.firebase/
51 changes: 25 additions & 26 deletions apps/mobile/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import com.google.common.base.Charsets
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.io.ByteArrayOutputStream
import java.io.FileInputStream
import java.io.InputStreamReader
Expand Down Expand Up @@ -39,7 +40,7 @@ val gitCode: Int by lazy {
}

// Construct the version name using a major.minor.patch pattern with the git code.
val majorMinorPatchVersionName = "0.4.0.$gitCode"
val majorMinorPatchVersionName = "0.5.0.$gitCode"

android {
// Set the application namespace.
Expand Down Expand Up @@ -115,15 +116,6 @@ android {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
// Set the JVM target for Kotlin.
jvmTarget = Java.JVM_TARGET
// Enable experimental APIs.
freeCompilerArgs = listOf(
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlin.RequiresOptIn"
)
}

buildFeatures {
// Enable Jetpack Compose.
Expand All @@ -132,12 +124,6 @@ android {
buildConfig = true
}

@Suppress("UnstableApiUsage")
composeOptions {
// Specify the Kotlin compiler extension version for Compose.
kotlinCompilerExtensionVersion = Java.KOTLIN_COMPILER_EXTENSION_VERSION
}

packaging {
// Exclude unnecessary META-INF resources.
resources {
Expand All @@ -151,6 +137,17 @@ android {
}
}

kotlin {
jvmToolchain(17)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
freeCompilerArgs.addAll(
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlin.RequiresOptIn"
)
}
}

// Utility function to load properties from a file located at the root directory.
fun properties(propertiesFileName: String): Properties {
val properties = Properties()
Expand Down Expand Up @@ -180,13 +177,17 @@ dependencies {
implementation(libs.timber)
// Project modules.
implementation(project(":libraries:design"))
implementation(project(":libraries:architecture:presentation"))
implementation(project(":features:authentication:presentation"))
implementation(project(":features:history:presentation"))
implementation(project(":features:home:presentation"))
implementation(project(":features:settings:presentation"))
implementation(project(":features:stats:presentation"))
implementation(project(":libraries:architecture:presentation:mobile"))
implementation(project(":libraries:authentication:domain"))
implementation(project(":libraries:smokes:domain"))
implementation(project(":features:authentication:presentation:mobile"))
implementation(project(":features:history:presentation:mobile"))
implementation(project(":features:home:presentation:mobile"))
implementation(project(":features:home:domain"))
implementation(project(":features:settings:presentation:mobile"))
implementation(project(":features:stats:presentation:mobile"))
implementation(project(":features:chatbot:presentation"))
implementation(project(":features:chatbot:domain"))
// Hilt annotation processor.
kapt(libs.hilt.compiler)
// Include devtools module only in debug builds.
Expand All @@ -196,8 +197,6 @@ dependencies {
}

// Task to print the current version name to the console.
task("printVersionName") {
doLast {
println(majorMinorPatchVersionName)
}
tasks.register("printVersionName") {
doLast { println(majorMinorPatchVersionName) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.feragusper.smokeanalytics

import com.feragusper.smokeanalytics.features.chatbot.domain.ChatbotRepository
import com.feragusper.smokeanalytics.features.chatbot.domain.ChatbotUseCase
import com.feragusper.smokeanalytics.features.home.domain.FetchSmokeCountListUseCase
import com.feragusper.smokeanalytics.libraries.authentication.domain.AuthenticationRepository
import com.feragusper.smokeanalytics.libraries.authentication.domain.FetchSessionUseCase
import com.feragusper.smokeanalytics.libraries.authentication.domain.SignOutUseCase
import com.feragusper.smokeanalytics.libraries.smokes.domain.repository.SmokeRepository
import com.feragusper.smokeanalytics.libraries.smokes.domain.usecase.AddSmokeUseCase
import com.feragusper.smokeanalytics.libraries.smokes.domain.usecase.DeleteSmokeUseCase
import com.feragusper.smokeanalytics.libraries.smokes.domain.usecase.EditSmokeUseCase
import com.feragusper.smokeanalytics.libraries.smokes.domain.usecase.FetchSmokeStatsUseCase
import com.feragusper.smokeanalytics.libraries.smokes.domain.usecase.FetchSmokesUseCase
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent

@Module
@InstallIn(SingletonComponent::class)
object UseCasesModule {

@Provides
fun provideFetchSessionUseCase(
repo: AuthenticationRepository
) = FetchSessionUseCase(repo)

@Provides
fun provideSignOutUseCase(
repo: AuthenticationRepository
) = SignOutUseCase(repo)

@Provides
fun provideAddSmokeUseCase(
repo: SmokeRepository
) = AddSmokeUseCase(repo)

@Provides
fun provideEditSmokeUseCase(
repo: SmokeRepository
) = EditSmokeUseCase(repo)

@Provides
fun provideDeleteSmokeUseCase(
repo: SmokeRepository
) = DeleteSmokeUseCase(repo)

@Provides
fun provideFetchSmokesUseCase(
repo: SmokeRepository
) = FetchSmokesUseCase(repo)

@Provides
fun provideFetchSmokeStatsUseCase(
repo: SmokeRepository
) = FetchSmokeStatsUseCase(repo)

@Provides
fun provideFetchSmokeCountListUseCase(
repo: SmokeRepository
) = FetchSmokeCountListUseCase(repo)

@Provides
fun provideChatbotUseCase(
smokeRepository: SmokeRepository,
authenticationRepository: AuthenticationRepository,
chatbotRepository: ChatbotRepository
) = ChatbotUseCase(
smokeRepository = smokeRepository,
authRepository = authenticationRepository,
chatbotRepository = chatbotRepository
)
}
4 changes: 2 additions & 2 deletions apps/wear/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ fun properties(propertiesFileName: String): Properties {
}

dependencies {
implementation(project(":libraries:architecture:presentation"))
implementation(project(":libraries:architecture:presentation:mobile"))
implementation(project(":libraries:architecture:common"))
implementation(project(":libraries:wear:domain"))
implementation(project(":libraries:wear:data"))
implementation(project(":libraries:smokes:data"))
implementation(project(":libraries:smokes:data:mobile"))
implementation(libs.bundles.androidx.base)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.compose)
Expand Down
File renamed without changes.
Loading