Skip to content

Commit

Permalink
* idea: fixed running dialog, profile check doesn't honor wildcard pr…
Browse files Browse the repository at this point in the history
…ofiles (#770)

also error message panel is being hidden (otherwise it has visual defect)
  • Loading branch information
dkimitsa authored Feb 8, 2024
1 parent d9eefc5 commit 100da30
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</constraints>
<properties/>
</component>
<grid id="9763" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="9763" binding="errorsPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="6" column="1" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public class RoboVmIOSRunConfigurationSettingsEditor extends SettingsEditor<Robo
private JTextArea args;
private JCheckBox pairedWatch;
private JComboBox<IDeviceDecorator> targetDeviceUDID;
private JPanel errorsPanel;
private JTextPane errors;

// copy of data that is time consuming to fetch (fetched only once when dialog is created)
Expand All @@ -88,9 +89,9 @@ public class RoboVmIOSRunConfigurationSettingsEditor extends SettingsEditor<Robo
// true if editor internally updating data and listeners should ignore the events
private boolean updatingData;

private ArrayList<String> provisioningProfileErrors = new ArrayList<>();
private ArrayList<String> signingIdentityErrors = new ArrayList<>();
private ArrayList<String> deviceIdentityErrors = new ArrayList<>();
private final ArrayList<String> provisioningProfileErrors = new ArrayList<>();
private final ArrayList<String> signingIdentityErrors = new ArrayList<>();
private final ArrayList<String> deviceIdentityErrors = new ArrayList<>();
private IDevice.EventListener ideviceListener;

@NotNull
Expand Down Expand Up @@ -466,6 +467,7 @@ private void updatePairedWatch(boolean moduleChanged, Boolean valueToSet) {
private void updateErrors() {
if (provisioningProfileErrors.isEmpty() && signingIdentityErrors.isEmpty() && deviceIdentityErrors.isEmpty()) {
errors.setText("");
errorsPanel.setVisible(false);
return;
};

Expand Down Expand Up @@ -495,7 +497,7 @@ private void updateErrors() {
buffer.append("\n");
}
errors.setText(buffer.toString());

errorsPanel.setVisible(true);
}

private void checkSelectedProvisioningProfile () {
Expand Down Expand Up @@ -629,17 +631,23 @@ private boolean isProvisioningProfileValid (ProvisioningProfile profile, Config
provisioningProfileErrors.clear();
}

String appIdPrefix = profile.getAppIdPrefix();
String appId = profile.getAppId();
String appIdNoPrefix = appId.split(appIdPrefix + ".")[1];
String bundleId = bundleLabel.getText();
String candidateAppId = profile.getAppIdPrefix() + "." + bundleId;
String profileAppId = profile.getAppId();

boolean currentlyCompatible = true;
// check the id
boolean currentlyCompatible = profileAppId.equalsIgnoreCase(candidateAppId);
if (!currentlyCompatible){
// check for wildcard
if (profileAppId.endsWith(".*")) {
currentlyCompatible = candidateAppId.startsWith(profileAppId.substring(0, profileAppId.length() - 1));
}
}

//Check the id
if (!bundleLabel.getText().equalsIgnoreCase(appIdNoPrefix)) {
currentlyCompatible = false;
if (!currentlyCompatible) {
if (createErrorStrings) {
provisioningProfileErrors.add("Bundle ID from profile=[" + appIdNoPrefix + "] does not match module Bundle ID [" + bundleLabel.getText() + "]");
String profileAppIdNoPrefix = profileAppId.substring(profile.getAppIdPrefix() .length() + 1);
provisioningProfileErrors.add("Bundle ID from profile=[" + profileAppIdNoPrefix + "] does not match module Bundle ID [" + bundleId + "]");
}
}

Expand Down

0 comments on commit 100da30

Please sign in to comment.