Skip to content

Commit

Permalink
Merge pull request #324 from thomaskioko/minor-improvements
Browse files Browse the repository at this point in the history
Minor Tooling improvements
  • Loading branch information
thomaskioko authored Oct 24, 2024
2 parents f6573b9 + 7c09dce commit 8c83a04
Show file tree
Hide file tree
Showing 36 changed files with 286 additions and 802 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true

env:
JDK_VERSION: 17
JDK_VERSION: 21
DISTRIBUTION: 'zulu'
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 120

Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
id: screenshotsrecord
if: steps.screenshotsverify.outcome == 'failure' && github.event_name == 'pull_request'
run: |
./gradlew recordRoborazziDevDebug
./gradlew recordRoborazziDebug
- name: Push new screenshots if available
uses: stefanzweifel/git-auto-commit-action@v5
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:

common_test:
runs-on: macos-latest

steps:
- name: checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -209,12 +209,12 @@ jobs:
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Setup Xcode

- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.4
xcode-version: 16.0

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -228,8 +228,8 @@ jobs:
run: bundle exec fastlane build_tvmaniac

- name: Clear Derived Data
run: bundle exec fastlane clear_derived_data_lane
run: bundle exec fastlane clear_derived_data_lane

# - name: Run UI Tests
# run: bundle exec fastlane ui_tests

Expand All @@ -238,7 +238,7 @@ jobs:
if: failure()
with:
name: test-results
path: fastlane/test_output
path: fastlane/test_output

create-release:
needs: [build-android, android_lint, android_screenshot_test, common_test, build-ios, spotless, jvm_test, ]
Expand All @@ -250,7 +250,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'zulu'

- name: Create release
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

gem 'fastlane', '~> 2.225.0'
gem "fastlane"

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ PLATFORMS
ruby

DEPENDENCIES
fastlane (~> 2.225.0)
fastlane
fastlane-plugin-test_center

BUNDLED WITH
Expand Down
23 changes: 1 addition & 22 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,37 +1,17 @@
import com.thomaskioko.tvmaniac.extensions.TvManiacBuildType

plugins {
alias(libs.plugins.tvmaniac.application)
alias(libs.plugins.ksp)
}

android {
namespace = "com.thomaskioko.tvmaniac"

defaultConfig {
applicationId = "com.thomaskioko.tvmaniac"
versionCode = 1
versionName = "1.0"
}

buildTypes { debug { applicationIdSuffix = TvManiacBuildType.DEBUG.applicationIdSuffix } }

packaging {
resources {
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
excludes.add("/META-INF/versions/9/previous-compilation-data.bin")
}
}
}

dependencies {
implementation(projects.android.designsystem)
implementation(projects.android.ui.discover)
implementation(projects.android.ui.library)
implementation(projects.android.ui.home)
implementation(projects.android.ui.moreShows)
implementation(projects.android.ui.search)
implementation(projects.android.ui.seasonDetails)
implementation(projects.android.ui.settings)
implementation(projects.android.ui.showDetails)
implementation(projects.android.ui.trailers)
implementation(projects.shared)
Expand Down Expand Up @@ -97,7 +77,6 @@ dependencies {
implementation(libs.androidx.core.core)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.icons)
implementation(libs.appauth)

implementation(libs.decompose.decompose)
Expand Down
28 changes: 28 additions & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-verbose
-allowaccessmodification
-repackageclasses

# 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.**

-dontwarn org.slf4j.impl.StaticLoggerBinder

# ktor https://github.com/ktorio/ktor/issues/1354
-keepclassmembers class io.ktor.** { volatile <fields>; }

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

-keepattributes SourceFile,
LineNumberTable,
InnerClasses,
*Annotation*,
AnnotationDefault

-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import com.arkivanov.decompose.extensions.compose.stack.Children
import com.thomaskioko.tvmaniac.home.HomeContent
import com.thomaskioko.tvmaniac.navigation.RootComponent
import com.thomaskioko.tvmaniac.seasondetails.ui.SeasonDetailsScreen
import com.thomaskioko.tvmaniac.tabs.HomeContent
import com.thomaskioko.tvmaniac.ui.moreshows.MoreShowsScreen
import com.thomaskioko.tvmaniac.ui.showdetails.ShowDetailsScreen
import com.thomaskioko.tvmaniac.ui.trailers.videoplayer.TrailersScreen
Expand Down
19 changes: 19 additions & 0 deletions android/ui/home/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
plugins { alias(libs.plugins.tvmaniac.compose.library) }

android { namespace = "com.thomaskioko.tvmaniac.ui.home" }

dependencies {
api(projects.presentation.home)

implementation(projects.android.designsystem)
implementation(projects.android.resources)

implementation(projects.android.ui.discover)
implementation(projects.android.ui.library)
implementation(projects.android.ui.search)
implementation(projects.android.ui.settings)

implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.runtime)
implementation(libs.decompose.extensions.compose)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.thomaskioko.tvmaniac.tabs
package com.thomaskioko.tvmaniac.home

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -8,30 +8,27 @@ import androidx.compose.material.icons.outlined.Movie
import androidx.compose.material.icons.outlined.Search
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material.icons.outlined.VideoLibrary
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.arkivanov.decompose.extensions.compose.stack.Children
import com.thomaskioko.tvmaniac.compose.components.ThemePreviews
import com.thomaskioko.tvmaniac.compose.components.TvManiacBottomNavigationItem
import com.thomaskioko.tvmaniac.compose.components.TvManiacNavigationBar
import com.thomaskioko.tvmaniac.compose.theme.TvManiacTheme
import com.thomaskioko.tvmaniac.presentation.home.HomeComponent
import com.thomaskioko.tvmaniac.presentation.home.HomeComponent.Child.Discover
import com.thomaskioko.tvmaniac.presentation.home.HomeComponent.Child.Library
import com.thomaskioko.tvmaniac.presentation.home.HomeComponent.Child.Search
import com.thomaskioko.tvmaniac.presentation.home.HomeComponent.Child.Settings
import com.thomaskioko.tvmaniac.resources.R
import com.thomaskioko.tvmaniac.search.ui.SearchScreen
import com.thomaskioko.tvmaniac.ui.search.SearchScreen
import com.thomaskioko.tvmaniac.ui.discover.DiscoverScreen
import com.thomaskioko.tvmaniac.ui.library.LibraryScreen
import com.thomaskioko.tvmaniac.ui.settings.SettingsScreen

@Composable
internal fun HomeContent(
fun HomeContent(
component: HomeComponent,
modifier: Modifier = Modifier,
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.thomaskioko.tvmaniac.search.ui
package com.thomaskioko.tvmaniac.ui.search

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.thomaskioko.tvmaniac.search.ui
package com.thomaskioko.tvmaniac.ui.search

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
Expand Down
35 changes: 25 additions & 10 deletions tooling/plugins/build.gradle.kts → build-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`kotlin-dsl`
}

group = "com.thomaskioko.tvmaniac.plugins"

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
val javaTarget: String = libs.versions.java.target.get()

tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget = JvmTarget.fromTarget(javaTarget)
}
}

tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = javaTarget
targetCompatibility = javaTarget
}

toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
tasks {
validatePlugins {
enableStricterValidation = true
failOnWarning = true
}
}

dependencies {
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.compose.compiler.gradlePlugin)
compileOnly(libs.spotless.plugin)
compileOnly(libs.dependency.analysis.gradlePlugin)
compileOnly(libs.gradledoctor.plugin)
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.spotless.plugin)
}

gradlePlugin {
Expand Down Expand Up @@ -50,9 +65,9 @@ gradlePlugin {
implementationClass = "com.thomaskioko.tvmaniac.plugins.GitHooksPlugin"
}

register("dependency-analysis") {
id = "plugin.tvmaniac.dependency-analysis"
implementationClass = "com.thomaskioko.tvmaniac.plugins.DependencyAnalysisPlugin"
register("root") {
id = "plugin.tvmaniac.root"
implementationClass = "com.thomaskioko.tvmaniac.plugins.RootPlugin"
}
}
}
25 changes: 25 additions & 0 deletions build-plugins/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositories {
google {
content {
includeGroupByRegex(".*google.*")
includeGroupByRegex(".*android.*")
}
}
mavenCentral()
gradlePluginPortal()
}

versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}

rootProject.name = "build-plugins"

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.thomaskioko.tvmaniac.extensions

import com.android.build.api.variant.AndroidComponentsExtension
import com.android.build.api.variant.HasUnitTestBuilder
import com.android.build.gradle.BaseExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Project
Expand All @@ -24,7 +26,16 @@ fun Project.configureAndroid() {

packagingOptions {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
excludes.add("/META-INF/versions/9/previous-compilation-data.bin")
}
}
}

androidComponents {
beforeVariants(selector().withBuildType("release")) { variantBuilder ->
(variantBuilder as? HasUnitTestBuilder)?.apply {
enableUnitTest = false
}
}
}
Expand All @@ -36,3 +47,6 @@ fun Project.configureAndroid() {

fun Project.android(action: BaseExtension.() -> Unit) = extensions.configure<BaseExtension>(action)

private fun Project.androidComponents(action: AndroidComponentsExtension<*, *, *>.() -> Unit) {
extensions.configure(AndroidComponentsExtension::class.java, action)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.thomaskioko.tvmaniac.plugins
import com.android.build.gradle.LibraryExtension
import com.thomaskioko.tvmaniac.extensions.Versions
import com.thomaskioko.tvmaniac.extensions.configureAndroid
import com.thomaskioko.tvmaniac.extensions.configureFlavors
import com.thomaskioko.tvmaniac.extensions.configureKotlinJvm
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand All @@ -14,6 +13,7 @@ class AndroidLibraryPlugin : Plugin<Project> {
with(target) {
with(pluginManager) {
apply("com.android.library")
apply("com.autonomousapps.dependency-analysis")
}

extensions.configure<LibraryExtension> {
Expand All @@ -22,7 +22,6 @@ class AndroidLibraryPlugin : Plugin<Project> {

configureKotlinJvm()
configureAndroid()
configureFlavors(this)
}
}
}
Expand Down
Loading

0 comments on commit 8c83a04

Please sign in to comment.