check-flagged-apis: add support for subcommands
The tool currently only supports a single subcommand, the "check" command. Follow-up CLs will add new subcommands. Bug: 345207706 Test: build/tools/check-flagged-apis/check-flagged-apis.sh Flag: EXEMPT host side tool Change-Id: I1aaaf313db8a10a7427aab378aac8d946d5a8a3d
This commit is contained in:
parent
a96b36bd9f
commit
d5ce20fc07
2 changed files with 10 additions and 5 deletions
|
@ -56,7 +56,7 @@ function run() {
|
|||
local errors=0
|
||||
|
||||
echo "# current"
|
||||
check-flagged-apis \
|
||||
check-flagged-apis check \
|
||||
--api-signature $(path_to_api_signature_file "frameworks-base-api-current.txt") \
|
||||
--flag-values $(gettop)/out/soong/.intermediates/all_aconfig_declarations.pb \
|
||||
--api-versions $PUBLIC_XML_VERSIONS
|
||||
|
@ -64,7 +64,7 @@ function run() {
|
|||
|
||||
echo
|
||||
echo "# system-current"
|
||||
check-flagged-apis \
|
||||
check-flagged-apis check \
|
||||
--api-signature $(path_to_api_signature_file "frameworks-base-api-system-current.txt") \
|
||||
--flag-values $(gettop)/out/soong/.intermediates/all_aconfig_declarations.pb \
|
||||
--api-versions $SYSTEM_XML_VERSIONS
|
||||
|
@ -72,7 +72,7 @@ function run() {
|
|||
|
||||
echo
|
||||
echo "# system-server-current"
|
||||
check-flagged-apis \
|
||||
check-flagged-apis check \
|
||||
--api-signature $(path_to_api_signature_file "frameworks-base-api-system-server-current.txt") \
|
||||
--flag-values $(gettop)/out/soong/.intermediates/all_aconfig_declarations.pb \
|
||||
--api-versions $SYSTEM_SERVER_XML_VERSONS
|
||||
|
@ -80,7 +80,7 @@ function run() {
|
|||
|
||||
echo
|
||||
echo "# module-lib"
|
||||
check-flagged-apis \
|
||||
check-flagged-apis check \
|
||||
--api-signature $(path_to_api_signature_file "frameworks-base-api-module-lib-current.txt") \
|
||||
--flag-values $(gettop)/out/soong/.intermediates/all_aconfig_declarations.pb \
|
||||
--api-versions $MODULE_LIB_XML_VERSIONS
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.android.tools.metalava.model.MethodItem
|
|||
import com.android.tools.metalava.model.text.ApiFile
|
||||
import com.github.ajalt.clikt.core.CliktCommand
|
||||
import com.github.ajalt.clikt.core.ProgramResult
|
||||
import com.github.ajalt.clikt.core.subcommands
|
||||
import com.github.ajalt.clikt.parameters.options.help
|
||||
import com.github.ajalt.clikt.parameters.options.option
|
||||
import com.github.ajalt.clikt.parameters.options.required
|
||||
|
@ -141,6 +142,10 @@ internal data class UnknownFlagError(override val symbol: Symbol, override val f
|
|||
}
|
||||
}
|
||||
|
||||
class MainCommand : CliktCommand() {
|
||||
override fun run() {}
|
||||
}
|
||||
|
||||
class CheckCommand :
|
||||
CliktCommand(
|
||||
help =
|
||||
|
@ -446,4 +451,4 @@ internal fun findErrors(
|
|||
return errors
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) = CheckCommand().main(args)
|
||||
fun main(args: Array<String>) = MainCommand().subcommands(CheckCommand()).main(args)
|
||||
|
|
Loading…
Reference in a new issue