-
Notifications
You must be signed in to change notification settings - Fork 24
Add support of '--min-api' d8 argument #1000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ class ExtensionManifestValidator { | |
|
|
||
| private static final Pattern VALID_INCLUDE_PATH = Pattern.compile("^[A-Za-z0-9._+\\-/]+$"); | ||
| private static final Pattern VALID_SYMBOL_IDENTIFIER = Pattern.compile("^[A-Za-z_][A-Za-z0-9_]*$"); | ||
| private static final Pattern VALID_API_LEVEL = Pattern.compile("^[0-9]+$"); | ||
|
|
||
| ExtensionManifestValidator(WhitelistConfig whitelistConfig, List<String> allowedFlags, List<String> allowedSymbols) { | ||
| this.allowedDefines.add(WhitelistConfig.compile(whitelistConfig.defineRe)); | ||
|
|
@@ -57,6 +58,16 @@ void validateAppManifestContext(Map<String, Object> appContext) throws ExtenderE | |
| ExtenderBuildState.APPMANIFEST_DEBUG_SOURCE_PATH, s)); | ||
| } | ||
| } | ||
|
|
||
| // Reaches the command line as the argument of d8 --min-api, so it must be a bare number. | ||
| Object minAndroidSdkVersion = appContext.get(ExtenderBuildState.APPMANIFEST_MIN_ANDROID_SDK_VERSION_KEYWORD); | ||
| if (minAndroidSdkVersion != null && !(minAndroidSdkVersion instanceof Integer)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For an unquoted YAML value such as Useful? React with 👍 / 👎. |
||
| if (!(minAndroidSdkVersion instanceof String) || !VALID_API_LEVEL.matcher((String) minAndroidSdkVersion).matches()) { | ||
| throw new ExtenderException(String.format( | ||
| "Error in app.manifest: '%s' must be an integer, got '%s'.", | ||
| ExtenderBuildState.APPMANIFEST_MIN_ANDROID_SDK_VERSION_KEYWORD, minAndroidSdkVersion)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private void validateIncludePaths(String extensionName, File extensionFolder, List<String> includes) throws ExtenderException { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we pass it from somewhere in configs? I thought we have it somewhere specified based on toolchain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We pass ndk min version and right now there are no unified approach to manage ndk and sdk minimum version. I think it should be fixed as part of #726