use of com.android.tools.idea.gradle.dsl.model.android.AndroidModel in project android by JetBrains.
the class ReferenceResolutionTest method testResolveProjectPath.
public void testResolveProjectPath() throws Exception {
String settingsText = "include ':" + SUB_MODULE_NAME + "'";
String mainModuleText = "";
String subModuleText = "android {\n" + " compileSdkVersion = \"android-23\"\n" + " defaultConfig {\n" + " minSdkVersion = project(':" + SUB_MODULE_NAME + "').android.compileSdkVersion\n" + " }\n" + "}";
writeToSettingsFile(settingsText);
writeToBuildFile(mainModuleText);
writeToSubModuleBuildFile(subModuleText);
AndroidModel android = getSubModuleGradleBuildModel().android();
assertNotNull(android);
assertEquals("compileSdkVersion", "android-23", android.compileSdkVersion());
assertEquals("minSdkVersion", "android-23", android.defaultConfig().minSdkVersion());
}
use of com.android.tools.idea.gradle.dsl.model.android.AndroidModel in project android by JetBrains.
the class ReferenceResolutionTest method testResolveProject.
public void testResolveProject() throws Exception {
String settingsText = "include ':" + SUB_MODULE_NAME + "'";
String mainModuleText = "";
String subModuleText = "android {\n" + " compileSdkVersion = \"android-23\"\n" + " defaultConfig {\n" + " minSdkVersion = project.android.compileSdkVersion\n" + " }\n" + "}";
writeToSettingsFile(settingsText);
writeToBuildFile(mainModuleText);
writeToSubModuleBuildFile(subModuleText);
AndroidModel android = getSubModuleGradleBuildModel().android();
assertNotNull(android);
assertEquals("compileSdkVersion", "android-23", android.compileSdkVersion());
assertEquals("minSdkVersion", "android-23", android.defaultConfig().minSdkVersion());
}
use of com.android.tools.idea.gradle.dsl.model.android.AndroidModel in project android by JetBrains.
the class ReferenceResolutionTest method testResolveOtherProjectPath.
public void testResolveOtherProjectPath() throws Exception {
String settingsText = "include ':" + SUB_MODULE_NAME + "'";
String mainModuleText = "android {\n" + " compileSdkVersion = \"android-23\"\n" + "}";
String subModuleText = "android {\n" + " compileSdkVersion = project(':').android.compileSdkVersion\n" + "}";
writeToSettingsFile(settingsText);
writeToBuildFile(mainModuleText);
writeToSubModuleBuildFile(subModuleText);
AndroidModel androidModel = getGradleBuildModel().android();
assertNotNull(androidModel);
assertEquals("compileSdkVersion", "android-23", androidModel.compileSdkVersion());
AndroidModel subModuleAndroidModel = getSubModuleGradleBuildModel().android();
assertNotNull(subModuleAndroidModel);
assertEquals("compileSdkVersion", "android-23", subModuleAndroidModel.compileSdkVersion());
}
Aggregations