2525import org .gradle .api .provider .ListProperty ;
2626import org .gradle .api .provider .MapProperty ;
2727import org .gradle .api .provider .Property ;
28- import org .gradle .api .provider .ProviderFactory ;
2928import org .gradle .api .tasks .Input ;
3029import org .gradle .api .tasks .InputFiles ;
31- import org .gradle .api .tasks .OutputDirectory ;
3230import org .gradle .api .tasks .TaskAction ;
3331import org .gradle .api .tasks .TaskExecutionException ;
3432import org .gradle .execution .commandline .TaskConfigurationException ;
@@ -144,10 +142,7 @@ public class JcpTask extends DefaultTask {
144142 private final Property <Boolean > dontOverwriteSameContent ;
145143
146144 @ Inject
147- public JcpTask (ProviderFactory providerFactory ) {
148- super ();
149- final ObjectFactory factory = this .getProject ().getObjects ();
150-
145+ public JcpTask (final ObjectFactory factory ) {
151146 this .allowWhitespaces = factory .property (Boolean .class ).convention (false );
152147 this .careForLastEol = factory .property (Boolean .class ).convention (false );
153148 this .clearTarget = factory .property (Boolean .class ).convention (false );
@@ -170,12 +165,20 @@ public JcpTask(ProviderFactory providerFactory) {
170165 this .sources = factory .listProperty (File .class );
171166
172167 this .configFiles = factory .listProperty (String .class );
173- this .excludeExtensions = factory .listProperty (String .class ).convention (Collections .singletonList ("xml" ));
168+ this .excludeExtensions =
169+ factory .listProperty (String .class ).convention (Collections .singletonList ("xml" ));
174170 this .excludeFolders = factory .listProperty (String .class );
175- this .fileExtensions = factory .listProperty (String .class ).convention (new ArrayList <>(Arrays .asList ("java" , "txt" , "htm" , "html" )));
171+ this .fileExtensions = factory .listProperty (String .class )
172+ .convention (new ArrayList <>(Arrays .asList ("java" , "txt" , "htm" , "html" )));
176173
177174 this .baseDir = factory .property (File .class ).convention (this .getProject ().getProjectDir ());
178- this .target = factory .property (File .class ).convention (new File (this .getProject ().getBuildDir (), "java-comment-preprocessor" + File .separatorChar + this .getTaskIdentity ().name ));
175+ this .target = factory .property (File .class ).convention (new File (this .getProject ().getBuildDir (),
176+ "java-comment-preprocessor" + File .separatorChar + this .getTaskIdentity ().name ));
177+ }
178+
179+ @ Override
180+ public String getDescription () {
181+ return "Preprocess sources and resources with JCP" ;
179182 }
180183
181184 @ InputFiles
@@ -194,7 +197,6 @@ public Property<Boolean> getKeepAttributes() {
194197 }
195198
196199 @ Input
197- @ OutputDirectory
198200 public Property <File > getTarget () {
199201 return this .target ;
200202 }
0 commit comments