jiakuan / gwt-gradle-plugin

Gradle plugin to support GWT related tasks.
https://gwt-gradle.docstr.org
Other
66 stars 34 forks source link

war should be an optional property #76

Closed stphnclysmth closed 1 year ago

stphnclysmth commented 1 year ago

The war output directory is treated as an optional exec argument, but it's a required task property in AbstractGwtTask. I think it was originally meant to be optional because it's added as an argument with dirArgIfSet. Since it's required, we have to set the war property on checkGwt in order to run that task.

https://github.com/jiakuan/gwt-gradle-plugin/blob/dbbd6c613d6e850e462193e2394091c3db90c534/src/main/java/org/docstr/gradle/plugins/gwt/AbstractGwtTask.java#L41

https://github.com/jiakuan/gwt-gradle-plugin/blob/dbbd6c613d6e850e462193e2394091c3db90c534/src/main/java/org/docstr/gradle/plugins/gwt/AbstractGwtTask.java#L55-L58

This is the workaround we're using:

tasks.named('checkGwt').configure {
    // The GWT plugin requires a configured value for this property even though it isn't used.
    // This value will create an empty folder instead of potentially interfering with the output
    // of another GWT task.
    war = file("$buildDir/gwt/check")
}

But this can be fixed by adding the @Optional annotation to AbstractGwtTask#getWar().

jiakuan commented 1 year ago

That makes sense. Thanks for the pull request. I've merged, and will create a new release soon.