Skip to content

Support diffing Kotlin metadata versions for classes - #542

Open
Goooler wants to merge 1 commit into
JakeWharton:trunkfrom
Goooler:diff-meta-data-version
Open

Support diffing Kotlin metadata versions for classes#542
Goooler wants to merge 1 commit into
JakeWharton:trunkfrom
Goooler:diff-meta-data-version

Conversation

@Goooler

@Goooler Goooler commented Aug 8, 2026

Copy link
Copy Markdown
Contributor
OLD: old.jar
NEW: new.jar

       │         compressed         │        uncompressed         
       ├──────────┬─────────┬───────┼──────────┬──────────┬───────
 JAR   │ old      │ new     │ diff  │ old      │ new      │ diff  
───────┼──────────┼─────────┼───────┼──────────┼──────────┼───────
 class │    876 B │   883 B │  +7 B │ 1.24 KiB │ 1.26 KiB │ +12 B 
 other │    628 B │   653 B │ +25 B │     72 B │     72 B │   0 B 
───────┼──────────┼─────────┼───────┼──────────┼──────────┼───────
 total │ 1.47 KiB │ 1.5 KiB │ +32 B │ 1.31 KiB │ 1.33 KiB │ +12 B 

 CLASSES │ old │ new │ diff      
─────────┼─────┼─────┼───────────
 classes │   1 │   1 │ 0 (+0 -0) 
 methods │   5 │   5 │ 0 (+1 -1) 
  fields │   1 │   1 │ 0 (+0 -0) 

=================
====   JAR   ====
=================

    compressed     │   uncompressed   │                                               
──────────┬────────┼──────────┬───────┤                                               
 size     │ diff   │ size     │ diff  │ path                                          
──────────┼────────┼──────────┼───────┼───────────────────────────────────────────────
    204 B │ +204 B │     47 B │ +47 B │ + META-INF/org.example_untitled.kotlin_module 
          │ -179 B │          │ -47 B │ - META-INF/untitled.kotlin_module             
    883 B │   +7 B │ 1.26 KiB │ +12 B │ ∆ org/example/MainKt.class                    
──────────┼────────┼──────────┼───────┼───────────────────────────────────────────────
 1.06 KiB │  +32 B │  1.3 KiB │ +12 B │ (total)                                       


=====================
====   CLASSES   ====
=====================

BYTECODE VERSIONS:

   old │ new │ diff      
  ─────┼─────┼───────────
   1   │ 1   │ 0 (+1 -1) 
  
  + org.example.MainKt: 65
  
  - org.example.MainKt: 69
  

KOTLIN METADATA VERSIONS:

   old │ new │ diff      
  ─────┼─────┼───────────
   1   │ 1   │ 0 (+1 -1) 
  
  + org.example.MainKt: 2.4.0
  
  - org.example.MainKt: 2.3.0
  

METHODS:

   old │ new │ diff      
  ─────┼─────┼───────────
   5   │ 5   │ 0 (+1 -1) 
  
  + org.example.MainKt main3()
  
  - org.example.MainKt main2()

Closes #541.

```
OLD: old.jar
NEW: new.jar

       │         compressed         │        uncompressed
       ├──────────┬─────────┬───────┼──────────┬──────────┬───────
 JAR   │ old      │ new     │ diff  │ old      │ new      │ diff
───────┼──────────┼─────────┼───────┼──────────┼──────────┼───────
 class │    876 B │   883 B │  +7 B │ 1.24 KiB │ 1.26 KiB │ +12 B
 other │    628 B │   653 B │ +25 B │     72 B │     72 B │   0 B
───────┼──────────┼─────────┼───────┼──────────┼──────────┼───────
 total │ 1.47 KiB │ 1.5 KiB │ +32 B │ 1.31 KiB │ 1.33 KiB │ +12 B

 CLASSES │ old │ new │ diff
─────────┼─────┼─────┼───────────
 classes │   1 │   1 │ 0 (+0 -0)
 methods │   5 │   5 │ 0 (+1 -1)
  fields │   1 │   1 │ 0 (+0 -0)

=================
====   JAR   ====
=================

    compressed     │   uncompressed   │
──────────┬────────┼──────────┬───────┤
 size     │ diff   │ size     │ diff  │ path
──────────┼────────┼──────────┼───────┼───────────────────────────────────────────────
    204 B │ +204 B │     47 B │ +47 B │ + META-INF/org.example_untitled.kotlin_module
          │ -179 B │          │ -47 B │ - META-INF/untitled.kotlin_module
    883 B │   +7 B │ 1.26 KiB │ +12 B │ ∆ org/example/MainKt.class
──────────┼────────┼──────────┼───────┼───────────────────────────────────────────────
 1.06 KiB │  +32 B │  1.3 KiB │ +12 B │ (total)

=====================
====   CLASSES   ====
=====================

BYTECODE VERSIONS:

   old │ new │ diff
  ─────┼─────┼───────────
   1   │ 1   │ 0 (+1 -1)

  + org.example.MainKt: 65

  - org.example.MainKt: 69

KOTLIN METADATA VERSIONS:

   old │ new │ diff
  ─────┼─────┼───────────
   1   │ 1   │ 0 (+1 -1)

  + org.example.MainKt: 2.4.0

  - org.example.MainKt: 2.3.0

METHODS:

   old │ new │ diff
  ─────┼─────┼───────────
   5   │ 5   │ 0 (+1 -1)

  + org.example.MainKt main3()

  - org.example.MainKt main2()
```
@Goooler
Goooler force-pushed the diff-meta-data-version branch from 421204d to 0e5d717 Compare August 8, 2026 15:37
@Goooler

Goooler commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

I'll probably prettify the outputs in #491.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show @Metadata diffs

1 participant