71 Commits

Author SHA1 Message Date
niccolo.piazzesi
6776d6a3aa Prepare for 7.8.2 release
Summary: Update all relevant docs to prepare for release containing D56358

Reviewers: dominik.huber, thomas.vochten

Reviewed By: dominik.huber, thomas.vochten

Differential Revision: https://phabricator.guardsquare.com/D57357
2025-12-03 12:32:49 +01:00
niccolo.piazzesi
0c51b82946 Use latest version in all documentation 2025-10-27 09:11:20 +01:00
niccolo.piazzesi
869ce156b1 Update dependency, update samples, update release notes for 7.8 2025-10-07 13:34:28 +02:00
niccolo.piazzesi
886477806c Temporarily downgrade version in examples until release is properly done 2025-08-22 10:47:01 +02:00
Robin Lefever
7fc907d1fb Update ProGuardCORE version to support Kotlin 2.2 2025-08-22 06:48:58 +02:00
James Hamilton
ef6a8352bd Update ProGuardCORE version for Java 24 support (#470)
Update ProGuardCORE version for Java 24 support
2025-03-24 13:28:56 +01:00
Thomas Vochten
174d3f4155 Upgrade Gradle, upgrade dependencies, bump version to 7.6.1 2024-11-29 08:49:38 +01:00
James Hamilton
b3deed8286 Update versions for version 7.6 (#440) 2024-09-27 14:43:19 +02:00
James Hamilton
aa43b9dc21 Update versions for 7.5 (#404)
Updates ProGuardCORE + other required dependencies for Kotlin 2 + Java 22; including running tests with Java 22.
2024-05-23 14:01:48 +02:00
James Hamilton
d4692c3835 Update version number in examples 2024-01-31 18:05:50 +01:00
James Hamilton
f6b82b1478 Update example versions to 7.4.1 2023-11-22 11:22:08 +01:00
James Hamilton
76cf000348 Update version inside examples 2023-10-12 12:50:05 +02:00
James Hamilton
1b445599e0 Update manual 2023-03-17 11:35:45 +01:00
tvoc-gs
764d35e4d5 Update manual (#321)
* Update manual

* Delete  and

---------

Co-authored-by: James Hamilton <james.hamilton@guardsquare.com>
2023-03-02 13:20:42 +00:00
James Hamilton
dbdb423364 Add simple Kotlin example application 2023-01-13 12:44:36 +01:00
James Hamilton
20e3103518 Update ProGuard version in examples 2022-11-17 11:07:00 +01:00
Emiel Vandeloo
f16430e3b3 dos2unix 2022-08-04 12:23:59 +02:00
Tony Robalik
3f8d78322d Don't fail when --configuration-cache is used. (#258) 2022-07-05 11:33:28 +02:00
James Hamilton
87bb794331 Update example version to 7.2.1 2022-02-18 19:19:09 +01:00
James Hamilton
609bf2d973 Update android-plugin sample ProGuard dependency to 7.2.0 2022-02-11 16:59:55 +01:00
James Hamilton
40fc9e24db Update android-plugin sample AGP version to 7.0.0 2022-02-11 16:59:55 +01:00
James Hamilton
7a4e35559b Fix obfuscated jar filename in spring-boot example 2021-08-17 11:34:43 +02:00
James Hamilton
91e0206127 Update version to 7.1.0 2021-06-29 12:37:11 +02:00
James Hamilton
da524a3499 Change plugin ID from proguard to com.guardsquare.proguard 2021-06-15 16:08:57 +02:00
James Hamilton
5f69246e3a Update ProGuard Gradle plugin to be compatible with AGP 7 2021-05-25 16:49:18 +02:00
James Hamilton
87000a49ec Update jcenter references to Maven Central (#154) 2021-04-28 16:43:22 +02:00
Daz DeBoer
cb7928d19a Simpify proguard.gradle.ProGuardTask implementation (#151)
* Revert "Improve handling of Gradle task inputs and outputs (#139)"

This reverts commit b5fbefb87c.

* Add more test coverage of Gradle plugin

- Rename `gradlekotlindsl` sample to `gradle-kotlin-dsl`
- Use `gradle-kotlin-dsl` as basis for plugin testing
- Add coverage for loading from external config file

* Register Proguard output files as Gradle task outputs

These outputs file may be consumed by other Gradle tasks, and
this change makes the output file locations available programatically.

We use this internally to publish the generated mapping file to internal
repository, which makes it easier to later deobfuscate stack traces. eg:

publishing {
    publications {
        register("sourcemap", MavenPublication) {
            artifact tasks.named("proguard").map { it.printMappingFile }
        }
    }
}
2021-04-27 17:56:23 +02:00
Daz DeBoer
b5fbefb87c Improve handling of Gradle task inputs and outputs (#139)
Previously, Task inputs and outputs were declared in an ad-hoc manner,
resulting in confusing source code and inconsistent behaviour with up-to-date checks. 

Specifically:

- If an input (`-injars`, `-libraryjars`) was configured via a ProGuard config file, 
  then changes to these inputs were not detected as part of up-to-date checks
- Similar for output files: if an output added with `-outjars` was deleted, the task
  would not detect this and would not re-execute
- Many task inputs were not registered at all, meaning that the task would be incorrectly
  considered up-to-date when these inputs were changed (eg `keep`, `dontshrink`, 
  `assumeNoSideEffects`, `obfuscationDictionary`, etc)
- Many output files were not tracked at all (eg printMapping). This meant that changes
  to these files were not detected, and they were not restored correctly from cache.

A few further notes:

- To avoid having to wrap the `ClassSpecification` and `MemberSpecification` types
(and subtypes), these classes were declared as `Serializable`. 
- The existing properties on `ProGuardTask` were left unchanged, to avoid changing the
  task API and to retain support for the existing DSL configuration.
- Since `programJars` and `libraryJars` can contain a mix of files and directories, 
  inputs and outputs, each entry is exposed as a `WrappedClassPathEntry`, with subtypes
  representing the actual input/output file/directory.
- Use a `Provider<Configuration>` to defer initial instantiation of `Configuration`
- Provider is a mapping from configuration input files, which means it will carry
  task dependency information 
- Provider implementation loads the configuration on first use, memoizing for later uses.

* Simplify the task configuration model to make it possible to defer loading configuration

The first attempt modeled each input file as a `@Nested` object containing the File
reference as well as the filters attached to that file. While this closely modelled
the true configuration, it meant that each nested instance was instantiated early
in order to inspect the properties.

With this change, all input files are merged into a single `FileCollection` property,
and the filters for all files are merged into a separate `List<Serializable>` property.
This structure will later allow us to defer loading these property values until the
task begins executing.

* Correctly handle output directories

By borrowing the file detection logic from Proguard core, we can determine if
a configured output file is a file (with a known extension) or a directory.
This is required to correctly register the file as an `OutputFile` or `OutputDirectory`.

Using `.isFile()` and `.isDirectory()` is not sufficient, as the file may not exist.

* Defer loading of Proguard configuration until task is executed

By default, all `@InputFile` properties are resolved when building the task
graph. By declaring these input properties as a mapping from the configuration-file
inputs, the provider contains enough context to avoid realizing the actual properties.

Since realizing these properties involves loading the Proguard configuration, this
change allows this work to be deferred until the task inputs are actually calculated
as part of task execution.

* Track direct task inputs separately, to preserve task dependencies

The input files for the proguard task are a combination of files loaded via a
configuration file and files directly configured via the Gradle DSL. The latter
can carry task dependency information, but this is being lost when we merge
the set of input files.

This change adds separate `@Classpath` properties to the task to track the files
added directly via the Gradle DSL, thus preserving task dependencies for these inputs.

* Workaround limitation in Gradle 6.x

In older versions of Gradle, all `InputFile` properties of type `Provider`
are realized when building the task graph in order to check for existence.
This happens even when these were mapped from a known producer, resulting in
early loading of the ProGuard configuration file(s).

In order to workaround this issue, a custom `Provider` implementation is
used for Gradle versions <= 7.0

* Renamed from `gradlekotlindsl` -> `gradle-kotlin-dsl`

Closes: #139, #106, #136
2021-03-27 17:03:47 +01:00
James Hamilton
8a02ef694c Update examples/android sample 2021-03-25 23:03:32 +01:00
Daz DeBoer
6afe222955 Improve build for local development and add missing API dependencies (#131)
* Document persisting the composite build layout using `gradle.properties`

* Speed up the build with not-very-experimental options

- Parallel project execution
   - This reduces `clean assemble` by 50%
- Local build cache
   - This reduces a no-op `clean assemble` by a further 60%
- File system watching
   - This will be enabled by default in Gradle 7, and speeds up builds using
     the same daemon process

* Add a settings file so that proguard-gradle examples can be run

* Document the process to publish artifacts locally for testing

* Include `proguard-core` in the API dependencies of `base`

Many of the public types in the `proguard-base` module export types that
are defined in the `proguard-core` module. This means that these `proguard-core`
types are required when compiling againt `proguard-base`.

By declaring `proguard-base` as a `java-library` and including `proguard-core`
as an API dependency, consumers of `proguard-base` do not have to declare this
explicit dependency.

* Include `proguard-base` as an API dependency of `proguard-gradle`

The public type of `ProGuardTask` exports a number of types defined in
the `proguard-base` module (`Configuration`, `ParseException`, etc). These types
are required when compiling against `ProGuardTask`, and can result in compilation
error when missing.

The correct way to model this in Gradle is to include `proguard-base` as an
API dependency of `proguard-gradle`.
2021-03-02 12:39:26 +01:00
Johannes Bühler
3856c91c60 Fix Gradle 7 deprecations (#123)
* ensure Gradle 7 compatibility by removing deprecation warnings and update to latest Gradle 6.8.x
2021-02-09 16:57:45 +01:00
Nelson Osacky
613af185f3 Add cache relocatability to proguard task. (#119)
* Add cache relocatability to proguard task.

This allows the Proguard Task to take advantage of the Gradle Build cache and re-use outputs from other builds.

This also adds a simple test for cache relocateability

* Address review comments

* Use regex to replace build.gradle file

* Use jar in spring boot sample.
2021-01-26 21:18:34 +01:00
Eric Lafortune
4302e8ceca Added support for sealed classes, through permitted subclasses attributes. 2020-12-27 17:31:29 +01:00
James Hamilton
1213768d33 Add gradle wrapper to android-plugin example 2020-12-14 23:11:47 +01:00
James Hamilton
a2eb7f8f7a Fix syntax errors in gradle examples 2020-12-10 20:46:34 +01:00
James Hamilton
eb54bfb1d9 Add Spring Boot example 2020-11-13 18:18:12 +01:00
Eric Salemi
912d149394 Bump to version 7.0.1 2020-11-04 13:59:00 +01:00
James Hamilton
679425e5d8 Add Gradle Kotlin DSL example 2020-09-26 21:48:32 +02:00
Eric Lafortune
b14159be12 Updated examples. 2020-06-07 02:07:13 +02:00
Eric Salemi
fa4686cf42 Correct resolution strategy to handle the change of group-id 2020-06-06 18:13:54 +02:00
Eric Lafortune
e518fc2537 Updated documentation. 2020-06-05 12:43:16 +02:00
Eric Salemi
4743287148 Maven group ID relocation 2020-05-29 11:23:48 +02:00
Eric Lafortune
07a5bfd3a6 Updated copyright dates to 2020. 2020-05-10 14:55:31 +02:00
Eric Lafortune
d0fe71bb29 Moved ProGuard Core examples. 2020-05-08 00:54:42 +02:00
Eric Lafortune
56918f43ec Added analysis examples. 2020-05-07 21:52:05 +02:00
Eric Lafortune
bcdc65dc06 Added initial markdown documentation for the library. 2020-05-07 21:52:05 +02:00
Eric Lafortune
7321d8e1f4 Added preverification example and fixed jar writing issues. 2020-05-07 21:52:05 +02:00
Eric Lafortune
efbd74d287 Moved class constants to related classes and new classes. 2020-05-07 21:52:05 +02:00
Eric Lafortune
d4dcd00571 Fixed building gradle plugin. 2020-05-07 17:23:33 +02:00
Eric Lafortune
504fbd1047 Updated examples for new dependencies on GSON and Kotlin. 2020-05-07 17:12:19 +02:00