Skip to content

Commit 413900d

Browse files
committed
Add @input annotations for UP-TO-DATE check. #99
1 parent 56341fb commit 413900d

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

src/com/inet/gradle/setup/msi/Msi.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
import org.gradle.api.GradleException;
2929
import org.gradle.api.internal.file.CopyActionProcessingStreamAction;
3030
import org.gradle.api.internal.project.ProjectInternal;
31+
import org.gradle.api.tasks.Input;
32+
import org.gradle.api.tasks.InputFile;
33+
import org.gradle.api.tasks.InputFiles;
3134
import org.gradle.util.ConfigureUtil;
3235

3336
import com.inet.gradle.setup.abstracts.AbstractSetupTask;
@@ -126,6 +129,7 @@ boolean isOnly32Bit() {
126129
* Get the architecture of the installer.
127130
* @return the architecture
128131
*/
132+
@Input
129133
public String getArch() {
130134
if( arch != null ) {
131135
return arch;
@@ -173,6 +177,7 @@ boolean is64Bit() {
173177
* Get the file of the banner or null
174178
* @return the file
175179
*/
180+
@InputFile
176181
public File getBannerBmp() {
177182
if( bannerBmp != null ) {
178183
return getProject().file( bannerBmp );
@@ -194,6 +199,7 @@ public void setBannerBmp( Object bannerBmp ) {
194199
*
195200
* @return the BMP
196201
*/
202+
@InputFile
197203
public File getDialogBmp() {
198204
if( dialogBmp != null ) {
199205
return getProject().file( dialogBmp );
@@ -234,13 +240,27 @@ public SignTool getSignTool() {
234240
* @return the template
235241
* @throws MalformedURLException if any error occur
236242
*/
237-
public URL getWxsTemplate() throws MalformedURLException {
243+
public URL getWxsTemplateURL() throws MalformedURLException {
238244
if( wxsTemplate != null ) {
239245
return getProject().file( wxsTemplate ).toURI().toURL();
240246
}
241247
return getClass().getResource( "template.wxs" );
242248
}
243249

250+
/**
251+
* Get a file to a *.wxs file for the WIX Toolset
252+
*
253+
* @return the template
254+
* @throws MalformedURLException if any error occur
255+
*/
256+
@InputFile
257+
public File getWxsTemplate() throws MalformedURLException {
258+
if( wxsTemplate != null ) {
259+
return getProject().file( wxsTemplate );
260+
}
261+
return null;
262+
}
263+
244264
/**
245265
* Set an optional *.wxs file as template for building the final file with the settings of the gradle task. This
246266
* template give you the option to set things that are not available via the gradle task.
@@ -255,6 +275,7 @@ public void setWxsTemplate( Object wxsTemplate ) {
255275
* Get the languages that the setup should be support. The list must at minimum one element.
256276
* @return a list of languages
257277
*/
278+
@Input
258279
public List<MsiLanguages> getLanguages() {
259280
ArrayList<MsiLanguages> result = new ArrayList<>();
260281
if( languages == null ) {
@@ -297,6 +318,7 @@ public void setLanguages( Object languages ) {
297318
*
298319
* @return the version
299320
*/
321+
@Input
300322
public double getMinOS() {
301323
return minOS;
302324
}
@@ -351,6 +373,7 @@ public List<Launch4j> getLaunch4js() {
351373
*
352374
* @return instance count
353375
*/
376+
@Input
354377
public int getMultiInstanceCount() {
355378
return multiInstanceCount;
356379
}
@@ -399,6 +422,7 @@ public static enum InstallScope {
399422
*
400423
* @return the scope
401424
*/
425+
@Input
402426
public InstallScope getInstallScope() {
403427
if( installScope != null ) {
404428
return installScope;
@@ -421,6 +445,7 @@ public void setInstallScope( InstallScope installScope ) {
421445
*
422446
* @return the scripts
423447
*/
448+
@Input
424449
public List<String> getPreGUI() {
425450
return preGUI;
426451
}
@@ -513,6 +538,7 @@ public Msi setExternals(Iterable<File> externals) {
513538
/**
514539
* @return registered external wsx files
515540
*/
541+
@InputFiles
516542
public List<File> getExternals() {
517543
return externals;
518544
}

src/com/inet/gradle/setup/msi/MsiBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void build() {
6363
try {
6464

6565
File wxsFile = getWxsFile();
66-
URL template = task.getWxsTemplate();
66+
URL template = task.getWxsTemplateURL();
6767
new WxsFileBuilder( task, setup, wxsFile, buildDir, template, false ).build();
6868
template = wxsFile.toURI().toURL();
6969

0 commit comments

Comments
 (0)