Skip to content

Commit

Permalink
Stop Proguard throwing away all the backends
Browse files Browse the repository at this point in the history
Specifically all the subclasses and BackendName.byDisplayName(String)

Slightly surprised that all the comparisons against those subclass
objects didn't cause it to rethink that plan.
  • Loading branch information
chrisboyle committed Oct 15, 2023
1 parent 1be038a commit 2b9a901
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ sealed class BackendName(
all.associateBy { it.displayName }
}

@UsedByJNI
@JvmStatic
fun byDisplayName(name: String?) = BY_DISPLAY_NAME[name]

Expand Down
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/GenerateBackendsTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ abstract class GenerateBackendsTask: DefaultTask() {
val keyPrefix = "${puz}_sym_key_"
val keyIcons = definedKeyIcons.filter { it.startsWith(keyPrefix) }
.map { "\"${it.removePrefix(keyPrefix)}\" to R.drawable.$it" }
return """object $objName : BackendName(
return """@UsedByJNI
|object $objName : BackendName(
| "$puz", "$display", "$title",
| R.drawable.$puz,
| R.string.desc_$puz, $toast, $toastNoArrows,
Expand Down

0 comments on commit 2b9a901

Please sign in to comment.