Skip to content

Commit

Permalink
Improve Maven build (#1964)
Browse files Browse the repository at this point in the history
- Specify missing plugin versions
- Fix or suppress ProGuard notes and warnings
  • Loading branch information
Marcono1234 authored Sep 18, 2021
1 parent b82c767 commit f1f9031
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
31 changes: 19 additions & 12 deletions gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,25 @@
<artifactId>gson</artifactId>
<name>Gson</name>

<properties>
<proguardVersion>7.1.1</proguardVersion>
</properties>

<licenses>
<license>
<name>Apache-2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.4.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -111,14 +109,17 @@
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<phase>process-test-classes</phase>
<goals><goal>proguard</goal></goals>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<proguardVersion>6.2.2</proguardVersion>
<proguardVersion>${proguardVersion}</proguardVersion>
<obfuscate>true</obfuscate>
<injar>test-classes-obfuscated-injar</injar>
<outjar>test-classes-obfuscated-outjar</outjar>
Expand All @@ -131,9 +132,15 @@
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<groupId>com.guardsquare</groupId>
<artifactId>proguard-core</artifactId>
<version>${proguardVersion}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.guardsquare</groupId>
<artifactId>proguard-base</artifactId>
<version>6.2.2</version>
<version>${proguardVersion}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
Expand Down
5 changes: 4 additions & 1 deletion gson/src/test/resources/testcases-proguard.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5
-allowaccessmodification
# On Windows mixed case class names might cause problems
-dontusemixedcaseclassnames
-keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod
-keepclassmembers enum * {
public static **[] values();
Expand All @@ -17,4 +19,5 @@

-dontwarn com.google.gson.functional.EnumWithObfuscatedTest
-dontwarn junit.framework.TestCase

# Ignore notes about duplicate JDK classes
-dontnote module-info,jdk.internal.**
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
Expand Down

0 comments on commit f1f9031

Please sign in to comment.