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
60 changes: 55 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ taskList: cleanBuild
# Generate compose stability report
reportCompose: manualClean
@echo "Compose Compiler Report"
$(GRADLEW) assembleDebug -PcomposeCompilerReports=true --rerun-tasks
$(GRADLEW) assembleDebug -PenableComposeCompilerMetrics=true -PenableComposeCompilerReports=true
@echo "✅ Done!"

# Run Android build
Expand All @@ -41,16 +41,66 @@ buildAndroid: cleanBuild
$(GRADLEW) androidApp:app:installDebug
@echo "✅ Done!"

# Run IOS build
buildIOS: cleanBuild
@echo "IOS build"
chmod +x ./scripts/ios_script.sh
./scripts/ios_script.sh
@echo "✅ Done!"

# Run Android Ui test
testUiAndroid: cleanBuild
@echo "Android UI test"
$(GRADLEW) androidApp:app:connectedDebugAndroidTest
@echo "✅ Done!"

# Run Desktop build
buildDesktop: cleanBuild
@echo "Desktop build"
$(GRADLEW) :desktopapp:run
@echo "✅ Done!"

# Run web build
buildWeb: cleanBuild
@echo "Web build"
$(GRADLEW) webApp:js:wasmJsBrowserDevelopmentRun
# Run Desktop Ui test
testUiDesktop: cleanBuild
@echo "Desktop UI test"
$(GRADLEW) :desktopapp:jvmTest
@echo "✅ Done!"

# Run Desktop hot reload build
buildHotDesktop: clear
@echo "Desktop Hot reload build"
$(GRADLEW) :desktopapp:hotRunJvm --auto
@echo "✅ Done!"

# Run wasm build
buildWasmWeb: cleanBuild
@echo "Web Wasm build"
$(GRADLEW) webApp:wasm:wasmJsBrowserDevelopmentRun
@echo "✅ Done!"

# Run wasm UI test
testUiWasmWeb: cleanBuild
@echo "Web wasm UI test"
$(GRADLEW) webApp:wasm:wasmJsBrowserTest
@echo "✅ Done!"

# Run js build
buildJsWeb: cleanBuild
@echo "Web JS build"
$(GRADLEW) webApp:js:jsBrowserDevelopmentRun
@echo "✅ Done!"

# Run JS UI test
testUiJsWeb: cleanBuild
@echo "Web Js UI test"
$(GRADLEW) webApp:wasm:jsBrowserTest
@echo "✅ Done!"


# Run wasm UI test
testUiJsWeb: cleanBuild
@echo "Web Js UI test"
$(GRADLEW) iosApp:iosSimulatorArm64Test
@echo "✅ Done!"

# Run All test
Expand Down
3 changes: 3 additions & 0 deletions androidApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ composeCompiler {
dependencies {
implementation(projects.sharedCode)
implementation(libs.androidx.activity.compose)

androidTestImplementation(libs.androidx.uitest.junit4)
debugImplementation(libs.androidx.uitest.testManifest)
}
52 changes: 52 additions & 0 deletions androidApp/tv/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.compose.multiplatform)
}

android {
namespace = "dev.reprator.github"
compileSdk = libs.versions.android.compileSdk.get().toInt()

defaultConfig {
applicationId = "dev.reprator.github"
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 1
versionName = "1.0"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_21
}
}
}

composeCompiler {
reportsDestination = layout.buildDirectory.dir("andorid_tv_compose_compiler")
metricsDestination = layout.buildDirectory.dir("android_tv_compose_metric")
stabilityConfigurationFile.set(rootProject.file("compose-stability.conf"))
}

dependencies {
implementation(projects.sharedCode)
implementation(libs.androidx.activity.compose)
}
62 changes: 62 additions & 0 deletions androidApp/tv/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This is a configuration file for R8

-verbose
-allowaccessmodification
-repackageclasses

# Note that you cannot just include these flags in your own
# configuration file; if you are including this file, optimization
# will be turned off. You'll need to either edit this file, or
# duplicate the contents of this file and remove the include of this
# file from your project's proguard.config path property.

# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}

# We only need to keep ComposeView
-keep public class androidx.compose.ui.platform.ComposeView {
public <init>(android.content.Context, android.util.AttributeSet);
}

# For enumeration classes
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

# AndroidX + support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**
-dontwarn androidx.**

-keepattributes SourceFile,
LineNumberTable,
RuntimeVisibleAnnotations,
RuntimeVisibleParameterAnnotations,
RuntimeVisibleTypeAnnotations,
AnnotationDefault

-renamesourcefileattribute SourceFile

# Dagger
-dontwarn com.google.errorprone.annotations.*

# Retain the generic signature of retrofit2.Call until added to Retrofit.
# Issue: https://github.com/square/retrofit/issues/3580.
# Pull request: https://github.com/square/retrofit/pull/3579.
-keep,allowobfuscation,allowshrinking class retrofit2.Call

# See https://issuetracker.google.com/issues/265188224
-keep,allowshrinking class * extends androidx.compose.ui.node.ModifierNodeElement {}

# Using ktor client in Android has missing proguard rule
# See https://youtrack.jetbrains.com/issue/KTOR-5528
-dontwarn org.slf4j.**
-dontwarn org.slf4j.impl.StaticLoggerBinder
35 changes: 35 additions & 0 deletions androidApp/tv/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<uses-feature
android:name="android.software.leanback"
android:required="false" />

<application
android:name=".GithubApp"
android:allowBackup="true"
android:banner="@mipmap/ic_launcher"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@android:style/Theme.Material.Light.NoActionBar">
<activity
android:exported="true"
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
12 changes: 12 additions & 0 deletions androidApp/tv/src/main/kotlin/dev/reprator/github/GithubApp.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package dev.reprator.github

import android.app.Application
import dev.reprator.github.di.inject.component.AndroidApplicationComponent
import dev.reprator.github.di.inject.component.create

class GithubApp : Application() {

val component: AndroidApplicationComponent by lazy {
AndroidApplicationComponent.create(this)
}
}
29 changes: 29 additions & 0 deletions androidApp/tv/src/main/kotlin/dev/reprator/github/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package dev.reprator.github

import android.content.Context
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import dev.reprator.github.di.inject.component.AndroidActivityComponent
import dev.reprator.github.di.inject.component.AndroidApplicationComponent
import dev.reprator.github.di.inject.component.create
import dev.reprator.github.root.App

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)

val applicationComponent = AndroidApplicationComponent.from(this)
val component = AndroidActivityComponent.create(this, applicationComponent)

setContent {
App(component.routeFactories)
}
}
}

private fun AndroidApplicationComponent.Companion.from(context: Context): AndroidApplicationComponent {
return (context.applicationContext as GithubApp).component
}
30 changes: 30 additions & 0 deletions androidApp/tv/src/main/res/drawable-v24/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
Loading