Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
5peak2me authored Jun 29, 2022
1 parent ac599e6 commit d60564b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gradlekotlinconverter.kts
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,14 @@ fun String.addParenthesisToId(): String {
// versionCode = 4
fun String.addEquals(): String {

val compileSdk = "compileSdk"
val signing = "keyAlias|keyPassword|storeFile|storePassword"
val other = "multiDexEnabled|correctErrorTypes|javaMaxHeapSize|jumboMode|dimension|useSupportLibrary"
val databinding = "dataBinding|viewBinding"
val defaultConfig = "applicationId|versionCode|versionName|testInstrumentationRunner"
val defaultConfig = "applicationId|minSdk|targetSdk|versionCode|versionName|testInstrumentationRunner"
val negativeLookAhead = "(?!\\{)[^\\s]" // Don't want '{' as next word character

val versionExp = """($defaultConfig|$signing|$other|$databinding)\s*${negativeLookAhead}.*""".toRegex()
val versionExp = """($compileSdk|$defaultConfig|$signing|$other|$databinding)\s*${negativeLookAhead}.*""".toRegex()

return this.replace(versionExp) {
val split = it.value.split(" ")
Expand Down

0 comments on commit d60564b

Please sign in to comment.