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

Better support for up-to-date checks #18

Open
rbaradari opened this issue Feb 7, 2014 · 6 comments
Open

Better support for up-to-date checks #18

rbaradari opened this issue Feb 7, 2014 · 6 comments

Comments

@rbaradari
Copy link

Setup

Gradle 1.10
Plugin 0.3
OS Windows 7

Scenario

Running gradle assemble multiple times in a row without changing any of the files.

Expected

The gwt tasks are executed on the first run but on the following runs the gwt tasks are skipped as UP-TO-DATE.

Observed

The gwt tasks are executed on each and every run although no source files have been changed. This is very tiring considering that the compileGwt task might take quite some time to generate the javascript.

@steffenschaefer
Copy link
Owner

up-to-date checks of compileGwt work for me. On the second run it's correctly marked as UP-TO-DATE. I tested it using one of the example projects and a real world project. The output of the example project's build:

[sts] -----------------------------------------------------
[sts] Starting Gradle build for the following tasks: 
[sts]      :example-simple-war:assemble
[sts] -----------------------------------------------------
The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.
:example-simple-war:compileJava UP-TO-DATE
:example-simple-war:processResources UP-TO-DATE
:example-simple-war:classes UP-TO-DATE
:example-simple-war:compileGwt UP-TO-DATE
:example-simple-war:war UP-TO-DATE
:example-simple-war:assemble UP-TO-DATE

BUILD SUCCESSFUL

Total time: 2.25 secs
[sts] -----------------------------------------------------
[sts] Build finished succesfully!
[sts] Time taken: 0 min, 2 sec
[sts] -----------------------------------------------------

So I guess it is related to your specific build. Be aware that not only the source files are relevant for the up-to-date check but also the compiler flags that possibly change the output (e.g. turning closure compiler on/off).

As far as I remember appending "-i" (sets the log level to info) to the gradle command line will show why the task isn't considered up-to-date.

I'll leave this issue open to wait for feedback. Possibly it's an issue that only occurs in a specific configuration.

@rbaradari
Copy link
Author

OK, I tested it some more.

The up-to-date check works fine but when I add style = 'DETAILED' the check is broken in our build. I can't get this reproduced in the the example project simple-war.

Output from gradle :compileGwt -i in our build is always although the style never changes:

Executing task ':compileGwt' (up-to-date check took 0.069 secs) due to:
  Value of input property 'style' has changed for task ':compileGwt'

@rbaradari
Copy link
Author

This seems to be a class loader problem or alike. After debugging gradle I can see that the current style value, when compared with the value from the previous run, is in fact two different instances of the same enum value.

object1 Style  (id=7033)    
    'object1' referenced from:  
    name    "OBF" (id=217)  
    ordinal 0 [0x0] [^@ (NUL)]  
object2 Style  (id=6977)    
    'object2' referenced from:  
    name    "OBF" (id=217)  
    ordinal 0 [0x0] [^@ (NUL)]  

@rlf
Copy link

rlf commented Mar 18, 2015

+1 sounds like #77 is a duplicate of this

@eriwen
Copy link

eriwen commented Jul 7, 2016

@rbaradari I'm investigating Gradle's handling of UP-TO-DATE checking when using enum properties as @Inputs. Indeed what's happening is that Gradle creates a new ClassLoader under certain circumstances (for example, if the build.gradle is changed) and since we're comparing instances of Style etc. from different ClassLoaders, they're not equal.

However, I'm having trouble reproducing the specific behavior you're seeing. I have created an example GWT project in the hopes of replicating this exact behavior.

It would be especially helpful if you could answer 2 things for me:

  1. Are you using the Gradle Daemon?
  2. Do you have any example project that you can share that exhibits the behavior you describe in this issue? If not, can you tell me what types of changes you're making and what Gradle tasks you're executing?

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

4 participants