check-flagged-apis: extract argument names into constants
Extract the command line argument names (and help texts) into constants. This will allow future subcommands to re-use the same names and keep things consistent. Bug: 345207706 Test: atest check-flagged-apis-test Flag: EXEMPT host side tool Change-Id: I430f36c99f28aab8511a357f572086ee238d653b
This commit is contained in:
@@ -142,6 +142,29 @@ internal data class UnknownFlagError(override val symbol: Symbol, override val f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val ARG_API_SIGNATURE = "--api-signature"
|
||||||
|
val ARG_API_SIGNATURE_HELP =
|
||||||
|
"""
|
||||||
|
Path to API signature file.
|
||||||
|
Usually named *current.txt.
|
||||||
|
Tip: `m frameworks-base-api-current.txt` will generate a file that includes all platform and mainline APIs.
|
||||||
|
"""
|
||||||
|
|
||||||
|
val ARG_FLAG_VALUES = "--flag-values"
|
||||||
|
val ARG_FLAG_VALUES_HELP =
|
||||||
|
"""
|
||||||
|
Path to aconfig parsed_flags binary proto file.
|
||||||
|
Tip: `m all_aconfig_declarations` will generate a file that includes all information about all flags.
|
||||||
|
"""
|
||||||
|
|
||||||
|
val ARG_API_VERSIONS = "--api-versions"
|
||||||
|
val ARG_API_VERSIONS_HELP =
|
||||||
|
"""
|
||||||
|
Path to API versions XML file.
|
||||||
|
Usually named xml-versions.xml.
|
||||||
|
Tip: `m sdk dist` will generate a file that includes all platform and mainline APIs.
|
||||||
|
"""
|
||||||
|
|
||||||
class MainCommand : CliktCommand() {
|
class MainCommand : CliktCommand() {
|
||||||
override fun run() {}
|
override fun run() {}
|
||||||
}
|
}
|
||||||
@@ -157,32 +180,18 @@ This tool reads the API signature file and checks that all flagged APIs are used
|
|||||||
The tool will exit with a non-zero exit code if any flagged APIs are found to be used in the incorrect way.
|
The tool will exit with a non-zero exit code if any flagged APIs are found to be used in the incorrect way.
|
||||||
""") {
|
""") {
|
||||||
private val apiSignaturePath by
|
private val apiSignaturePath by
|
||||||
option("--api-signature")
|
option(ARG_API_SIGNATURE)
|
||||||
.help(
|
.help(ARG_API_SIGNATURE_HELP)
|
||||||
"""
|
|
||||||
Path to API signature file.
|
|
||||||
Usually named *current.txt.
|
|
||||||
Tip: `m frameworks-base-api-current.txt` will generate a file that includes all platform and mainline APIs.
|
|
||||||
""")
|
|
||||||
.path(mustExist = true, canBeDir = false, mustBeReadable = true)
|
.path(mustExist = true, canBeDir = false, mustBeReadable = true)
|
||||||
.required()
|
.required()
|
||||||
private val flagValuesPath by
|
private val flagValuesPath by
|
||||||
option("--flag-values")
|
option(ARG_FLAG_VALUES)
|
||||||
.help(
|
.help(ARG_FLAG_VALUES_HELP)
|
||||||
"""
|
|
||||||
Path to aconfig parsed_flags binary proto file.
|
|
||||||
Tip: `m all_aconfig_declarations` will generate a file that includes all information about all flags.
|
|
||||||
""")
|
|
||||||
.path(mustExist = true, canBeDir = false, mustBeReadable = true)
|
.path(mustExist = true, canBeDir = false, mustBeReadable = true)
|
||||||
.required()
|
.required()
|
||||||
private val apiVersionsPath by
|
private val apiVersionsPath by
|
||||||
option("--api-versions")
|
option(ARG_API_VERSIONS)
|
||||||
.help(
|
.help(ARG_API_VERSIONS_HELP)
|
||||||
"""
|
|
||||||
Path to API versions XML file.
|
|
||||||
Usually named xml-versions.xml.
|
|
||||||
Tip: `m sdk dist` will generate a file that includes all platform and mainline APIs.
|
|
||||||
""")
|
|
||||||
.path(mustExist = true, canBeDir = false, mustBeReadable = true)
|
.path(mustExist = true, canBeDir = false, mustBeReadable = true)
|
||||||
.required()
|
.required()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user