steffenschaefer / gwt-gradle-plugin

Gradle plugin to support GWT (http://www.gwtproject.org/) related tasks.
Other
117 stars 45 forks source link

[GWT 2.8-SNAPSHOT/Gradle 2.13] Properties issue #102

Open hrstoyanov opened 8 years ago

hrstoyanov commented 8 years ago

Hi all, I have the following gradle.properties file next to my gradle.build:

# Dev mode gwt compiler 
java_lang_level = 1.8
gwt_compiler_minHeapSize = 512M
gwt_compiler_maxHeapSize = 1024M
gwt_log_level = WARN
gwt_source_level = 1.8
gwt_compiler_optimize = 0
gwt_compiler_enableClosureCompiler=false
gwt_compiler_style = DETAILED
gwt_compiler_draftCompile = false
gwt_app_modules = com.xxxxx.App

and here is how use them with this plug-in:

gwt {
    modules      gwt_app_modules
    devModules   gwt_app_modules
    gwtVersion   gwt_version
    minHeapSize = gwt_compiler_minHeapSize
    maxHeapSize = gwt_compiler_maxHeapSize
    logLevel    = gwt_log_level
    sourceLevel = java_lang_level

    compiler {
        strict = true;
        optimize = gwt_compiler_optimize;
        enableClosureCompiler = gwt_compiler_enableClosureCompiler;
        disableCastChecking = true;
        localWorkers = 2;
        style = gwt_compiler_style;
        draftCompile = gwt_compiler_draftCompile;
    }

    superDev{
        noPrecompile = true;
    }
}

However, when I launch "gradle -i war", I see some strange stuff fed to the compiler like:

 /usr/java/jdk1.8.0_77/bin/java -Dgwt.persistentunitcachedir=/projects/xxxxx/xxxxx-war/build/gwt/cache -Xms512M -Xmx1024M -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp <... very long class path ...> com.google.gwt.dev.Compiler -sourceLevel 1.8 -logLevel WARN -war /projects/xxxxx/xxxxx-war/build/gwt/out -extra /projects/xxxxx/xxxxx-war/build/gwt/extra -workDir /projects/xxxxx/xxxxx-war/build/gwt/work -gen /projects/xxxxx/xxxxx-war/build/gwt/gen -localWorkers 2 -draftCompile -optimize 48 -XdisableCastChecking -style DETAILED -strict -XenableClosureCompiler com.xxxxx.web.AppDev

Look at the optimize and draftCompile options: I was expecting to see optimize value of 0 and no -draftCompile comman line flag. This plug-in seems to have problem picking up Integer and Boolean properties, while strings seems ok??? Note, If I hard-code the optimize value into the build.gradle file itself, it is picked up correctly.

What is going on?

Thanks

hrstoyanov commented 8 years ago

This does not appear to be a problem with Gradle 2.13 (but with this plug-in). Any ideas how to fix it?

Here is a task I implemented:

task printProps << {
    println gwt_compiler_optimize
    println gwt_compiler_draftCompile
}

and it correctly reports the two properties - 0 and false:

Executing: gradle :xxxxx-war:printProps
Arguments: [-c, /projects/xxxxxxxx/settings.gradle]

:xxxxx-war:printProps
0
false

BUILD SUCCESSFUL

Total time: 0.514 secs
hrstoyanov commented 8 years ago

Here is a temporary workaround:

gwt {
   ...
    compiler {
        ...
        optimize = gwt_compiler_optimize.toInteger();
        enableClosureCompiler = gwt_compiler_enableClosureCompiler.toBoolean();        
        draftCompile = gwt_compiler_draftCompile.toBoolean();
    }
    ...
}

As I mentioned, you only need the fix for boolean and integer params.

hrstoyanov commented 8 years ago

if anyone is still maintaining this plug-in, here is a possible fix: https://github.com/Putnami/putnami-gradle-plugin/commit/e689ca5b7dd74a7af87ae1509d3fb3fe663796a2

carlolf commented 7 years ago

use this fork: https://github.com/jiakuan/gwt-gradle-plugin

hrstoyanov commented 7 years ago

Moved out of this plug-in long time ago. Thanks though.

/Hristo Stoyanov

On Jul 12, 2017 10:12 AM, "Carlo Luib-Finetti" notifications@github.com wrote:

use this fork: https://github.com/jiakuan/gwt-gradle-plugin

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/steffenschaefer/gwt-gradle-plugin/issues/102#issuecomment-314835933, or mute the thread https://github.com/notifications/unsubscribe-auth/AFFIxHcLJdgxI2TxNQmf-tcDQh4t1yN4ks5sNP6SgaJpZM4IkGBB .