@@ -73,7 +73,7 @@ public class ProGuard extends AbstractBaseTask {
7373 private static final String CONVENTION_BASE_CFG_FILE = "baseCfgFile" ;
7474 private static final String CONVENTION_APPEND_CFG_FILE = "appendCfgFile" ;
7575 private static final String CONVENTION_IN_JARS = "inJars" ;
76- private static final String CONVENTION_EXCLUDED_FILES = "excludedFiles " ;
76+ private static final String CONVENTION_EXCLUDE_FILES = "excludeFiles " ;
7777 private static final String CONVENTION_LIBRARY_JARS = "libraryJars" ;
7878 private static final String CONVENTION_OUT_JAR = "outJar" ;
7979 private static final String CONVENTION_COMPOSED_CFG_FILE = "composedCfgFile" ;
@@ -142,17 +142,17 @@ public void setInJars(@Nullable Collection<Object> inJars) {
142142 }
143143
144144 @ Nullable
145- private Set <String > excludedFiles ;
145+ private Set <String > excludeFiles ;
146146
147147 @ Input
148148 @ NotNull
149- public Collection <String > getExcludedFiles () {
150- return getOrConvention (excludedFiles , CONVENTION_EXCLUDED_FILES );
149+ public Collection <String > getExcludeFiles () {
150+ return getOrConvention (excludeFiles , CONVENTION_EXCLUDE_FILES );
151151 }
152152
153153 @ IgnoreUnused
154- public void setExcludedFiles (@ Nullable Collection <String > excludedFiles ) {
155- this .excludedFiles = excludedFiles == null ? null : new LinkedHashSet <>(excludedFiles );
154+ public void setExcludeFiles (@ Nullable Collection <String > excludeFiles ) {
155+ this .excludeFiles = excludeFiles == null ? null : new LinkedHashSet <>(excludeFiles );
156156 }
157157
158158 @ Nullable
@@ -269,8 +269,8 @@ private String composeInputFileFilter() {
269269 sb .append ("(!**.framework/**,!**.bundle/**,!module-info.class" );
270270
271271 // Add user specified
272- for (String excludedFile : getExcludedFiles ()) {
273- sb .append (",!" ).append (excludedFile );
272+ for (String excludeFile : getExcludeFiles ()) {
273+ sb .append (",!" ).append (excludeFile );
274274 }
275275
276276 sb .append (")" );
@@ -458,6 +458,10 @@ protected final void setupMoeTask(final @NotNull SourceSet sourceSet, final @Not
458458
459459 addConvention (CONVENTION_PROGUARD_JAR , sdk ::getProGuardJar );
460460 addConvention (CONVENTION_BASE_CFG_FILE , () -> {
461+ if (ext .proguard .getBaseCfgFile () != null ) {
462+ return ext .proguard .getBaseCfgFile ();
463+ }
464+
461465 final File cfg = project .file ("proguard.cfg" );
462466 if (cfg .exists () && cfg .isFile ()) {
463467 return cfg ;
@@ -473,6 +477,10 @@ protected final void setupMoeTask(final @NotNull SourceSet sourceSet, final @Not
473477 }
474478 });
475479 addConvention (CONVENTION_APPEND_CFG_FILE , () -> {
480+ if (ext .proguard .getAppendCfgFile () != null ) {
481+ return ext .proguard .getAppendCfgFile ();
482+ }
483+
476484 final File cfg = project .file ("proguard.append.cfg" );
477485 if (cfg .exists () && cfg .isFile ()) {
478486 return cfg ;
@@ -521,8 +529,8 @@ protected final void setupMoeTask(final @NotNull SourceSet sourceSet, final @Not
521529
522530 return jars ;
523531 });
524- addConvention (CONVENTION_EXCLUDED_FILES , () -> {
525- Collection <String > exc = ext .proguard .getExcludedFiles ();
532+ addConvention (CONVENTION_EXCLUDE_FILES , () -> {
533+ Collection <String > exc = ext .proguard .getExcludeFiles ();
526534 if (exc == null ) {
527535 exc = Collections .emptySet ();
528536 }
@@ -557,7 +565,7 @@ protected final void setupMoeTask(final @NotNull SourceSet sourceSet, final @Not
557565 addConvention (CONVENTION_COMPOSED_CFG_FILE , () -> resolvePathInBuildDir (out , "configuration.pro" ));
558566 addConvention (CONVENTION_MAPPING_FILE , () -> isCustomisedBaseConfig () || !isObfuscationEnabled () ? null : resolvePathInBuildDir (out , "mapping.txt" ));
559567 addConvention (CONVENTION_LOG_FILE , () -> resolvePathInBuildDir (out , "ProGuard.log" ));
560- addConvention (CONVENTION_MINIFY_ENABLED , () -> getMoeExtension () .proguard . isMinifyEnabled () );
561- addConvention (CONVENTION_OBFUSCATION_ENABLED , () -> getMoeExtension () .proguard . isObfuscationEnabled () );
568+ addConvention (CONVENTION_MINIFY_ENABLED , ext .proguard :: isMinifyEnabled );
569+ addConvention (CONVENTION_OBFUSCATION_ENABLED , ext .proguard :: isObfuscationEnabled );
562570 }
563571}
0 commit comments