Compare commits

...

5 Commits

Author SHA1 Message Date
AntsyLich
8f9a325895 Use feature flags in compose compiler plugin
And slight cleanup
2024-08-30 13:55:11 +06:00
renovate[bot]
f74071ab0a fix(deps): update dependency com.android.tools.build:gradle to v8.6.0 (#1178)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-30 11:37:56 +06:00
renovate[bot]
7fb3ef48e4 fix(deps): update dependency com.android.tools:desugar_jdk_libs to v2.1.1 (#1172)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-30 11:37:38 +06:00
renovate[bot]
1837faa573 fix(deps): update serialization.version to v1.7.2 (#1173)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-30 11:37:22 +06:00
AntsyLich
518abf032c Remove legacy broken source and history backup 2024-08-30 11:36:34 +06:00
10 changed files with 14 additions and 38 deletions

View File

@@ -7,7 +7,7 @@ import kotlinx.serialization.protobuf.ProtoNumber
data class Backup(
@ProtoNumber(1) val backupManga: List<BackupManga>,
@ProtoNumber(2) var backupCategories: List<BackupCategory> = emptyList(),
@ProtoNumber(100) var backupBrokenSources: List<BrokenBackupSource> = emptyList(),
// @ProtoNumber(100) var backupBrokenSources, legacy source model with non-compliant proto number,
@ProtoNumber(101) var backupSources: List<BackupSource> = emptyList(),
@ProtoNumber(104) var backupPreferences: List<BackupPreference> = emptyList(),
@ProtoNumber(105) var backupSourcePreferences: List<BackupSourcePreferences> = emptyList(),

View File

@@ -18,15 +18,3 @@ data class BackupHistory(
)
}
}
@Deprecated("Replaced with BackupHistory. This is retained for legacy reasons.")
@Serializable
data class BrokenBackupHistory(
@ProtoNumber(0) var url: String,
@ProtoNumber(1) var lastRead: Long,
@ProtoNumber(2) var readDuration: Long = 0,
) {
fun toBackupHistory(): BackupHistory {
return BackupHistory(url, lastRead, readDuration)
}
}

View File

@@ -32,7 +32,7 @@ data class BackupManga(
// Bump by 100 for values that are not saved/implemented in 1.x but are used in 0.x
@ProtoNumber(100) var favorite: Boolean = true,
@ProtoNumber(101) var chapterFlags: Int = 0,
@ProtoNumber(102) var brokenHistory: List<BrokenBackupHistory> = emptyList(),
// @ProtoNumber(102) var brokenHistory, legacy history model with non-compliant proto number
@ProtoNumber(103) var viewer_flags: Int? = null,
@ProtoNumber(104) var history: List<BackupHistory> = emptyList(),
@ProtoNumber(105) var updateStrategy: UpdateStrategy = UpdateStrategy.ALWAYS_UPDATE,

View File

@@ -8,11 +8,3 @@ data class BackupSource(
@ProtoNumber(1) var name: String = "",
@ProtoNumber(2) var sourceId: Long,
)
@Serializable
data class BrokenBackupSource(
@ProtoNumber(0) var name: String = "",
@ProtoNumber(1) var sourceId: Long,
) {
fun toBackupSource() = BackupSource(name, sourceId)
}

View File

@@ -67,7 +67,7 @@ class BackupRestorer(
val backup = BackupDecoder(context).decode(uri)
// Store source mapping for error messages
val backupMaps = backup.backupSources + backup.backupBrokenSources.map { it.toBackupSource() }
val backupMaps = backup.backupSources
sourceMapping = backupMaps.associate { it.sourceId to it.name }
if (options.libraryEntries) {

View File

@@ -71,7 +71,7 @@ class MangaRestorer(
chapters = backupManga.chapters,
categories = backupManga.categories,
backupCategories = backupCategories,
history = backupManga.history + backupManga.brokenHistory.map { it.toBackupHistory() },
history = backupManga.history,
tracks = backupManga.tracking,
excludedScanlators = backupManga.excludedScanlators,
)

View File

@@ -14,6 +14,7 @@ import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.the
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.File
@@ -75,25 +76,20 @@ internal fun Project.configureCompose(commonExtension: CommonExtension<*, *, *,
}
extensions.configure<ComposeCompilerGradlePluginExtension> {
// Enable strong skipping mode
enableStrongSkippingMode.set(true)
// Enable experimental compiler opts
// https://developer.android.com/jetpack/androidx/releases/compose-compiler#1.5.9
enableNonSkippingGroupOptimization.set(true)
featureFlags.set(setOf(ComposeFeatureFlag.OptimizeNonSkippingGroups))
val enableMetrics = project.providers.gradleProperty("enableComposeCompilerMetrics").orNull.toBoolean()
val enableReports = project.providers.gradleProperty("enableComposeCompilerReports").orNull.toBoolean()
val rootProjectDir = rootProject.layout.buildDirectory.asFile.get()
val rootBuildDir = rootProject.layout.buildDirectory.asFile.get()
val relativePath = projectDir.relativeTo(rootDir)
if (enableMetrics) {
val buildDirPath = rootProjectDir.resolve("compose-metrics").resolve(relativePath)
metricsDestination.set(buildDirPath)
rootBuildDir.resolve("compose-metrics").resolve(relativePath).let(metricsDestination::set)
}
if (enableReports) {
val buildDirPath = rootProjectDir.resolve("compose-reports").resolve(relativePath)
reportsDestination.set(buildDirPath)
rootBuildDir.resolve("compose-reports").resolve(relativePath).let(reportsDestination::set)
}
}

View File

@@ -1,5 +1,5 @@
[versions]
agp_version = "8.5.2"
agp_version = "8.6.0"
lifecycle_version = "2.8.4"
paging_version = "3.3.2"
interpolator_version = "1.0.0"

View File

@@ -1,6 +1,6 @@
[versions]
kotlin_version = "2.0.20"
serialization_version = "1.7.1"
serialization_version = "1.7.2"
xml_serialization_version = "0.86.3"
[libraries]

View File

@@ -12,7 +12,7 @@ spotless = "6.25.0"
ktlint-core = "1.3.1"
[libraries]
desugar = "com.android.tools:desugar_jdk_libs:2.1.0"
desugar = "com.android.tools:desugar_jdk_libs:2.1.1"
android-shortcut-gradle = "com.github.zellius:android-shortcut-gradle-plugin:0.1.2"
google-services-gradle = "com.google.gms:google-services:4.4.2"