Merge branch 'emulator-v23' into 'master'
CI: replace v17 emulator with v23 See merge request !340
This commit is contained in:
commit
07a8b7a935
@ -1,4 +1,4 @@
|
|||||||
image: mvdan/fdroid-ci:client-20160617
|
image: mvdan/fdroid-ci:client-20160621
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
@ -47,9 +47,9 @@ connected10:
|
|||||||
- exit $EXITVALUE
|
- exit $EXITVALUE
|
||||||
allow_failure: true # remove once install segfaults are gone
|
allow_failure: true # remove once install segfaults are gone
|
||||||
|
|
||||||
connected17:
|
connected23:
|
||||||
variables:
|
variables:
|
||||||
AVD_SDK: "17"
|
AVD_SDK: "23"
|
||||||
script:
|
script:
|
||||||
- export GRADLE_USER_HOME=$PWD/.gradle
|
- export GRADLE_USER_HOME=$PWD/.gradle
|
||||||
- emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
|
- emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
|
||||||
|
@ -11,7 +11,7 @@ dependencies {
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 23
|
||||||
buildToolsVersion '23.0.3'
|
buildToolsVersion '24'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 8
|
minSdkVersion 8
|
||||||
|
@ -140,7 +140,7 @@ if (!hasProperty('sourceDeps')) {
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 23
|
||||||
buildToolsVersion '23.0.3'
|
buildToolsVersion '24'
|
||||||
useLibrary 'org.apache.http.legacy'
|
useLibrary 'org.apache.http.legacy'
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
package org.fdroid.fdroid.compat;
|
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
|
||||||
import android.os.Build;
|
|
||||||
|
|
||||||
import org.fdroid.fdroid.data.SanitizedFile;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used to expose the protected methods from FileCompat in a public manner so
|
|
||||||
* that they can be called from a test harness.
|
|
||||||
*/
|
|
||||||
public class FileCompatForTest extends FileCompat {
|
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
public static void symlinkOsTest(SanitizedFile source, SanitizedFile dest) {
|
|
||||||
symlinkOs(source, dest);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void symlinkRuntimeTest(SanitizedFile source, SanitizedFile dest) {
|
|
||||||
symlinkRuntime(source, dest);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void symlinkLibcoreTest(SanitizedFile source, SanitizedFile dest) {
|
|
||||||
symlinkLibcore(source, dest);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
package org.fdroid.fdroid;
|
package org.fdroid.fdroid.compat;
|
||||||
|
|
||||||
import android.app.Instrumentation;
|
import android.app.Instrumentation;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -9,7 +9,7 @@ import android.support.test.InstrumentationRegistry;
|
|||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.fdroid.fdroid.compat.FileCompatForTest;
|
import org.fdroid.fdroid.Utils;
|
||||||
import org.fdroid.fdroid.data.SanitizedFile;
|
import org.fdroid.fdroid.data.SanitizedFile;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
@ -64,21 +64,21 @@ public class FileCompatTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSymlinkRuntime() {
|
public void testSymlinkRuntime() {
|
||||||
FileCompatForTest.symlinkRuntimeTest(sourceFile, destFile);
|
FileCompat.symlinkRuntime(sourceFile, destFile);
|
||||||
assertTrue(destFile.getAbsolutePath() + " should exist after symlinking", destFile.exists());
|
assertTrue(destFile.getAbsolutePath() + " should exist after symlinking", destFile.exists());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSymlinkLibcore() {
|
public void testSymlinkLibcore() {
|
||||||
assumeTrue(Build.VERSION.SDK_INT >= 19);
|
assumeTrue(Build.VERSION.SDK_INT >= 19);
|
||||||
FileCompatForTest.symlinkLibcoreTest(sourceFile, destFile);
|
FileCompat.symlinkLibcore(sourceFile, destFile);
|
||||||
assertTrue(destFile.getAbsolutePath() + " should exist after symlinking", destFile.exists());
|
assertTrue(destFile.getAbsolutePath() + " should exist after symlinking", destFile.exists());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSymlinkOs() {
|
public void testSymlinkOs() {
|
||||||
assumeTrue(Build.VERSION.SDK_INT >= 21);
|
assumeTrue(Build.VERSION.SDK_INT >= 21);
|
||||||
FileCompatForTest.symlinkOsTest(sourceFile, destFile);
|
FileCompat.symlinkOs(sourceFile, destFile);
|
||||||
assertTrue(destFile.getAbsolutePath() + " should exist after symlinking", destFile.exists());
|
assertTrue(destFile.getAbsolutePath() + " should exist after symlinking", destFile.exists());
|
||||||
}
|
}
|
||||||
|
|
@ -43,7 +43,7 @@ public class FileCompat {
|
|||||||
private static class Symlink21 {
|
private static class Symlink21 {
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
public void symlink(SanitizedFile source, SanitizedFile dest) {
|
void symlink(SanitizedFile source, SanitizedFile dest) {
|
||||||
try {
|
try {
|
||||||
android.system.Os.symlink(source.getAbsolutePath(), dest.getAbsolutePath());
|
android.system.Os.symlink(source.getAbsolutePath(), dest.getAbsolutePath());
|
||||||
} catch (ErrnoException e) {
|
} catch (ErrnoException e) {
|
||||||
@ -54,13 +54,14 @@ public class FileCompat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(21)
|
@TargetApi(21)
|
||||||
protected static void symlinkOs(SanitizedFile source, SanitizedFile dest) {
|
static void symlinkOs(SanitizedFile source, SanitizedFile dest) {
|
||||||
new Symlink21().symlink(source, dest);
|
new Symlink21().symlink(source, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void symlinkRuntime(SanitizedFile source, SanitizedFile dest) {
|
static void symlinkRuntime(SanitizedFile source, SanitizedFile dest) {
|
||||||
String[] commands = {
|
String[] commands = {
|
||||||
FDroidApp.SYSTEM_DIR_NAME + "/bin/ln",
|
FDroidApp.SYSTEM_DIR_NAME + "/bin/ln",
|
||||||
|
"-s",
|
||||||
source.getAbsolutePath(),
|
source.getAbsolutePath(),
|
||||||
dest.getAbsolutePath(),
|
dest.getAbsolutePath(),
|
||||||
};
|
};
|
||||||
@ -74,7 +75,7 @@ public class FileCompat {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void symlinkLibcore(SanitizedFile source, SanitizedFile dest) {
|
static void symlinkLibcore(SanitizedFile source, SanitizedFile dest) {
|
||||||
try {
|
try {
|
||||||
Object os = Class.forName("libcore.io.Libcore").getField("os").get(null);
|
Object os = Class.forName("libcore.io.Libcore").getField("os").get(null);
|
||||||
Method symlink = os.getClass().getMethod("symlink", String.class, String.class);
|
Method symlink = os.getClass().getMethod("symlink", String.class, String.class);
|
||||||
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 23
|
||||||
buildToolsVersion '23.0.3'
|
buildToolsVersion '24'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 8
|
minSdkVersion 8
|
||||||
|
Loading…
x
Reference in New Issue
Block a user