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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
**Changed**
- Replace `com.jakewharton.diffuse.io.Size` with `me.saket.bytesize.ByteSize` in the APIs.
- Eliminate `data class` from public APIs.
- Show compressed columns when compressed entries present.

**Fixed**
- Significantly improve `.jar` diff performance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.jakewharton.diffuse.report.text.AabDiffTextReport

internal class AabDiff(val oldAab: Aab, val newAab: Aab) : BinaryDiff {
inner class ModuleDiff(val oldModule: Aab.Module, val newModule: Aab.Module) {
val archive = ArchiveFilesDiff(oldModule.files, newModule.files, includeCompressed = false)
val archive = ArchiveFilesDiff(oldModule.files, newModule.files)
val dex =
DexDiff(
oldModule.dexes.map { it.withMapping(oldAab.apiMapping) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal class AarDiff(
val newAar: Aar,
val newMapping: ApiMapping,
) : BinaryDiff {
val archive = ArchiveFilesDiff(oldAar.files, newAar.files, includeCompressed = false)
val archive = ArchiveFilesDiff(oldAar.files, newAar.files)
val jars = JarsDiff(oldAar.jars, oldMapping, newAar.jars, newMapping)
val manifest = AndroidManifestDiff(oldAar.manifest, newAar.manifest)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import me.saket.bytesize.binaryBytes
internal class ArchiveFilesDiff(
val oldFiles: ArchiveFiles,
val newFiles: ArchiveFiles,
val includeCompressed: Boolean = true,
val includeCompressed: Boolean = oldFiles.isCompressed || newFiles.isCompressed,
) {
data class Change(
val path: String,
Expand Down Expand Up @@ -235,3 +235,6 @@ internal fun ArchiveFilesDiff.toDetailReport() = buildString {
.renderText()
)
}

private val ArchiveFiles.isCompressed: Boolean
get() = values.any { it.isCompressed }
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal class JarDiff(
val newJar: Jar,
val newMapping: ApiMapping,
) : BinaryDiff {
val archive = ArchiveFilesDiff(oldJar.files, newJar.files, includeCompressed = false)
val archive = ArchiveFilesDiff(oldJar.files, newJar.files)
val jars = JarsDiff(listOf(oldJar), oldMapping, listOf(newJar), newMapping)

val changed = jars.changed || archive.changed
Expand Down