Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* fixed: #778 -- Idea run dialog was not saving Sim details if no device is attached and selected in preferred device udid #779

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.robovm.compiler.target.ios.ProvisioningProfile;
import org.robovm.compiler.target.ios.SigningIdentity;
import org.robovm.compiler.util.InfoPList;
import org.robovm.compiler.util.PList;
import org.robovm.idea.RoboVmPlugin;
import org.robovm.idea.running.RoboVmRunConfiguration.EntryType;
import org.robovm.libimobiledevice.IDevice;
Expand Down Expand Up @@ -194,7 +193,8 @@ protected void applyEditorTo(@NotNull RoboVmRunConfiguration config) throws Conf
config.setSigningIdentity(Decorator.from(signingIdentity).id);
config.setProvisioningProfileType(Decorator.from(provisioningProfile).entryType);
config.setProvisioningProfile(Decorator.from(provisioningProfile).id);
config.setTargetDeviceUDID(Decorator.from(targetDeviceUDID).id);
// TargetDeviceUDID is optional
config.setTargetDeviceUDID(Decorator.idOrNullFrom(targetDeviceUDID));
// simulator related
config.setSimulatorArch((CpuArch) simArch.getSelectedItem());
config.setSimulatorType(Decorator.from(simType).entryType);
Expand Down Expand Up @@ -816,6 +816,15 @@ static <T> Decorator<T> from(JComboBox<? extends Decorator<T>> cb) {
//noinspection unchecked
return (Decorator<T>) cb.getSelectedItem();
}

/**
* @return id from decorator if it presents
*/
static <T> String idOrNullFrom(JComboBox<? extends Decorator<T>> cb) {
//noinspection unchecked
Decorator<T> decorator = (Decorator<T>) cb.getSelectedItem();
return decorator != null ? decorator.id : null;
}
}

/**
Expand Down
Loading