Skip to content

Commit

Permalink
Update script to support releaseImplementation (#56)
Browse files Browse the repository at this point in the history
Co-authored-by: Nick Doglio <nicholasdo@zillow.com>
  • Loading branch information
WhosNickDoglio and WhosNickDoglio authored Jan 16, 2023
1 parent 13f7d82 commit 7625683
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions expected_build_gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ configurations.classpath {

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

classpath(kotlin("gradle-plugin", version = "$kotlin_version"))
classpath(kotlin("gradle-plugin", version = "1.3.20"))
Expand Down
3 changes: 2 additions & 1 deletion gradlekotlinconverter.kts
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,10 @@ fun String.convertCompileToImplementation(): String {
// implementation(":epoxy-annotations")
fun String.convertDependencies(): String {

val testKeywords = "testImplementation|androidTestImplementation|debugImplementation|compileOnly|testCompileOnly|runtimeOnly|developmentOnly"
val testKeywords = "testImplementation|androidTestImplementation|debugImplementation|releaseImplementation|compileOnly|testCompileOnly|runtimeOnly|developmentOnly"
val gradleKeywords = "($testKeywords|implementation|api|annotationProcessor|classpath|kaptTest|kaptAndroidTest|kapt|check|ksp|coreLibraryDesugaring|detektPlugins|lintPublish|lintCheck)".toRegex()


// ignore cases like kapt { correctErrorTypes = true } and apply plugin: ('kotlin-kapt") but pass kapt("...")
// ignore keyWord followed by a space and a { or a " and a )
val validKeywords = "(?!$gradleKeywords\\s*(\\{|\"\\)|\\.))$gradleKeywords.*".toRegex()
Expand Down
2 changes: 2 additions & 0 deletions test_build_gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ configurations.classpath.exclude group: 'com.android.tools.external.lombok'

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
releaseImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
debugImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20")
Expand Down

0 comments on commit 7625683

Please sign in to comment.