Skip to content

Commit b971c49

Browse files
committed
Add more gradle 7.x required annotations. #103
1 parent 3eeea3a commit b971c49

File tree

5 files changed

+80
-0
lines changed

5 files changed

+80
-0
lines changed

src/com/inet/gradle/setup/abstracts/AbstractUnixSetupTask.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.inet.gradle.setup.abstracts;
22

3+
import org.gradle.api.tasks.Input;
4+
35
/**
46
* An abstract base for the Unix SetupTask
57
* @author gamma
@@ -18,6 +20,7 @@ public AbstractUnixSetupTask( String extension ) {
1820
*
1921
* @return the user for the daemon
2022
*/
23+
@Input
2124
public String getDaemonUser() {
2225
if( daemonUser.trim().isEmpty() ) {
2326
return "root";

src/com/inet/gradle/setup/dmg/Dmg.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
import org.apache.tools.ant.types.FileSet;
2626
import org.gradle.api.Action;
2727
import org.gradle.api.internal.project.ProjectInternal;
28+
import org.gradle.api.tasks.Input;
29+
import org.gradle.api.tasks.InputFile;
30+
import org.gradle.api.tasks.Optional;
2831

2932
import com.inet.gradle.appbundler.OSXCodeSign;
3033
import com.inet.gradle.setup.SetupBuilder;
@@ -119,6 +122,7 @@ public void build() {
119122
*
120123
* @return width of Finder view
121124
*/
125+
@Input
122126
public int getWindowWidth() {
123127
return windowWidth + windowWidthCorrection;
124128
}
@@ -139,6 +143,7 @@ public void setWindowWidth( int windowWidth ) {
139143
*
140144
* @return width correction of Finder view
141145
*/
146+
@Input
142147
public int getWindowWidthCorrection() {
143148
return windowWidthCorrection;
144149
}
@@ -159,6 +164,7 @@ public void setWindowWidthCorrection( int windowWidthCorrection ) {
159164
*
160165
* @return height of Finder view
161166
*/
167+
@Input
162168
public int getWindowHeight() {
163169
return windowHeight + windowHeightCorrection;
164170
}
@@ -179,6 +185,7 @@ public void setWindowHeight( int windowHeight ) {
179185
*
180186
* @return width correction of Finder view
181187
*/
188+
@Input
182189
public int getWindowHeightCorrection() {
183190
return windowHeightCorrection;
184191
}
@@ -199,6 +206,7 @@ public void setWindowHeightCorrection( int windowHeightCorrection ) {
199206
*
200207
* @return size of icons in Finder view
201208
*/
209+
@Input
202210
public int getIconSize() {
203211
return iconSize;
204212
}
@@ -217,6 +225,8 @@ public void setIconSize( int iconSize ) {
217225
*
218226
* @return background Image for Finder View
219227
*/
228+
@InputFile
229+
@Optional
220230
public File getBackgroundImage() {
221231
if( backgroundImage != null ) {
222232
return getProject().file( backgroundImage );
@@ -238,6 +248,7 @@ public void setBackgroundImage( File backgroundFile ) {
238248
*
239249
* @return font size for Finder View
240250
*/
251+
@Input
241252
public int getFontSize() {
242253
return fontSize;
243254
}
@@ -297,6 +308,8 @@ public void conclusionPage( Object conclusionPage ) {
297308
*
298309
* @return welcome page
299310
*/
311+
@Input
312+
@Optional
300313
public List<LocalizedResource> getWelcomePages() {
301314
return welcomePages.size() > 0 ? welcomePages : getSetupBuilder().getLongDescriptions();
302315
}
@@ -316,6 +329,8 @@ public void welcomePage( Object welcomePage ) {
316329
*
317330
* @return background image
318331
*/
332+
@InputFile
333+
@Optional
319334
public File getSetupBackgroundImage() {
320335
if( setupBackground != null ) {
321336
return getProject().file( setupBackground );
@@ -337,6 +352,8 @@ public void setSetupBackgroundImage( Object setupBackground ) {
337352
*
338353
* @return a dark background image for the package installer
339354
*/
355+
@InputFile
356+
@Optional
340357
public File getSetupDarkBackgroundImage() {
341358
if( setupDarkBackground != null ) {
342359
return getProject().file( setupDarkBackground );
@@ -358,6 +375,8 @@ public void setSetupDarkBackgroundImage( Object setupDarkBackground ) {
358375
*
359376
* @return the setupIcon
360377
*/
378+
@Input
379+
@Optional
361380
public Object getSetupIcon() {
362381
if( setupIcon == null ) {
363382
return getSetupBuilder().getIcons();
@@ -379,6 +398,8 @@ public void setSetupIcon( Object setupIcon ) {
379398
*
380399
* @return preferences links
381400
*/
401+
@Input
402+
@Optional
382403
public List<PreferencesLink> getPreferencesLinks() {
383404
return preferencesLink;
384405
}
@@ -399,6 +420,8 @@ public void preferencesLink( Action<? super PreferencesLink> action ) {
399420
*
400421
* @return the jreIncludes
401422
*/
423+
@Input
424+
@Optional
402425
public List<String> getJreIncludes() {
403426
return jreIncludes;
404427
}
@@ -417,6 +440,8 @@ public void setJreIncludes( List<String> jreIncludes ) {
417440
*
418441
* @return the jreExclude
419442
*/
443+
@Input
444+
@Optional
420445
public List<String> getJreExcludes() {
421446
return jreExcludes;
422447
}
@@ -435,6 +460,7 @@ public void setJreExcludes( List<String> jreExclude ) {
435460
*
436461
* @return the backgroundColor as apple script color string
437462
*/
463+
@Input
438464
public String getBackgroundColor() {
439465
if( backgroundColor == null ) {
440466
// Fallback
@@ -485,6 +511,7 @@ public void setApplicationIdentifier( String applicationIdentifier ) {
485511
*
486512
* @return true, if the application requires the aqua system appearance.
487513
*/
514+
@Input
488515
public boolean isAquaSystemAppearanceRequired() {
489516
return aquaSystemAppearanceRequired;
490517
}
@@ -510,6 +537,7 @@ public void nativeLibraries( Object library ) {
510537
* Returns the list of native libraries set for the current project
511538
* @return the list of native libraries set for the current project
512539
*/
540+
@Input
513541
public List<FileSet> getNativeLibraries() {
514542
return nativeLibraries.stream().map( e -> {
515543
FileSet set = new FileSet();

src/com/inet/gradle/setup/unix/Unix.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717

1818
import java.io.File;
1919

20+
import org.gradle.api.tasks.Input;
21+
import org.gradle.api.tasks.InputDirectory;
22+
import org.gradle.api.tasks.InputFile;
23+
import org.gradle.api.tasks.Optional;
24+
2025
import com.inet.gradle.setup.abstracts.AbstractUnixSetupTask;
2126

2227
/**
@@ -67,6 +72,7 @@ public String getVariablesTemplate() {
6772
*
6873
* @return the section
6974
*/
75+
@Input
7076
public String getSection() {
7177
if( section != null ) {
7278
return section;
@@ -86,6 +92,8 @@ public void setSection( String section ) {
8692
* The current architecture
8793
* @return current architecture
8894
*/
95+
@Input
96+
@Optional
8997
public String getArchitecture() {
9098
return architecture;
9199
}
@@ -102,6 +110,8 @@ public void setArchitecture( String architecture ) {
102110
* The recommended package dependencies
103111
* @return recommended package dependencies
104112
*/
113+
@Input
114+
@Optional
105115
public String getRecommends() {
106116
return recommends;
107117
}
@@ -118,6 +128,8 @@ public void setRecommends( String recommends ) {
118128
* The package dependencies
119129
* @return package dependencies
120130
*/
131+
@Input
132+
@Optional
121133
public String getDepends() {
122134
return depends;
123135
}
@@ -134,6 +146,8 @@ public void setDepends( String depends ) {
134146
* Homepage of the author
135147
* @return homepage of the author
136148
*/
149+
@Input
150+
@Optional
137151
public String getHomepage() {
138152
return homepage;
139153
}
@@ -150,6 +164,7 @@ public void setHomepage( String homepage ) {
150164
* Returns the installation root where the program directory should be located. Default is /usr/share + basename
151165
* @return the installation root directory
152166
*/
167+
@Input
153168
public String getInstallationRoot() {
154169
if( installationRoot == null ) {
155170
return "/usr/share/" + getSetupBuilder().getApplication().toLowerCase().replaceAll("[^a-z0-9-_]", "-");
@@ -172,6 +187,8 @@ public void setInstallationRoot( String installationRoot ) {
172187
* Returns the a default service configuration file This will be included in the service starter
173188
* @return the default service file
174189
*/
190+
@InputFile
191+
@Optional
175192
public File getDefaultServiceFile() {
176193
if( defaultServiceFile != null ) {
177194
return getProject().file( defaultServiceFile );
@@ -192,6 +209,8 @@ public void setDefaultServiceFile( Object defaultServiceFile ) {
192209
* This allows to modify and enhance the service.
193210
* @return the additional service file
194211
*/
212+
@Input
213+
@Optional
195214
public String getAdditionalServiceScript() {
196215
return additionalServiceScript != null ? additionalServiceScript : "" ;
197216
}
@@ -225,6 +244,8 @@ public void setStartDefaultService( boolean startDefaultService ) {
225244
*
226245
* @return the value
227246
*/
247+
@InputDirectory
248+
@Optional
228249
public File getBundleJre() {
229250

230251
Object jre = bundleJre;

src/com/inet/gradle/setup/unix/deb/Deb.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.inet.gradle.setup.unix.deb;
1717

1818
import org.gradle.api.internal.project.ProjectInternal;
19+
import org.gradle.api.tasks.Input;
1920

2021
import com.inet.gradle.setup.unix.Unix;
2122

@@ -53,6 +54,7 @@ public void build() {
5354
new DebBuilder( this, getSetupBuilder(), project.getFileResolver() ).build();
5455
}
5556

57+
@Input
5658
public String getPriority() {
5759
return priority;
5860
}
@@ -61,6 +63,7 @@ public void setPriority( String priority ) {
6163
this.priority = priority;
6264
}
6365

66+
@Input
6467
public String getInstallSize() {
6568
return installSize;
6669
}
@@ -69,6 +72,7 @@ public void setInstallSize( String installSize ) {
6972
this.installSize = installSize;
7073
}
7174

75+
@Input
7276
@Override
7377
public String getRecommends() {
7478
return recommends;
@@ -92,6 +96,7 @@ public void setCheckPackage( boolean checkPackage ) {
9296
* They will only have impact when checkPackages is enabled.
9397
* @return the lintianOptions
9498
*/
99+
@Input
95100
public String getLintianOptions() {
96101
return lintianOptions;
97102
}
@@ -105,6 +110,7 @@ public void setLintianOptions( String lintianOptions ) {
105110
this.lintianOptions = lintianOptions;
106111
}
107112

113+
@Input
108114
public String getMaintainerEmail() {
109115
return maintainerEmail;
110116
}
@@ -113,6 +119,7 @@ public void setMaintainerEmail( String maintainerEmail ) {
113119
this.maintainerEmail = maintainerEmail;
114120
}
115121

122+
@Input
116123
public String getChanges() {
117124
return changes;
118125
}
@@ -121,6 +128,7 @@ public void setChanges( String changes ) {
121128
this.changes = changes;
122129
}
123130

131+
@Input
124132
@Override
125133
public String getArchitecture() {
126134
String architecture = super.getArchitecture();

0 commit comments

Comments
 (0)