Skip to content

Scalified/gradle-proguard-plugin

Repository files navigation

Gradle ProGuard Plugin

Build Status Gradle Plugin Portal

Description

Gradle ProGuard Plugin brings easy integration with Guardsquare ProGuard

Requirements

Usage

plugins {
  id("com.scalified.plugins.gradle.proguard") version "$version"
}

By default, ProGuardTask will be automatically executed after Jar task. Also, proguard task can be executed manually:

./gradlew proguard

ProGuard Annotations

ProGuard annotations supported out-of-the-box. Just add the ProGuard annotations dependency:

compileOnly("com.guardsquare:proguard-annotations:$version")

Configuration

ProGuard Plugin can be configured via Gradle extension

proguard {
    configurations.setFrom(files("$rootDir/proguard-root-rules.pro", "$projectDir/proguard-project-rules.pro"))
    // ...
}

By default, ProGuard Plugin will use proguard-rules.pro files located in the root directory and the project directory

List of supported configuration parameters

Name Description Default Value
configurations ProGuard configuration file name proguard-rules.pro
overwriteArtifact If enabled, jar artifact will be overwritten by ProGuard obfuscated jar true
autoRun If enabled, jar task will be finalized by proguard task true

License

MIT License

Copyright (c) 2022 Scalified

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Scalified Links