Skip to content

Commit

Permalink
fix(ios): building for MacOS (Catalyst) now works with that fix (#13903)
Browse files Browse the repository at this point in the history
* fix(ios): building for MacOS (Catalyst) now works with that fix

Building was not working because of not longer supported removeFromSuperView in MacOSCatalyst
Updated Titanium.xcodeproj to correct destination settings for using same bundleId for iOS and MacOS

* fix(ios): building for MacOS (Catalyst)  finding all provisioning profiles

* fix(ios): tab/spaces correction and  m1ga hint correted about the WWDR cert

* fix(macos): fix layout issue
  • Loading branch information
mbender74 authored and hansemannn committed Sep 4, 2023
1 parent 07f464f commit 02dc740
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
8 changes: 6 additions & 2 deletions iphone/Classes/TiUIScrollableViewProxy.m
Expand Up @@ -6,8 +6,12 @@
*/
#ifdef USE_TI_UISCROLLABLEVIEW

#import "TiUIScrollableViewProxy.h"
#if TARGET_OS_MACCATALYST
#import <AppKit/AppKit.h>
#endif

#import "TiUIScrollableView.h"
#import "TiUIScrollableViewProxy.h"

@implementation TiUIScrollableViewProxy
@synthesize viewProxies;
Expand Down Expand Up @@ -88,7 +92,7 @@ - (void)setViews:(id)args
#else
TiThreadPerformOnMainThread(
^{
[[oldViewProxy view] removeFromSuperview];
[[oldViewProxy view] performSelector:@selector(removeFromSuperview)];
},
YES);
#endif
Expand Down
14 changes: 12 additions & 2 deletions iphone/cli/commands/_build.js
Expand Up @@ -1278,7 +1278,17 @@ iOSBuilder.prototype.configOptionTarget = function configOptionTarget(order) {
break;

case 'dist-macappstore':

_t.conf.options['deploy-type'].values = [ 'production' ];
_t.conf.options['device-id'].required = false;
_t.conf.options['distribution-name'].required = true;
_t.conf.options['pp-uuid'].required = true;

// build lookup maps
iosInfo.provisioning.distribution.forEach(function (p) {
_t.provisioningProfileLookup[p.uuid.toLowerCase()] = p;
});

break;
}
},
Expand Down Expand Up @@ -2864,7 +2874,7 @@ iOSBuilder.prototype.checkIfNeedToRecompile = async function checkIfNeedToRecomp
return true;
}

if (this.target === 'dist-adhoc' || this.target === 'dist-appstore') {
if (this.target === 'dist-adhoc' || this.target === 'dist-appstore' || this.target === 'dist-macappstore') {
this.logger.info(__('Forcing rebuild: distribution builds require \'xcodebuild\' to be run so that resources are copied into the archive'));
return true;
}
Expand Down Expand Up @@ -3326,7 +3336,7 @@ iOSBuilder.prototype.createXcodeProject = function createXcodeProject(next) {
outputPaths: [],
runOnlyForDeploymentPostprocessing: 0,
shellPath: '/bin/sh',
shellScript: `"/bin/cp -rf \\"$PROJECT_DIR/ArchiveStaging\\"/ \\"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\\" && /bin/mkdir \\"${buildProductsPath}\\""`,
shellScript: `"/bin/cp -rf \\"$PROJECT_DIR/ArchiveStaging\\"/ \\"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\\" && /bin/mkdir -p \\"${buildProductsPath}\\""`,
showEnvVarsInLog: 0
};
xobjs.PBXShellScriptBuildPhase[buildPhaseUuid + '_comment'] = '"' + name + '"';
Expand Down
4 changes: 2 additions & 2 deletions iphone/iphone/Titanium.entitlements
Expand Up @@ -4,10 +4,10 @@
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.security.device.camera</key>
Expand Down
10 changes: 6 additions & 4 deletions iphone/iphone/Titanium.xcodeproj/project.pbxproj
Expand Up @@ -2382,7 +2382,6 @@
CODE_SIGN_ENTITLEMENTS = Titanium.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
Expand Down Expand Up @@ -2420,7 +2419,9 @@
PRODUCT_BUNDLE_IDENTIFIER = com.appcelerator.titanium;
PRODUCT_NAME = Titanium;
STRIP_STYLE = debugging;
SUPPORTS_MACCATALYST = NO;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "Titanium-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -2443,7 +2444,6 @@
CODE_SIGN_ENTITLEMENTS = Titanium.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
Expand Down Expand Up @@ -2479,7 +2479,9 @@
PRODUCT_BUNDLE_IDENTIFIER = com.appcelerator.titanium;
PRODUCT_NAME = Titanium;
STRIP_STYLE = debugging;
SUPPORTS_MACCATALYST = NO;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "Titanium-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down

0 comments on commit 02dc740

Please sign in to comment.