title: versionCodeOverride equivalent for Gradle Kotlin DSL
body: <pre><code>    android.applicationVariants.all { variant -&gt;
          variant.outputs.each { output -&gt;
              int newVersionCode = android.defaultConfig.versionCode * 10 + abiVersionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0)
  
              output.versionCodeOverride = newVersionCode
          }
      }
  </code></pre>
  
  <p>I am trying to convert this Gradle Groovy DSL code to the new Gradle Kotlin DSL. I want the code to work exactly like it used to were APK splitted variant follows my versionCode pattern</p>
  
  <p>This is what i have tried to write in Kotlin DSL:</p>
  
  <pre><code>    applicationVariants.all(object : Action&lt;ApplicationVariant&gt; {
          override fun execute(variant: ApplicationVariant) {
              variant.outputs.forEach {output -&gt;
                  val newVersionCode = defaultConfig.versionCode ?: 0 * 10 + abiVersionCodes[output.filters.first { it.identifier == com.android.build.OutputFile.ABI }]
                  output.versionCodeOverride = newVersionCode
              }
          }
      })
  </code></pre>
  
  <p>But it says: "Unresolved reference: versionCodeOverride"</p>
  
  <p>What is the correct way of doing this with Kotlin DSL?</p>