https://kotlinlang.org logo
Title
s

Smallville7123

04/05/2019, 12:46 AM
how do i make a task execute before compileDebugKotlin
Could not get unknown property 'compileDebugKotlin' for project ':app' of type org.gradle.api.Project.
compileDebugKotlin.dependsOn MyTask
g

gildor

04/05/2019, 3:24 AM
compileDebugKotlin
is not a property, this is a task
You can probably wrap it with
afterEvaluate {}
block if for some reason task applied lazily
s

Smallville7123

04/05/2019, 3:32 AM
what happens when a project is evaluated
g

gildor

04/05/2019, 3:32 AM
it means that all plugins applied already
s

Smallville7123

04/05/2019, 3:32 AM
g

gildor

04/05/2019, 3:33 AM
Gradle determines the subset of the tasks, created and configured during the configuration phase, to be executed. The subset is determined by the task name arguments passed to the gradle command and the current directory
anyway this is just a way to postpone configuration
s

Smallville7123

04/05/2019, 6:12 AM
ok
so the compile** tasks cannot be... hooked?
g

gildor

04/06/2019, 2:07 PM
Usually you can do this by apply configuration after plugin application, not sure why it doesn't work in this case
s

Smallville7123

04/06/2019, 2:55 PM
could you post an example of this? also imma go to bed, its 00:55
g

gildor

04/06/2019, 4:17 PM
Example of what?
s

Smallville7123

04/07/2019, 1:19 AM
example of how a task could be executed at compile time
g

gildor

04/07/2019, 9:55 AM
What do you mean? Tasks always executing during build/compile process
s

Smallville7123

04/07/2019, 10:51 AM
Ok