use of com.google.idea.blaze.android.run.deployinfo.BlazeAndroidDeployInfo in project intellij by bazelbuild.
the class BlazeAndroidBinaryApplicationIdProvider method getPackageName.
@Override
public String getPackageName() throws ApkProvisionException {
BlazeAndroidDeployInfo deployInfo = buildStep.getDeployInfo();
Manifest manifest = deployInfo.getMergedManifest();
if (manifest == null) {
throw new ApkProvisionException("Could not find merged manifest: " + deployInfo.getMergedManifestFile());
}
String applicationId = ApplicationManager.getApplication().runReadAction((Computable<String>) () -> manifest.getPackage().getValue());
if (applicationId == null) {
throw new ApkProvisionException("No application id in merged manifest: " + deployInfo.getMergedManifestFile());
}
return applicationId;
}
use of com.google.idea.blaze.android.run.deployinfo.BlazeAndroidDeployInfo in project intellij by bazelbuild.
the class BlazeAndroidBinaryNormalBuildRunContext method getApplicationLaunchTask.
@Override
public LaunchTask getApplicationLaunchTask(LaunchOptions launchOptions, @Nullable Integer userId, AndroidDebugger androidDebugger, AndroidDebuggerState androidDebuggerState, ProcessHandlerLaunchStatus processHandlerLaunchStatus) throws ExecutionException {
final StartActivityFlagsProvider startActivityFlagsProvider = new DefaultStartActivityFlagsProvider(androidDebugger, androidDebuggerState, project, launchOptions.isDebug(), UserIdHelper.getFlagsFromUserId(userId));
BlazeAndroidDeployInfo deployInfo;
try {
deployInfo = buildStep.getDeployInfo();
} catch (ApkProvisionException e) {
throw new ExecutionException(e);
}
return BlazeAndroidBinaryApplicationLaunchTaskProvider.getApplicationLaunchTask(project, applicationIdProvider, deployInfo.getMergedManifestFile(), configState, startActivityFlagsProvider, processHandlerLaunchStatus);
}
use of com.google.idea.blaze.android.run.deployinfo.BlazeAndroidDeployInfo in project intellij by bazelbuild.
the class BlazeAndroidTestApplicationIdProvider method getPackageName.
@Override
public String getPackageName() throws ApkProvisionException {
BlazeAndroidDeployInfo deployInfo = buildStep.getDeployInfo();
Manifest manifest = Iterables.getFirst(deployInfo.getAdditionalMergedManifests(), null);
if (manifest == null) {
// and can instead be in the same package as the tests.
return getTestPackageName();
}
String applicationId = ApplicationManager.getApplication().runReadAction((Computable<String>) () -> manifest.getPackage().getValue());
if (applicationId == null) {
throw new ApkProvisionException("No application id in manifest under test");
}
return applicationId;
}
use of com.google.idea.blaze.android.run.deployinfo.BlazeAndroidDeployInfo in project intellij by bazelbuild.
the class BlazeAndroidTestApplicationIdProvider method getTestPackageName.
@Nullable
@Override
public String getTestPackageName() throws ApkProvisionException {
BlazeAndroidDeployInfo deployInfo = buildStep.getDeployInfo();
Manifest manifest = deployInfo.getMergedManifest();
if (manifest == null) {
throw new ApkProvisionException("Could not find merged manifest: " + deployInfo.getMergedManifestFile());
}
String applicationId = ApplicationManager.getApplication().runReadAction((Computable<String>) () -> manifest.getPackage().getValue());
if (applicationId == null) {
throw new ApkProvisionException("No application id in merged manifest: " + deployInfo.getMergedManifestFile());
}
return applicationId;
}
use of com.google.idea.blaze.android.run.deployinfo.BlazeAndroidDeployInfo in project intellij by bazelbuild.
the class BlazeAndroidBinaryMobileInstallRunContext method getApplicationLaunchTask.
@Override
public LaunchTask getApplicationLaunchTask(LaunchOptions launchOptions, @Nullable Integer userId, AndroidDebugger androidDebugger, AndroidDebuggerState androidDebuggerState, ProcessHandlerLaunchStatus processHandlerLaunchStatus) throws ExecutionException {
final StartActivityFlagsProvider startActivityFlagsProvider = new DefaultStartActivityFlagsProvider(androidDebugger, androidDebuggerState, project, launchOptions.isDebug(), UserIdHelper.getFlagsFromUserId(userId));
BlazeAndroidDeployInfo deployInfo;
try {
deployInfo = buildStep.getDeployInfo();
} catch (ApkProvisionException e) {
throw new ExecutionException(e);
}
return BlazeAndroidBinaryApplicationLaunchTaskProvider.getApplicationLaunchTask(project, applicationIdProvider, deployInfo.getMergedManifestFile(), configState, startActivityFlagsProvider, processHandlerLaunchStatus);
}
Aggregations