use of com.android.tools.idea.gradle.dsl.parser.elements.GradleDslElementList in project android by JetBrains.
the class DependencyConfigurationModel method excludes.
@NotNull
public List<ExcludedDependencyModel> excludes() {
GradleDslElementList elementList = myConfigurationElement.getPropertyElement(EXCLUDE, GradleDslElementList.class);
if (elementList == null) {
return ImmutableList.of();
}
List<ExcludedDependencyModel> excludedDependencies = new ArrayList<>();
for (GradleDslExpressionMap excludeElement : elementList.getElements(GradleDslExpressionMap.class)) {
excludedDependencies.add(new ExcludedDependencyModel(excludeElement));
}
return excludedDependencies;
}
use of com.android.tools.idea.gradle.dsl.parser.elements.GradleDslElementList in project android by JetBrains.
the class DependenciesModel method all.
/**
* @return all the dependencies (artifact, module, etc.)
* WIP: Do not use.
*/
@NotNull
public List<DependencyModel> all() {
List<DependencyModel> dependencies = Lists.newArrayList();
for (String configurationName : myDslElement.getProperties()) {
GradleDslElementList list = myDslElement.getPropertyElement(configurationName, GradleDslElementList.class);
if (list != null) {
for (GradleDslElement element : list.getElements(GradleDslElement.class)) {
dependencies.addAll(ArtifactDependencyModel.create(element));
if (element instanceof GradleDslMethodCall) {
GradleDslMethodCall methodCall = (GradleDslMethodCall) element;
dependencies.addAll(ModuleDependencyModel.create(configurationName, methodCall));
}
}
}
}
return dependencies;
}
use of com.android.tools.idea.gradle.dsl.parser.elements.GradleDslElementList in project android by JetBrains.
the class DependenciesModel method addModule.
@NotNull
public DependenciesModel addModule(@NotNull String configurationName, @NotNull String path, @Nullable String config) {
GradleDslElementList list = getOrCreateGradleDslElementList(configurationName);
ModuleDependencyModel.createAndAddToList(list, configurationName, path, config);
return this;
}
use of com.android.tools.idea.gradle.dsl.parser.elements.GradleDslElementList in project android by JetBrains.
the class DependenciesModel method addFile.
@NotNull
public DependenciesModel addFile(@NotNull String configurationName, @NotNull String file) {
GradleDslElementList list = getOrCreateGradleDslElementList(configurationName);
FileDependencyModel.createAndAddToList(list, configurationName, file);
return this;
}
use of com.android.tools.idea.gradle.dsl.parser.elements.GradleDslElementList in project android by JetBrains.
the class DependencyConfigurationDslElement method addParsedElement.
@Override
public void addParsedElement(@NotNull String property, @NotNull GradleDslElement element) {
if (property.equals("exclude")) {
GradleDslElementList elementList = getPropertyElement(property, GradleDslElementList.class);
if (elementList == null) {
elementList = new GradleDslElementList(this, property);
super.addParsedElement(property, elementList);
}
elementList.addParsedElement(element);
return;
}
super.addParsedElement(property, element);
}
Aggregations