title: Gradle publish depending on custom task using Kotlin dsl
body: <p>I'm switching from groovy to Kotlin dsl (build.gradle.kts) for Gradle builds. My publish artifact depends on my custom task. And I do not understand how to make this dependency in Kotlin dsl.</p>
  
  <p>Original groovy code that I like to migrate to Kotlin dsl:</p>
  
  <pre><code>publish.dependsOn doSomething
  </code></pre>
  
  <p>Tasks that I am trying to chain:</p>
  
  <pre><code>val doSomething by tasks.creating(ShellExec::class) {
      command = "./do-something"
  }
  
  publishing {
      repositories {
          maven {
              ...
          }
      }
  
      publications {
          register("mavenJava", MavenPublication::class) {
              ...
          }
      }
  }
  </code></pre>