Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form classes instrumentation always triggers Kotlin recompilation #116

Closed
matklad opened this issue Jul 7, 2016 · 11 comments · Fixed by #118
Closed

Form classes instrumentation always triggers Kotlin recompilation #116

matklad opened this issue Jul 7, 2016 · 11 comments · Fixed by #118
Milestone

Comments

@matklad
Copy link
Contributor

matklad commented Jul 7, 2016

if I execute ./graldew assemble twice, I expect the second time to be UP-TO-DATE. This unfortunately does not happen, and Kotlin is always recompiled. Running ./graldew assemble --info gives the following hint:

:compileKotlin (Thread[Daemon worker Thread 2,5,main]) started.
:compileKotlin
Executing task ':compileKotlin' (up-to-date check took 0.035 secs) due to:
  Output file intellij-rust/build/classes/main/org/rust/ide/idea/CargoConfigurationWizardStep.class has changed.
  Output file intellij-rust/build/classes/main/org/rust/cargo/project/settings/ui/RustProjectSettingsPanel.class has changed.
  Output file intellij-rust/build/classes/main/org/rust/cargo/project/configurable/RustProjectConfigurable.class has changed.
All input files are considered out-of-date for incremental task ':compileKotlin'.

Those are Kotlin classes bound to the GUI designer forms.

@zolotov
Copy link
Member

zolotov commented Jul 7, 2016

Sorry, I doubt I can do anything with this

@matklad
Copy link
Contributor Author

matklad commented Jul 7, 2016

Can't the instrumentation task be skipped if it should be up to date?

@zolotov
Copy link
Member

zolotov commented Jul 7, 2016

Instrumentation task is not task. It's kotlin task out-of-date

@matklad
Copy link
Contributor Author

matklad commented Jul 7, 2016

Hm, maybe doLast hook should be used for instrumentation?

I was able to workaround the issue by using instrumentCode=false and instead invoking the instrumentation manually in the doLast: https://gist.github.com/matklad/0685977255fad061d69bee8fa2a0e4dd

@matklad
Copy link
Contributor Author

matklad commented Jul 7, 2016

@zolotov
Copy link
Member

zolotov commented Jul 7, 2016

Hm, maybe doLast hook should be used for instrumentation?

doLast is used for that

@matklad
Copy link
Contributor Author

matklad commented Jul 7, 2016

doLast is used for that

I mean that if I manually add instrumentation to the doLast, like this, then no recompilation happens and everything seem to work fine. If I just use instrumentCode = true, then the recompilations do happen.

Perhaps intellij gradle plugin can provide a function which takes compile task as an argument, and instruments its output? That way the plugin user can add doLast to compile tasks manually and avoid spurious recompilations.

@zolotov
Copy link
Member

zolotov commented Jul 7, 2016

I mean that if I manually add instrumentation to the doLast, like this, then no recompilation happens and everything seem to work fine. If I just use instrumentCode = true, then the recompilations do happen.

This is because you add an instrumentation after kotlin compilation only, gradle-intellij-plugin has to do it for after every compilation task. I can try to merge several compilation tasks by its output but not sure it will work well.

Perhaps intellij gradle plugin can provide a function which takes compile task as an argument, and instruments its output?

It's possible, but there is still a problem if you set several tasks with the same output

@matklad
Copy link
Contributor Author

matklad commented Jul 7, 2016

can try to merge several compilation tasks by its output but not sure it will work well.

Won't something like this work?

@zolotov
Copy link
Member

zolotov commented Jul 8, 2016

maybe it will. have you tried it?

@matklad
Copy link
Contributor Author

matklad commented Jul 8, 2016

It works for intellij-rust, but don't know gradle well enough to be sure that it always works :)

matklad added a commit to matklad/gradle-intellij-plugin that referenced this issue Jul 8, 2016
matklad added a commit to matklad/gradle-intellij-plugin that referenced this issue Jul 8, 2016
@zolotov zolotov added this to the 0.2.0 milestone Aug 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants