From fa8b4a469903239cc8ae259a0884a0bfba3d5d4b Mon Sep 17 00:00:00 2001 From: rhenwinch Date: Fri, 9 Feb 2024 23:04:09 +0800 Subject: [PATCH] fix: plugin/provider stubs not included on jar file --- .github/workflows/Build.yml | 14 ++++++-------- app/build.gradle.kts | 18 ++++++++---------- build.gradle.kts | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 7eb338315..b70e07db1 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -34,15 +34,10 @@ jobs: java-version: 17 distribution: adopt - - name: Build release and prerelease + - name: Build release artifacts uses: gradle/gradle-command-action@v2 with: - arguments: :app:assembleRelease :app:assemblePrerelease build androidSourcesJar - - - name: Make JAR - uses: gradle/gradle-command-action@v2 - with: - arguments: makeJar + arguments: :app:assembleRelease :app:assemblePrerelease makeJar fatJar - name: Sign release APK uses: r0adkll/sign-android-release@v1 @@ -85,6 +80,9 @@ jobs: ### Changes + ### Known issues + - TV focus crashes. Compose TV is bugged af; we wait til the new update. + --- ##### The `prerelease` apk is similar to release but for _debugging_ purposes only. Use this if you want to test the latest features without messing up your authentic release data. --- @@ -98,7 +96,7 @@ jobs: files: | flixclusive-release.apk flixclusive-prerelease.apk - app/build/libs/app-sources.jar + app/build/libs/Flixclusive-fat.jar app/build/classes.jar draft: false prerelease: true diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7cb6d3b07..370ce1f2a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -128,14 +128,12 @@ dependencies { implementation(libs.material) } -tasks.register("androidSourcesJar", Jar::class) { - archiveClassifier.set("sources") - from("src/main/java", "src/main/kotlin") -} - -// For the plugins-system +// Get the JAR classes for the plugins-system tasks.register("makeJar", Copy::class) { - from("build/intermediates/compile_app_classes_jar/prerelease") - into("build") - include("classes.jar") -} \ No newline at end of file + dependsOn("build") + doLast { + from("app/build/intermediates/compile_app_classes_jar/prerelease") + into("app/build") + include("classes.jar") + } +} diff --git a/build.gradle.kts b/build.gradle.kts index 97b12d9f9..d76fc09a9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,3 +18,17 @@ plugins { alias(libs.plugins.room) apply false id("com.osacky.doctor") version "0.9.1" } + +// Generate a mf FAT AHH JAR! +tasks.register("fatJar") { + archiveBaseName.set("fat") + archiveClassifier.set("sources") + destinationDirectory.set(File("app/build/libs")) + + subprojects.forEach { project -> + if (project.subprojects.size == 0) { + val projectPath = "." + project.path.replace(":", "/") + from("$projectPath/src/main/kotlin", "$projectPath/src/main/java") + } + } +} \ No newline at end of file