use of com.android.sdklib.AndroidVersion in project android by JetBrains.
the class InstantRunBuilderTest method fullBuildIfExecutorSwitchedOnApiBelow21.
@Test
public void fullBuildIfExecutorSwitchedOnApiBelow21() throws Exception {
myDumpsysPackageOutput = DUMPSYS_PACKAGE_EXISTS;
myDeviceBuildTimetamp = "100";
myAppInForeground = true;
myRunConfigContext.setSameExecutorAsPreviousSession(false);
when(myDevice.getVersion()).thenReturn(new AndroidVersion(20, null));
setUpDeviceForHotSwap();
myBuilder.build(myTaskRunner, Collections.emptyList());
assertEquals("gradlew -Pandroid.optional.compilation=INSTANT_DEV,FULL_APK -Pandroid.injected.coldswap.mode=MULTIAPK :app:assemble", myTaskRunner.getBuilds());
}
use of com.android.sdklib.AndroidVersion in project android by JetBrains.
the class InstantRunBuilderTest method fullBuildIfBuildTimestampsDoNotMatch.
@Test
public void fullBuildIfBuildTimestampsDoNotMatch() throws Exception {
myDumpsysPackageOutput = DUMPSYS_PACKAGE_EXISTS;
myDeviceBuildTimetamp = "123";
when(myDevice.getVersion()).thenReturn(new AndroidVersion(23, null));
setUpDeviceForHotSwap();
myBuilder.build(myTaskRunner, Collections.emptyList());
assertEquals("gradlew -Pandroid.optional.compilation=INSTANT_DEV,FULL_APK -Pandroid.injected.coldswap.mode=MULTIAPK :app:assemble", myTaskRunner.getBuilds());
}
use of com.android.sdklib.AndroidVersion in project android by JetBrains.
the class InstantRunBuilderTest method fullBuildWhenPackageNotInstalledOnDevice.
@Test
public void fullBuildWhenPackageNotInstalledOnDevice() throws Exception {
myDumpsysPackageOutput = DUMPSYS_NO_SUCH_PACKAGE;
when(myDevice.getVersion()).thenReturn(new AndroidVersion(23, null));
myBuilder.build(myTaskRunner, Collections.emptyList());
assertEquals("gradlew -Pandroid.optional.compilation=INSTANT_DEV,FULL_APK -Pandroid.injected.coldswap.mode=MULTIAPK :app:assemble", myTaskRunner.getBuilds());
}
use of com.android.sdklib.AndroidVersion in project android by JetBrains.
the class InstantRunBuilderTest method noRebuildIfNoArtifactsAfterHotswapBuild.
@Test
public void noRebuildIfNoArtifactsAfterHotswapBuild() throws Exception {
myDumpsysPackageOutput = DUMPSYS_PACKAGE_EXISTS;
myDeviceBuildTimetamp = "100";
myAppInForeground = true;
myRunConfigContext.setSameExecutorAsPreviousSession(true);
when(myDevice.getVersion()).thenReturn(new AndroidVersion(23, null));
setUpDeviceForHotSwap();
when(myInstantRunContext.getInstantRunBuildInfo()).thenReturn(InstantRunBuildInfo.get(BUILD_INFO)).thenReturn(InstantRunBuildInfo.get(BUILD_INFO_NO_ARTIFACTS));
myBuilder.build(myTaskRunner, Collections.emptyList());
assertEquals("gradlew -Pandroid.optional.compilation=INSTANT_DEV -Pandroid.injected.coldswap.mode=MULTIAPK :app:assemble", myTaskRunner.getBuilds());
}
use of com.android.sdklib.AndroidVersion in project android by JetBrains.
the class InstantRunBuilderTest method cleanRerunForcesClean.
@Test
public void cleanRerunForcesClean() throws Exception {
myRunConfigContext.setCleanRerun(true);
when(myDevice.getVersion()).thenReturn(new AndroidVersion(23, null));
myBuilder.build(myTaskRunner, Collections.emptyList());
assertEquals("gradlew -Pandroid.optional.compilation=INSTANT_DEV,FULL_APK -Pandroid.injected.coldswap.mode=MULTIAPK clean :app:gen :app:assemble", myTaskRunner.getBuilds());
}
Aggregations