Skip to content

Commit

Permalink
Update android test dependency to android 4.4.2 cause of missed test …
Browse files Browse the repository at this point in the history
…result problem on 4.1.2
  • Loading branch information
Mikhael Bogdanov committed May 3, 2016
1 parent 249d08a commit 09509b6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
6 changes: 3 additions & 3 deletions compiler/android-tests/android-module/build.gradle
Expand Up @@ -18,13 +18,13 @@ repositories {
}

android {
compileSdkVersion 16
compileSdkVersion 19
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "org.jetbrains.kotlin.android.tests"
minSdkVersion 16
targetSdkVersion 16
minSdkVersion 19
targetSdkVersion 19
versionCode 1
versionName "1.0"
testApplicationId "org.jetbrains.kotlin.android.tests.gradle"
Expand Down
Expand Up @@ -42,7 +42,7 @@ public class SDKDownloader {
private static final String PLATFORM_TOOLS = "23.0.1";
private static final String SDK_TOOLS = "25.1.1";
public static final String BUILD_TOOLS = "23.0.3";
private static final int ANDROID_VERSION = 16;
private static final int ANDROID_VERSION = 19;


public SDKDownloader(PathManager pathManager) {
Expand All @@ -57,12 +57,12 @@ public SDKDownloader(PathManager pathManager) {
}

public void downloadPlatform() {
download("https://dl-ssl.google.com/android/repository/android-" + ANDROID_VERSION + "_r05.zip", platformZipPath); //Same for all platforms
download("https://dl-ssl.google.com/android/repository/android-" + ANDROID_VERSION + "_r04.zip", platformZipPath); //Same for all platforms
}

private void downloadAbi() {
download("https://dl.google.com/android/repository/sys-img/android/sysimg_armv7a-" + ANDROID_VERSION + "_r04.zip", armImage); //Same for all platforms
download("https://dl.google.com/android/repository/sys-img/android/sysimg_x86-" + ANDROID_VERSION + "_r02.zip", x86Image); //Same for all platforms
download("https://dl.google.com/android/repository/sys-img/android/sysimg_armv7a-" + ANDROID_VERSION + "_r03.zip", armImage); //Same for all platforms
download("https://dl.google.com/android/repository/sys-img/android/sysimg_x86-" + ANDROID_VERSION + "_r03.zip", x86Image); //Same for all platforms
}

public void downloadPlatformTools() {
Expand Down Expand Up @@ -111,7 +111,7 @@ public void downloadAll() {
public void unzipAll() {
String androidSdkRoot = pathManager.getAndroidSdkRoot();
unzip(platformZipPath, pathManager.getPlatformFolderInAndroidSdk());
new File(pathManager.getPlatformFolderInAndroidSdk() + "/android-4.1.2").renameTo(new File(pathManager.getPlatformFolderInAndroidSdk() + "/android-16"));
new File(pathManager.getPlatformFolderInAndroidSdk() + "/android-4.4.2").renameTo(new File(pathManager.getPlatformFolderInAndroidSdk() + "/android-" + ANDROID_VERSION));

unzip(armImage, androidSdkRoot + "/system-images/android-" + ANDROID_VERSION + "/default/");
unzip(x86Image, androidSdkRoot + "/system-images/android-" + ANDROID_VERSION + "/default/");
Expand Down
Expand Up @@ -131,16 +131,17 @@ public void startEmulator() {
startServer();
System.out.println("Starting emulator...");
RunUtils.executeOnSeparateThread(new RunUtils.RunSettings(getStartCommand(), null, false, "START: ", true));
//disabled cause of missed test results
//printLog();
printLog();
}

public void printLog() {
GeneralCommandLine commandLine = createAdbCommand();
commandLine.addParameter("logcat");
commandLine.addParameter("-v");
commandLine.addParameter("time");
commandLine.addParameter("*:I");
commandLine.addParameter("-s");
commandLine.addParameter("dalvikvm:W");
commandLine.addParameter("TestRunner:I");
RunUtils.executeOnSeparateThread(new RunUtils.RunSettings(commandLine, null, false, "LOGCAT: ", true));
}

Expand Down Expand Up @@ -174,13 +175,6 @@ public void waitEmulatorStart() {

public void stopEmulator() {
System.out.println("Stopping emulator...");
try {
//added cause of missed test results
Thread.sleep(40000);
}
catch (InterruptedException e) {
e.printStackTrace();
}

GeneralCommandLine command = createAdbCommand();
command.addParameter("-s");
Expand Down
Expand Up @@ -31,6 +31,7 @@ public static void setPermissions(PathManager pathManager) {
if (!SystemInfo.isWindows) {
RunUtils.execute(generateChmodCmd(pathManager.getAntBinDirectory() + "/ant"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk()));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk() + "/bin64"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getBuildToolsFolderInAndroidSdk() + "/" + SDKDownloader.BUILD_TOOLS));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getPlatformToolsFolderInAndroidSdk()));
RunUtils.execute(generateChmodCmd(pathManager.getGradleBinFolder() + "/gradle"));
Expand Down

0 comments on commit 09509b6

Please sign in to comment.