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
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: gradle
directory: "/"
schedule:
interval: daily
time: "05:00"
open-pull-requests-limit: 10
target-branch: main
ignore:
- dependency-name: "*alpha*"
- dependency-name: "*rc*"
labels:
- "dependencies"
8 changes: 8 additions & 0 deletions .github/templates/assemble/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: build

runs:
using: "composite"
steps:
- name: Assemble debug
run: ./gradlew assembleDebug
shell: bash
14 changes: 14 additions & 0 deletions .github/templates/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: setup
runs:
using: "composite"
steps:
- name: set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'oracle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Grant execute permission for gradlew
run: chmod +x gradlew
shell: bash
8 changes: 8 additions & 0 deletions .github/templates/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: test

runs:
using: "composite"
steps:
- name: Run unit tests
run: ./gradlew testDebugUnitTest
shell: bash
12 changes: 12 additions & 0 deletions .github/templates/upload/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: build

runs:
using: "composite"
steps:
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: HttpCodesCats
path: |
./app/build/outputs/**/*.apk
./app/build/outputs/**/*signed.aab
22 changes: 22 additions & 0 deletions .github/workflows/android-test-assemble-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Android test, run quality, build and publish on Firebase

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: "./.github/templates/setup"
- name: Run tests
uses: "./.github/templates/test"
- name: Build APK
uses: "./.github/templates/assemble"
- name: Upload on Github
uses: "./.github/templates/upload"
27 changes: 27 additions & 0 deletions .github/workflows/android-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Android test

on:
workflow_dispatch:
schedule:
- cron: "30 4 * * 1-5"
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: "./.github/templates/setup"
- name: Run tests
uses: "./.github/templates/test"
13 changes: 8 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.io.FileInputStream
import java.util.Properties

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.hilt)
alias(libs.plugins.google.services)
Expand All @@ -23,12 +23,12 @@ android {
}
}
namespace = "com.github.corentinc.httpcodescats"
compileSdk = 35
compileSdk = 36

defaultConfig {
applicationId = "com.github.corentinc.httpcodescats"
minSdk = 26
targetSdk = 35
targetSdk = 36
versionCode = 6
versionName = "1.1.2"

Expand All @@ -54,8 +54,10 @@ android {
targetCompatibility = JavaVersion.VERSION_21
}

kotlinOptions {
jvmTarget = "21"
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_21
}
}

testOptions {
Expand Down Expand Up @@ -92,6 +94,7 @@ dependencies {
ksp(libs.hilt.android.compiler)
implementation(libs.glide)
implementation(libs.customTabs)
implementation(libs.material.icons.core)

// Firebase
implementation(platform(libs.firebase.bom))
Expand Down
Binary file added app/keystore.jks
Binary file not shown.
3 changes: 3 additions & 0 deletions app/keystore.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
storePassword=android
keyPassword=android
keyAlias=androiddebugkey
29 changes: 29 additions & 0 deletions app/src/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "282921055641",
"project_id": "http-codes-cats",
"storage_bucket": "http-codes-cats.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:282921055641:android:65c87b1e99c1c3a4214f08",
"android_client_info": {
"package_name": "com.github.corentinc.httpcodescats"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyA7RMOV5qaPaGX1o3unL-Dk48zpdxAuuuY"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fun LinkText(
val intent = CustomTabsIntent.Builder()
.build()
intent.launchUrl(context, Uri.parse(it.item))
} catch (exception: ActivityNotFoundException) {
} catch (_: ActivityNotFoundException) {
Toast.makeText(context, "Please install Chrome", Toast.LENGTH_LONG).show()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ private const val THREE_HUNDRED_MILLISECONDS_DURATION = 300

val enterTransition: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition?) = {
slideIntoContainer(
towards = AnimatedContentTransitionScope.SlideDirection.Companion.Left,
towards = AnimatedContentTransitionScope.SlideDirection.Left,
animationSpec = tween(THREE_HUNDRED_MILLISECONDS_DURATION)
)
}

val popEnterTransition: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition?) =
{
slideIntoContainer(
towards = AnimatedContentTransitionScope.SlideDirection.Companion.Right,
towards = AnimatedContentTransitionScope.SlideDirection.Right,
animationSpec = tween(THREE_HUNDRED_MILLISECONDS_DURATION)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi
import com.bumptech.glide.integration.compose.GlideImage
import com.bumptech.glide.integration.compose.placeholder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi
import com.bumptech.glide.integration.compose.GlideImage
import com.bumptech.glide.integration.compose.placeholder
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// 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.jetbrains.kotlin.android) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.google.services) apply false
Expand Down
19 changes: 14 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
android.enableJetifier=false
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# 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
android.nonFinalResIds=true
org.gradle.daemon=false
android.defaults.buildfeatures.resvalues=false
android.sdk.defaultTargetSdkToCompileSdkIfUnset=true
android.enableAppCompileTimeRClass=true
android.usesSdkInManifest.disallowed=true
android.uniquePackageNames=true
android.dependency.useConstraints=true
android.r8.strictFullModeForKeepRules=true
android.r8.optimizedResourceShrinking=true
android.builtInKotlin=true
android.newDsl=true
android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false
41 changes: 21 additions & 20 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
[versions]
agp = "8.10.0"
hiltAndroid = "2.56.2"
hiltNavigationCompose = "1.2.0"
kotlin = "2.1.21"
coreKtx = "1.16.0"
lifecycleRuntimeKtx = "2.9.0"
activityCompose = "1.10.1"
composeBom = "2025.05.00"
navigationCompose = "2.9.0"
glide = "1.0.0-beta01"
customTabs = "1.8.0"
googleServices = "4.4.2"
firebaseBom = "33.13.0"
firebaseCrashlytics = "3.0.3"
ksp = "2.1.21-2.0.1"
mockk = "1.14.2"
junitJupiter = "5.12.0"
assertJCoreVersion = "3.27.3"
agp = "9.0.0"
hiltAndroid = "2.59.1"
hiltNavigationCompose = "1.3.0"
koltinPLuginCompose = "2.3.20-Beta2"
coreKtx = "1.17.0"
lifecycleRuntimeKtx = "2.10.0"
activityCompose = "1.12.3"
composeBom = "2026.01.01"
navigationCompose = "2.9.4"
glide = "1.0.0-beta08"
customTabs = "1.9.0"
googleServices = "4.4.4"
firebaseBom = "34.9.0"
firebaseCrashlytics = "3.0.6"
ksp = "2.3.5"
mockk = "1.14.9"
junitJupiter = "6.0.2"
assertJCoreVersion = "3.27.7"
coroutinesTestVersion = "1.10.2"
materialIcon = "1.7.8"

[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
Expand Down Expand Up @@ -46,11 +47,11 @@ junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter"}
junit-platform-launcher = { group = "org.junit.platform", name = "junit-platform-launcher"}
assertJCore = { group = "org.assertj", name = "assertj-core", version.ref = "assertJCoreVersion" }
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutinesTestVersion" }
material-icons-core = { group = "androidx.compose.material", name = "material-icons-core", version.ref = "materialIcon" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "koltinPLuginCompose" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hiltAndroid" }
google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebaseCrashlytics" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jul 24 08:21:39 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists