https://kotlinlang.org logo
#strikt
Title
# strikt
r

robfletcher

05/16/2018, 6:27 PM
@danny here’s a good issue for the Gradle expert! https://github.com/robfletcher/strikt/issues/22
d

danny

05/16/2018, 6:33 PM
If that’s a published artifact, it should be an implicit dependency of the publication task
That said, I don’t see anything there that would make your tests run either
Let me look at the release tasks more closely
clean build final
is probably all you need, I think the readme on Spring release is wrong
r

robfletcher

05/16/2018, 6:48 PM
I thought this line should establish the dependency https://github.com/robfletcher/strikt/blob/master/gradle/published.gradle#L24
clean build final
is all I’m doing
actually not even
clean
d

danny

05/16/2018, 8:23 PM
Weird, the publication should be taking care of that
You could wire an explicit dependsOn to assemble for dokkaJar
r

robfletcher

05/16/2018, 8:24 PM
right? I guess it’s because I’m hijacking the javadoc task with dokka
d

danny

05/16/2018, 8:25 PM
mustRunAfter
also doesn’t cause tasks to run incidentally
If the tasks aren’t included in the task graph by the requested tasks, they don’t run
That’s what
dependsOn
is for
r

robfletcher

05/16/2018, 8:25 PM
right, all that’s doing is making sure Javadoc doesn’t overwrite the stuff Dokka generates. The reason dokka runs is that dependency in the publication
might be a better way of turning off javadoc
d

danny

05/16/2018, 8:26 PM
If I want to hijack a task, have your new task depend on the old, and set
enabled = false
on the original task
Disabling the task doesn’t affect the task graph and the dependency will still execute
r

robfletcher

05/16/2018, 8:27 PM
aha
d

danny

05/16/2018, 8:27 PM
In this case
Copy code
javadoc.dependsOn dokka; javadoc.enabled = false
And
dokkaJar.dependsOn dokka
Then when
dokkaJar
is called for the publication, everything should happen implicitly
r

robfletcher

05/16/2018, 8:28 PM
isn’t that implied by dokkaJar having
from(dokka)
?
d

danny

05/16/2018, 8:28 PM
Yep, any source that’s buildable becomes an implicit dependency
r

robfletcher

05/16/2018, 8:29 PM
so adding this:
Copy code
javadoc.dependsOn dokka
javadoc.enabled = false

javadocJar.dependsOn dokkaJar
javadocJar.enabled = false
Hmm
Copy code
Invalid publication 'nebula': multiple artifacts with the identical extension and classifier ('jar', 'javadoc').
That’ll be my dokkaJar conflicting with the javadoc one applied by nebula release
Ok, I have another way:
Copy code
javadoc.enabled = false
task(javadocJar, type: Jar, overwrite: true) {
  group = "documentation"
  description = "Assembles Kotlin docs with Dokka"
  classifier = "javadoc"
  from(dokka)
}
Then I can remove the publication stuff and Nebula just does it for me because I hijacked the regular javadocJar task
well, that fixed the problem
11 Views