Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

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

Open
hrstoyanov opened this issue May 22, 2016 · 5 comments
Open

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

hrstoyanov opened this issue May 22, 2016 · 5 comments

Comments

@hrstoyanov
Copy link

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
Copy link
Author

hrstoyanov commented May 22, 2016

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
Copy link
Author

hrstoyanov commented May 24, 2016

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
Copy link
Author

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

@carlolf
Copy link

carlolf commented Jul 12, 2017

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

@hrstoyanov
Copy link
Author

hrstoyanov commented Jul 14, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants