Skip to content

Commit

Permalink
Track kotlin usage without inspecting configurations in configuration…
Browse files Browse the repository at this point in the history
… phase (#7793)
  • Loading branch information
rorbech committed Apr 18, 2023
1 parent 1ea13b4 commit 8aaef4f
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,7 @@ class RealmTransformer(private val metadata: ProjectMetaData,
}

private fun Project.usesKotlin(): Boolean {
for (conf in project.configurations) {
try {
for (artifact: ResolvedArtifact in conf.resolvedConfiguration.resolvedArtifacts) {
if (artifact.name.startsWith("kotlin-stdlib")) {
return true
}
}
} catch (ignore: Exception) {
// Some artifacts might not be able to resolve, in this case, just ignore them.
}
}
return false
return project.pluginManager.hasPlugin("kotlin-kapt")
}
}

Expand Down

0 comments on commit 8aaef4f

Please sign in to comment.