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

[ios][prebuild] fixed inclusion of resources in swift package #50050

Closed
Closed
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion scripts/releases/ios-prebuild/compose-framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ function copyBundles(
targetArchFolder,
`${scheme}.framework`,
'Resources',
bundleName,
);
if (
!fs.existsSync(path.join(targetArchFolder, `${scheme}.framework`))
Expand All @@ -123,7 +124,8 @@ function copyBundles(
console.warn("Source bundle doesn't exist", sourceBundlePath);
}
// A bundle is a directory, so we need to copy the whole directory
execSync(`cp -r ${sourceBundlePath} ${targetBundlePath}`);
execSync(`mkdir -p "${targetBundlePath}"`);
execSync(`cp -r "${sourceBundlePath}/" "${targetBundlePath}"`);
});
} else {
console.warn(`Bundle ${sourceBundlePath} not found`);
Expand Down
25 changes: 12 additions & 13 deletions scripts/releases/ios-prebuild/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ const dependencies /*: $ReadOnlyArray<Dependency> */ = [
'src/vlog_is_on.cc',
],
headers: ['src/glog/*.h'],
// resources: ['../third-party-podspecs/glog/PrivacyInfo.xcprivacy'],
resources: ['../third-party-podspecs/glog/PrivacyInfo.xcprivacy'],
headerSkipFolderNames: 'src',
},
settings: {
publicHeaderFiles: './headers',
headerSearchPaths: ['src'],
compilerFlags: ['-Wno-shorten-64-to-32', '-Wno-everything'],
cCompilerFlags: ['-Wno-shorten-64-to-32'],
cxxCompilerFlags: ['-Wno-shorten-64-to-32', `-std=${CPP_STANDARD}`],
defines: [
{name: 'DEFINES_MODULE', value: 'YES'},
{name: 'USE_HEADERMAP', value: 'NO'},
Expand All @@ -76,7 +77,6 @@ const dependencies /*: $ReadOnlyArray<Dependency> */ = [
settings: {
publicHeaderFiles: './headers',
headerSearchPaths: ['src'],
compilerFlags: ['-Wno-everything'],
},
},
{
Expand All @@ -94,7 +94,7 @@ const dependencies /*: $ReadOnlyArray<Dependency> */ = [
publicHeaderFiles: './include',
headerSearchPaths: ['include'],
linkedLibraries: ['c++'],
compilerFlags: ['-Wno-everything', `-std=${CPP_STANDARD}`],
cxxCompilerFlags: [`-std=${CPP_STANDARD}`],
},
},
{
Expand All @@ -107,12 +107,13 @@ const dependencies /*: $ReadOnlyArray<Dependency> */ = [
files: {
sources: ['boost/**/*.hpp', 'dummy.cc'],
headers: ['boost/**/*.hpp'],
// resources: ['../third-party-podspecs/boost/PrivacyInfo.xcprivacy'],
resources: ['../third-party-podspecs/boost/PrivacyInfo.xcprivacy'],
},
settings: {
publicHeaderFiles: './',
headerSearchPaths: ['./'],
compilerFlags: ['-Wno-everything', '-Wno-documentation'],
cCompilerFlags: ['-Wno-documentation'],
cxxCompilerFlags: ['-Wno-documentation', `-std=${CPP_STANDARD}`],
},
},
{
Expand All @@ -130,7 +131,7 @@ const dependencies /*: $ReadOnlyArray<Dependency> */ = [
settings: {
publicHeaderFiles: './include',
headerSearchPaths: ['include'],
compilerFlags: ['-Wno-everything', `-std=${CPP_STANDARD}`],
cxxCompilerFlags: [`-std=${CPP_STANDARD}`],
linkedLibraries: ['c++'],
},
},
Expand Down Expand Up @@ -158,7 +159,6 @@ const dependencies /*: $ReadOnlyArray<Dependency> */ = [
'SocketRocket/Internal/Security',
'SocketRocket/Internal/Utilities',
],
compilerFlags: ['-Wno-everything'],
},
},
{
Expand Down Expand Up @@ -245,8 +245,7 @@ const dependencies /*: $ReadOnlyArray<Dependency> */ = [
'folly/portability/*.h',
'folly/system/*.h',
],
// TODO: When including this we get "failed to scan dependencies" error
// resources: ['../third-party-podspecs/RCT-Folly/PrivacyInfo.xcprivacy'],
resources: ['../third-party-podspecs/RCT-Folly/PrivacyInfo.xcprivacy'],
},
dependencies: [
'glog',
Expand All @@ -259,12 +258,12 @@ const dependencies /*: $ReadOnlyArray<Dependency> */ = [
settings: {
publicHeaderFiles: './',
headerSearchPaths: ['./'],
compilerFlags: [
'-Wno-everything',
`-std=${CPP_STANDARD}`,
cCompilerFlags: ['-faligned-new', '-Wno-shorten-64-to-32', '-Wno-comma'],
cxxCompilerFlags: [
'-faligned-new',
'-Wno-shorten-64-to-32',
'-Wno-comma',
`-std=${CPP_STANDARD}`,
],
defines: [
{name: 'USE_HEADERMAP', value: 'NO'},
Expand Down
16 changes: 11 additions & 5 deletions scripts/releases/ios-prebuild/swift-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ ${dependencies.map(d => createSwiftTarget(d)).join('')}
*/
function createSwiftTarget(dependency /* :Dependency */) {
// Setup unsafe flags
let unsafeCAndCxxSettings = '';
if (dependency.settings.compilerFlags != null) {
unsafeCAndCxxSettings = `.unsafeFlags([${dependency.settings.compilerFlags.map(flag => `"${flag}"`).join(', ')}]),`;
let unsafeCSettings = '';
if (dependency.settings.cCompilerFlags != null) {
unsafeCSettings = `.unsafeFlags([${dependency.settings.cCompilerFlags.map(flag => `"${flag}"`).join(', ')}]),`;
}

// Add c++ version to c++ settings if provided
let unsafeCxxSettings = '';
if (dependency.settings.cxxCompilerFlags != null) {
unsafeCxxSettings = `.unsafeFlags([${dependency.settings.cxxCompilerFlags.map(flag => `"${flag}"`).join(', ')}]),`;
}

// Setup defines
Expand Down Expand Up @@ -120,12 +126,12 @@ function createSwiftTarget(dependency /* :Dependency */) {
publicHeadersPath: "${dependency.settings.publicHeaderFiles}",
cSettings: [
${headerSearchPaths}
${unsafeCAndCxxSettings}
${unsafeCSettings}
${defines}
],
cxxSettings: [
${headerSearchPaths}
${unsafeCAndCxxSettings}
${unsafeCxxSettings}
${defines}
],
linkerSettings: [
Expand Down
3 changes: 2 additions & 1 deletion scripts/releases/ios-prebuild/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export type Define = $ReadOnly<{
export type Settings = $ReadOnly<{
headerSearchPaths?: $ReadOnlyArray<string>,
defines?: $ReadOnlyArray<Define>,
compilerFlags?: $ReadOnlyArray<string>,
cCompilerFlags?: $ReadOnlyArray<string>,
cxxCompilerFlags?: $ReadOnlyArray<string>,
linkedLibraries?: $ReadOnlyArray<string>,
publicHeaderFiles: string,
linkerSettings?: $ReadOnlyArray<string>
Expand Down
Loading