Slide 106
Slide 106 text
class AndroidBinaryContext : FunctionCallContext() {
var name: Name by fargs
var custom_package: StringType? by fargs
var manifest: Label? by fargs
var manifest_values: DictionaryType? by fargs
var debug_key: Label? by fargs
var enable_data_binding: BooleanType? by fargs
var multidex: StringType? by fargs
var incremental_dexing: NumberType? by fargs
var crunch_png: BooleanType? by fargs
var dex_shards: NumberType? by fargs
var resource_files: ListType? by fargs
var srcs: ListType? by fargs
var plugins: ListType? by fargs
var deps: ListType? by fargs
var visibility: ListType? by fargs
var args: ListType? by fargs
var env: DictionaryType? by fargs
var output_licenses: ListType? by fargs
}
fun BuildStatementsLibrary.`android_binary`(body: AndroidBinaryContext.() -> Unit): Unit =
registerFunctionCallStatement("android_binary", AndroidBinaryContext(), body)
Applying KSP
106
fun BuildStatementsLibrary.`android_binary`(
name: Name,
custom_package: StringType? = UnspecifiedString,
manifest: Label? = UnspecifiedString,
manifest_values: DictionaryType? = UnspecifiedDictionary,
debug_key: Label? = UnspecifiedString,
enable_data_binding: BooleanType? = UnspecifiedBoolean,
multidex: StringType? = UnspecifiedString,
incremental_dexing: NumberType? = UnspecifiedNumber,
crunch_png: BooleanType? = UnspecifiedBoolean,
dex_shards: NumberType? = UnspecifiedNumber,
resource_files: ListType? = UnspecifiedList,
srcs: ListType? = UnspecifiedList,
plugins: ListType? = UnspecifiedList,
deps: ListType? = UnspecifiedList,
visibility: ListType? = UnspecifiedList,
args: ListType? = UnspecifiedList,
env: DictionaryType? = UnspecifiedDictionary,
output_licenses: ListType? = UnspecifiedList
): Unit {
val _args = linkedSetOf().also {
it += Argument("name", Expression(name, ::StringLiteral))
if (custom_package !== UnspecifiedString)
it += Argument("custom_package", Expression(custom_package, ::StringLiteral))
if (manifest !== UnspecifiedString)
it += Argument("manifest", Expression(manifest, ::StringLiteral))
if (manifest_values !== UnspecifiedDictionary)
it += Argument("manifest_values", Expression(manifest_values, ::DictionaryExpression))
if (debug_key !== UnspecifiedString)
it += Argument("debug_key", Expression(debug_key, ::StringLiteral))
if (enable_data_binding !== UnspecifiedBoolean)
it += Argument("enable_data_binding", Expression(enable_data_binding, ::BooleanLiteral))
if (multidex !== UnspecifiedString)
it += Argument("multidex", Expression(multidex, ::StringLiteral))
if (incremental_dexing !== UnspecifiedNumber)
it += Argument("incremental_dexing", Expression(incremental_dexing, ::NumberLiteral))
if (crunch_png !== UnspecifiedBoolean)
it += Argument("crunch_png", Expression(crunch_png, ::BooleanLiteral))
if (dex_shards !== UnspecifiedNumber)
it += Argument("dex_shards", Expression(dex_shards, ::NumberLiteral))
if (resource_files !== UnspecifiedList)
it += Argument("resource_files", Expression(resource_files, ::ListExpression))
if (srcs !== UnspecifiedList)
it += Argument("srcs", Expression(srcs, ::ListExpression))
if (plugins !== UnspecifiedList)
it += Argument("plugins", Expression(plugins, ::ListExpression))
if (deps !== UnspecifiedList)
it += Argument("deps", Expression(deps, ::ListExpression))
if (visibility !== UnspecifiedList)
it += Argument("visibility", Expression(visibility, ::ListExpression))
if (args !== UnspecifiedList)
it += Argument("args", Expression(args, ::ListExpression))
if (env !== UnspecifiedDictionary)
it += Argument("env", Expression(env, ::DictionaryExpression))
if (output_licenses !== UnspecifiedList)
it += Argument("output_licenses", Expression(output_licenses, ::ListExpression))
}
return registerFunctionCallStatement("android_binary", _args)
}