Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
Fixed the value of the method parameter generated in the exportOption…
Browse files Browse the repository at this point in the history
…s.plist file. Should be ad-hoc or app-store, depending on the type of build.
  • Loading branch information
Bradley Clayton committed Jun 14, 2018
1 parent 76882ba commit 6c4f1a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ public void performTask(BuildEnvironment buildEnvironment) throws Exception {
String appName = buildEnvironment.getProperty(IOSProvisioningProfileRead.BUILD_PROP_APP_NAME);
String devTeam = buildEnvironment.getProperty(IOSProvisioningProfileRead.BUILD_PROP_DEV_TEAM);
String bundleId = buildEnvironment.getProperty(IOSProvisioningProfileRead.BUILD_PROP_BUNDLE_ID);
String provisioningMethod = buildEnvironment.getProperty(IOSProvisioningProfileRead.BUILD_PROP_PROVISIONING_METHOD);

createExportOptionsFile(devTeam, bundleId, appName, exportOptionsPath);
createExportOptionsFile(devTeam, bundleId, appName, exportOptionsPath, provisioningMethod);
}

private void createExportOptionsFile(String devTeam, String bundleId, String appName, String exportOptionsPath) throws IOException {
private void createExportOptionsFile(String devTeam, String bundleId, String appName, String exportOptionsPath, String provisioningMethod) throws IOException {
NSDictionary rootDict = new NSDictionary();
rootDict.put("compileBitcode", true);
rootDict.put("stripSwiftSymbols", true);
rootDict.put("method","ad-hoc");
rootDict.put("method", provisioningMethod);
rootDict.put("signingCertificate","iPhone Distribution");
rootDict.put("signingStyle", "manual");
rootDict.put("thinning","<none>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.dd.plist.NSArray;
import com.dd.plist.NSDictionary;
import com.dd.plist.NSObject;
import com.dd.plist.PropertyListParser;
import com.squarepolka.readyci.taskrunner.BuildEnvironment;
import com.squarepolka.readyci.tasks.Task;
Expand All @@ -23,6 +24,7 @@ public class IOSProvisioningProfileRead extends Task {
public static final String BUILD_PROP_DEV_TEAM = "devTeam";
public static final String BUILD_PROP_PROVISIONING_PROFILE = "provisioningProfile";
public static final String BUILD_PROP_BUNDLE_ID = "bundleId";
public static final String BUILD_PROP_PROVISIONING_METHOD = "iosProvisioningMethod";

public String taskIdentifier() {
return TASK_IOS_PROFILE_READ;
Expand Down Expand Up @@ -61,13 +63,20 @@ private void readProvisioningInputStream(InputStream processInputSteam, BuildEnv
NSDictionary entitlementsDict = (NSDictionary) rootDict.objectForKey("Entitlements");
String fullBundleId = entitlementsDict.objectForKey("application-identifier").toString();
String bundleId = removeTeamFromBundleId(fullBundleId, devTeam);
NSObject provisionedDevices = entitlementsDict.objectForKey("ProvisionedDevices");

buildEnvironment.addProperty(BUILD_PROP_APP_NAME, appName);
buildEnvironment.addProperty(BUILD_PROP_APP_ID_NAME, appIDName);
buildEnvironment.addProperty(BUILD_PROP_ORGANISATION_NAME, organisationName);
buildEnvironment.addProperty(BUILD_PROP_DEV_TEAM, devTeam);
buildEnvironment.addProperty(BUILD_PROP_PROVISIONING_PROFILE, provisioningProfile);
buildEnvironment.addProperty(BUILD_PROP_BUNDLE_ID, bundleId);

if (null == provisionedDevices) {
buildEnvironment.addProperty(BUILD_PROP_PROVISIONING_METHOD, "app-store");
} else {
buildEnvironment.addProperty(BUILD_PROP_PROVISIONING_METHOD, "ad-hoc");
}
}

private String removeTeamFromBundleId(String bundleId, String teamId) {
Expand Down

0 comments on commit 6c4f1a2

Please sign in to comment.