Search in sources :

Example 1 with Type

use of com.android.tools.idea.gradle.dsl.model.android.SigningConfigModel.SigningConfigPassword.Type in project android by JetBrains.

the class SigningConfigModel method getPasswordValue.

@NotNull
private GradleNullableValue<SigningConfigPassword> getPasswordValue(@NotNull String property) {
    GradleDslExpression passwordElement = getPasswordElement(property);
    if (passwordElement == null) {
        return new GradleNullableValue<>(myDslElement, null);
    }
    Type passwordType;
    switch(passwordElement.getName()) {
        case SYSTEM_GETENV:
            passwordType = ENVIRONMENT_VARIABLE;
            break;
        case SYSTEM_CONSOLE_READ_LINE:
            passwordType = CONSOLE_READ;
            break;
        default:
            passwordType = PLAIN_TEXT;
            break;
    }
    String passwordText = passwordElement.getValue(String.class);
    if (passwordText != null) {
        return new GradleNullableValue<>(passwordElement, new SigningConfigPassword(passwordType, passwordText));
    }
    return new GradleNullableValue<>(passwordElement, null);
}
Also used : GradleNullableValue(com.android.tools.idea.gradle.dsl.model.values.GradleNullableValue) Type(com.android.tools.idea.gradle.dsl.model.android.SigningConfigModel.SigningConfigPassword.Type) GradleDslExpression(com.android.tools.idea.gradle.dsl.parser.elements.GradleDslExpression) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Type (com.android.tools.idea.gradle.dsl.model.android.SigningConfigModel.SigningConfigPassword.Type)1 GradleNullableValue (com.android.tools.idea.gradle.dsl.model.values.GradleNullableValue)1 GradleDslExpression (com.android.tools.idea.gradle.dsl.parser.elements.GradleDslExpression)1 NotNull (org.jetbrains.annotations.NotNull)1