1515import java .util .*;
1616
1717public class GradlePackageTask extends DefaultTask implements PackagerFactory {
18- public PackageTask extension = new PackageTask ();
18+ /**
19+ * This is the global javapackager instance. <br>
20+ * Sadly we need to do it like this because
21+ * we cannot extend {@link PackageTask} because we already
22+ * extend another class. This means that this task
23+ * has no properties, instead we use this extensions properties.
24+ * @see PackagePlugin
25+ */
26+ public PackageTask extension ;
1927 private final Project gradleProject = Context .getGradleContext ().getProject ();
2028 private List <File > outputFiles ;
2129
2230 public GradlePackageTask () throws IllegalAccessException {
2331 setGroup (PackagePlugin .GROUP_NAME );
2432 setDescription ("Packages the application as a native Windows, Mac OS X or GNU/Linux executable and creates an installer" );
2533 getOutputs ().upToDateWhen (o -> false );
26- updateExtension (extension );
34+ updateExtension (PackagePlugin . GLOBAL_EXTENSION );
2735 }
2836
2937 public void updateExtension (PackageTask extension ){
@@ -40,16 +48,6 @@ public void updateExtension(PackageTask extension){
4048 this .extension .assetsDir = new File (gradleProject .getProjectDir (), "assets" );
4149 }
4250
43- private List <Field > getFieldsWithAnnotation (Field [] fields , Class <? extends Annotation > annotationClass ) {
44- List <Field > list = new ArrayList <>();
45- for (Field field : fields ) {
46- if (field .isAnnotationPresent (annotationClass )){
47- list .add (field );
48- }
49- }
50- return list ;
51- }
52-
5351 @ OutputFiles
5452 public List <File > getOutputFiles () {
5553 return outputFiles != null ? outputFiles : new ArrayList <>();
0 commit comments