Commit Graph

232 Commits

Author SHA1 Message Date
niccolo.piazzesi
20c99aa3e8 Parse -maximumremovedandroidloglevel 2024-03-07 10:44:31 +01:00
Vincent Rossetto
1c421bf780 Keep Kotlin interface method when default implementation is used 2024-02-13 11:09:20 +01:00
James Hamilton
712fd768ca Add ability to skip to next option if parse error
Allows providing a function to handle the case of an unknown option.

```
    public static void main(String[] args)
    {
        try
        {
            try (ConfigurationParser parser = new ConfigurationParser(new String[]{"-keep class * {}", "-unknownoption", "-whatisthisoption?"}, System.getProperties()))
            {
                parser.parse(new Configuration(), (option, location) -> {
                    System.out.println("Unknown option: " + option + " @ " + location);
                });
            }
            catch (ParseException ex)
            {
                ex.printStackTrace();
            }
        }
        catch (IOException ex)
        {
            ex.printStackTrace();
        }
    }
```

Output:

```
Unknown option: -unknownoption @ argument number 2
Unknown option: -whatisthisoption? @ argument number 3
```
2024-01-22 14:55:53 +01:00
Oberon Swings
a7265a3536 Conservatively mark wide parameter used if it can only be partially marked. 2024-01-08 08:19:01 +01:00
Ruben Pieters
7160a9e484 Fix nullability flag on named type arguments and reified flag on type parameters 2023-12-07 16:49:40 +01:00
Robin Lefever
12c9c3f23e Fix MemberDescriptorSpecializer checking wrong processing flags
This diff also ensures the `IS_CLASS_AVAILABLE` processing flag is set on classes instead of its members.
This requires us to change usages of this flag in some other places as well.
2023-12-01 14:56:44 +01:00
daphnis.chevreton
a02100cb93 Fix potential access issues when backporting
Backporting nest host/members is not supported and can therefore introduce access issue.
Running the access fixer if `-allowaccessmodification` is set solves this issue by setting appropriate visibility.
2023-11-29 16:14:03 +01:00
Bengt Verscheure
38a0e498b9 Use system-specific line separators 2023-11-24 14:49:44 +01:00
Bengt Verscheure
789777ded5 Add support for <clinit> in ConfigurationParser 2023-11-17 13:40:46 +01:00
Dimitrios Anyfantakis
e76e47953f Close file handle in ConfigurationWriter 2023-11-03 12:28:07 +01:00
Fergal Whyte
836253f1da Use system-specific line separators in ConfigurationWriterTest 2023-10-26 13:51:26 +02:00
Fergal Whyte
f92fc632b1 Parse alwaysinline and identifiernamestring rules 2023-10-25 17:50:40 +02:00
Fergal Whyte
f5f04cbec5 Fix printing of hash characters in ConfigurationWriter 2023-10-25 17:50:40 +02:00
Fergal Whyte
ce2c8a8b5d Add ConfigurationWriterTest 2023-10-25 17:50:25 +02:00
Fergal Whyte
0032aa037c Prevent NullPointerException when parsing annotations 2023-10-25 17:44:19 +02:00
Sebastian Ratz
6f3610bd7b Fix inadvertent closing of System.out when printing configuration (#366)
Co-authored-by: Blend Hamiti <blend.hamiti@guardsquare.com>
2023-10-25 12:15:16 +02:00
James Hamilton
7c153f8eec Enable unit testing of Java 20 and 21 2023-10-12 12:59:11 +02:00
James Hamilton
bfdfa02f8c Support parsing of wildcard * when used as a field type or method return type in class specifications. 2023-10-11 18:10:05 +02:00
Thomas Vochten
7429219cd2 Allow method from interfaces to be inlined if it is private and is being called from within the interface 2023-09-22 09:05:54 +02:00
Thomas Vochten
8bb7cc0c4b Do not inline methods from interfaces 2023-09-21 05:37:20 +02:00
James Hamilton
57d4250464 Use internalShortClassName in KotlinMultiFileFacadeFixer 2023-07-07 15:58:50 +02:00
James Hamilton
4cff876e44 Fix "NoClassDefFoundError: Failed resolution of: Lorg/apache/logging/log4j/LogManager #326 (#328)
* Remove log4j from injected classes

* Add release note
2023-03-30 13:00:41 +02:00
Emiel Matthys
1f8f548d36 Remove unused import in kotlin test 2023-03-24 16:45:21 +01:00
James Hamilton
0dd91648be Remove ClassPrinter debugging from ClassUsageMarkerTest 2023-03-17 12:17:20 +01:00
James Hamilton
aa1835fb93 Update ProGuardCORE (#325)
* Update ProGuardCORE

* Remove Java 20 from test list
2023-03-14 16:56:47 +00:00
James Hamilton
dda133e476 Add InstantiationClassMarkerTest (#320) 2023-03-02 13:28:39 +00:00
tvoc-gs
745a681b32 Fix off-by-one error (#319) 2023-02-28 14:54:26 +00:00
Robin
12516ba710 Class merging only when optimizing aggressively 2023-02-03 09:08:45 +01:00
Robin
98309c9fbf Refactor ConfigurationChecker 2023-01-27 12:09:31 +01:00
James Hamilton
fbda5d5156 Update tests to use KotlinMetadataVerifier
New Pass that replaces the old KotlinMetadataAsserter
2023-01-09 17:48:00 +01:00
James Hamilton
81561a0f2e Update ProGuardCORE version 2023-01-09 17:36:41 +01:00
Jelle De Coninck
8a7e846ec7 Fix string comparison in MappingPrinter and LineNumberLinearizer 2023-01-07 13:53:58 +01:00
James Hamilton
9b8f80229a Set the IS_CLASS_AVAILABLE processing flag 2022-12-14 17:23:52 +01:00
James Hamilton
1cbd6f7a68 Remove unused ExpectedStackTypeFinder 2022-12-14 17:23:52 +01:00
Thomas Vochten
3445fa02d6 Add -optimizeaggressively configuration option 2022-12-09 12:13:35 +01:00
Jelle De Coninck
4c6103eb2e Decrement uninitialized object count in MethodInliner when <init> is a LibraryMethod 2022-12-09 12:13:35 +01:00
James Hamilton
47e080f526 Update kotest dependencies 2022-12-09 12:13:35 +01:00
daphnis.chevreton
84ac82eb51 Fix linter issues 2022-11-24 15:25:10 +01:00
Ruben Pieters
2909a2ca7b Document supported/unsupported cases in TypeArgumentFinder. Fix incorrect invoke/getfield/getstatic case. 2022-11-24 15:24:58 +01:00
James Hamilton
c4a5a89194 Update ProGuardCORE dependency 2022-11-17 11:07:12 +01:00
James Hamilton
3226de6d0c Expand imports in LambdaExpressionConverter 2022-11-17 11:07:07 +01:00
James Hamilton
9c6eb91d01 Replace local constants with ProGuardCORE constants 2022-11-17 11:06:54 +01:00
James Hamilton
731ffd812d Conservatively keep annotation class constructor parameter names 2022-11-17 11:06:47 +01:00
James Hamilton
72f0ef13db Ensure that Kotlin parameters are kept when using -keepparameternames 2022-11-17 11:05:09 +01:00
Nadeesh T V
64c7322624 Add classintegrity asserter for enum entries 2022-11-16 15:58:41 +01:00
daphnis.chevreton
ec3ce071bf Synchronise Kotlin companion and instance field before fixing name conflicts 2022-11-10 14:59:57 +01:00
James Hamilton
902a7f19c3 Update GSON comments 2022-11-09 13:50:34 +01:00
James Hamilton
ff74c14eba Update unsupported Kotlin version message 2022-11-09 13:47:56 +01:00
James Hamilton
7473a042cc Update GSON warning message (#293) 2022-11-09 13:45:01 +01:00
Toon Willemot
cf5d492b00 Automatically process Kotlin metadata when keeping the annotation
Add dontprocesskotlinmetadata configuration option.
2022-10-20 17:28:21 +02:00