Skip to content

Commit

Permalink
Drop KotlinCompilerVersion as it's not necessary (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
WhosNickDoglio authored Jan 23, 2023
1 parent 7625683 commit dc03024
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The GIF showcases how simple it is:
<tr>
<td>Kt dependencies (2/3)</td>
<td>"org.jetbrains.kotlin:kotlin-stdlib:$kt_v"</td>
<td>kotlin("stdlib", KotlinCompilerVersion.VERSION)</td>
<td>kotlin("stdlib")</td>
</tr>
<tr>
<td>Kt dependencies (3/3)</td>
Expand Down
10 changes: 4 additions & 6 deletions expected_build_gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.config.KotlinCompilerVersion

plugins {
id("com.android.application")
id("kotlin-android")
Expand Down Expand Up @@ -52,10 +50,10 @@ configurations.classpath {
exclude(group = "com.android.tools.external.lombok")
}

implementation(kotlin("stdlib", KotlinCompilerVersion.VERSION))
implementation(kotlin("stdlib", KotlinCompilerVersion.VERSION))
releaseImplementation(kotlin("stdlib", KotlinCompilerVersion.VERSION))
debugImplementation(kotlin("stdlib", KotlinCompilerVersion.VERSION))
implementation(kotlin("stdlib"))
implementation(kotlin("stdlib"))
releaseImplementation(kotlin("stdlib"))
debugImplementation(kotlin("stdlib"))

classpath(kotlin("gradle-plugin", version = "$kotlin_version"))
classpath(kotlin("gradle-plugin", version = "1.3.20"))
Expand Down
10 changes: 3 additions & 7 deletions gradlekotlinconverter.kts
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ fun String.convertExcludeGroups(): String {
//
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// becomes
// implementation(kotlin("stdlib", KotlinCompilerVersion.VERSION))
// implementation(kotlin("stdlib"))
fun String.convertJetBrainsKotlin(): String {

// if string is implementation("..."), this will extract only the ...
Expand All @@ -660,19 +660,15 @@ fun String.convertJetBrainsKotlin(): String {

if ("stdlib" in substring) {
shouldImportKotlinCompiler = true
"kotlin(\"stdlib\", KotlinCompilerVersion.VERSION)"
"kotlin(\"stdlib\")"
} else if (splittedSubstring.size == 2) {
"kotlin(\"${splittedSubstring[0]}\", version = \"${splittedSubstring[1]}\")"
} else {
"kotlin(\"${splittedSubstring[0]}\")"
}
}

return if (shouldImportKotlinCompiler) {
"import org.jetbrains.kotlin.config.KotlinCompilerVersion\n\n" + newText
} else {
newText
}
return newText
}


Expand Down

0 comments on commit dc03024

Please sign in to comment.