Port Compose Desktop ProGuard support to IntelliJPlugin #1170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Details
This is a first attempt at porting the ProGuard support from Compose Desktop Gradle Plugin to the IntelliJ Gradle Plugin.
Description
Recently, ProGuard support was added to the Compose Desktop Gradle plugin by adding a Gradle task which configures & executes ProGuard, and a simple DSL configuration.
This PR copies the AbstractProguardTask, ProguardSettings and related utility code.
Some of the utility code is probably not required and can be removed but currently I copied & pasted complete files.
I've slightly modified the
AbstractProguardTask
to make it work in the IntelliJ Gradle Plugin: mostly for collecting the library jars (which should maybe be done instead in the IntelliJ Plugin?) and making themainClass
optional.I've added a
configureProguardTask
in theIntelliJPlugin
to configure the plugin and set the input & output files.A plugin block can be added to an IntelliJ Plugin project:
Running the
./gradlew proguard
command currently produces a proguarded jar inbuild/lib/proguard/
but this may not be the most appropriate location. The publish task should also be able to publish this version of the jar instead of the original.A default ProGuard rules file is added to the resources. We should add some default rules to the configuration that make sense for IntelliJ Plugin projects.
We should probably also print the various logging files by default into the
build
folder; especially themapping.txt
file when obfuscation is enabled (-printmapping mapping.txt
).Motivation and Context
Provide a simplified integration for ProGuard shrinking, optimization and name obfuscation compared to e.g. using the current
ProGuardTask
How Has This Been Tested
Currently manually tested on a small sample: please advise on how this should normally be tested.
Types of changes
Checklist