cuba-platform / cuba-gradle-plugin

Gradle plugin for building CUBA platform and applications
https://www.cuba-platform.com
Apache License 2.0
15 stars 18 forks source link

Long classpath leads to certain Cuba gradle tasks fails in Windows #14

Closed haulmont-git closed 4 years ago

haulmont-git commented 7 years ago

This is due command line call to java.exe via javaexec being too long for Windows to handle

First noticed the issue with CubaEnhancingTask, but CubaWidgetSetBuilding and CubaWidgetSetDebug seem to be affected as well as they also use javaexec.

The common way if fixing that is replacing classpath command line argument by process environment variable for Windows OS. In Cuba, however, the developer is forced to extend Cuba task and replace the whole @TaskAction method (because javaexec call is in there) or to shorten the path to .gradle directory.

Generally, if Cuba tasks had @TaskAction variables stored as task class attributes (JavaExecSpec for javaexec, for instance, or individual javaexec parameters) developer would have more tools to amend task execution without extending the task class - just do some amendments in doFirst {} for instance.


Original issue: https://youtrack.haulmont.com/issue/PL-8895

jreznot commented 6 years ago

Workaround - exclude unnecessary JARs from GWT compilation:

configure(webToolkitModule) {

    configurations.compile {
        exclude group: 'org.springframework'
        exclude group: 'org.eclipse.persistence'
        exclude group: 'org.codehaus.groovy'
        exclude group: 'org.apache.ant'
    }
andreysubbotin commented 4 years ago

Test case:

Actual: building project fails, because of the "Error 206 path too long" problem. This is really a blocker for Windows users.

Resolution: Add parameter shortClassPath=true to BuildWidgetSet task for correct building on Windows:

task buildWidgetSet(type: CubaWidgetSetBuilding) {
        widgetSetClass = 'com.company.testbuild.web.toolkit.ui.AppWidgetSet'
        shortClassPath = true
}