-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23d77ba
commit d30eb3b
Showing
9 changed files
with
265 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const VIRO_VERSION = "2.41.1"; | ||
export const VIRO_VERSION = "2.41.3"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export declare const VIRO_VERSION = "2.41.1"; | ||
export declare const VIRO_VERSION = "2.41.3"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VIRO_VERSION = void 0; | ||
exports.VIRO_VERSION = "2.41.1"; | ||
exports.VIRO_VERSION = "2.41.3"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,93 @@ | ||
"use strict"; | ||
var __importDefault = | ||
(this && this.__importDefault) || | ||
function (mod) { | ||
return mod && mod.__esModule ? mod : { default: mod }; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.withViroIos = exports.withDefaultInfoPlist = void 0; | ||
const config_plugins_1 = require("@expo/config-plugins"); | ||
const fs_1 = __importDefault(require("fs")); | ||
const insertLinesHelper_1 = require("./util/insertLinesHelper"); | ||
const withViro_1 = require("./withViro"); | ||
const withViroPods = (config) => { | ||
config = (0, config_plugins_1.withDangerousMod)(config, [ | ||
"ios", | ||
async (newConfig) => { | ||
const root = newConfig.modRequest.platformProjectRoot; | ||
fs_1.default.readFile(`${root}/Podfile`, "utf-8", (err, data) => { | ||
data = (0, insertLinesHelper_1.insertLinesHelper)( | ||
` pod 'ViroReact', :path => '../node_modules/@reactvision/react-viro/ios'\n` + | ||
` pod 'ViroKit', :path => '../node_modules/@reactvision/react-viro/ios/dist/ViroRenderer/'`, | ||
"post_install do |installer|", | ||
data, | ||
-1 | ||
); | ||
fs_1.default.writeFile( | ||
`${root}/Podfile`, | ||
data, | ||
"utf-8", | ||
function (err) { | ||
if (err) console.log("Error writing Podfile"); | ||
} | ||
); | ||
}); | ||
return newConfig; | ||
}, | ||
]); | ||
return config; | ||
config = (0, config_plugins_1.withDangerousMod)(config, [ | ||
"ios", | ||
async (newConfig) => { | ||
const root = newConfig.modRequest.platformProjectRoot; | ||
fs_1.default.readFile(`${root}/Podfile`, "utf-8", (err, data) => { | ||
data = (0, insertLinesHelper_1.insertLinesHelper)(` pod 'ViroReact', :path => '../node_modules/@reactvision/react-viro/ios'\n` + | ||
` pod 'ViroKit', :path => '../node_modules/@reactvision/react-viro/ios/dist/ViroRenderer/'`, "post_install do |installer|", data, -1); | ||
fs_1.default.writeFile(`${root}/Podfile`, data, "utf-8", function (err) { | ||
if (err) | ||
console.log("Error writing Podfile"); | ||
}); | ||
}); | ||
return newConfig; | ||
}, | ||
]); | ||
return config; | ||
}; | ||
const withEnabledBitcode = (config) => | ||
(0, config_plugins_1.withXcodeProject)(config, async (newConfig) => { | ||
const withEnabledBitcode = (config) => (0, config_plugins_1.withXcodeProject)(config, async (newConfig) => { | ||
newConfig.modResults.addBuildProperty("ENABLE_BITCODE", "NO", "Release"); | ||
return newConfig; | ||
}); | ||
}); | ||
const setExcludedArchitectures = (project) => { | ||
const configurations = project.pbxXCBuildConfigurationSection(); | ||
// @ts-ignore | ||
for (const { buildSettings } of Object.values(configurations || {})) { | ||
if ( | ||
typeof (buildSettings === null || buildSettings === void 0 | ||
? void 0 | ||
: buildSettings.PRODUCT_NAME) !== "undefined" | ||
) { | ||
buildSettings['"EXCLUDED_ARCHS[sdk=iphonesimulator*]"'] = '"arm64"'; | ||
const configurations = project.pbxXCBuildConfigurationSection(); | ||
// @ts-ignore | ||
for (const { buildSettings } of Object.values(configurations || {})) { | ||
if (typeof (buildSettings === null || buildSettings === void 0 | ||
? void 0 | ||
: buildSettings.PRODUCT_NAME) !== "undefined") { | ||
buildSettings['"EXCLUDED_ARCHS[sdk=iphonesimulator*]"'] = '"arm64"'; | ||
} | ||
} | ||
} | ||
return project; | ||
return project; | ||
}; | ||
const withExcludedSimulatorArchitectures = (config) => { | ||
return (0, config_plugins_1.withXcodeProject)(config, (newConfig) => { | ||
newConfig.modResults = setExcludedArchitectures(newConfig.modResults); | ||
return newConfig; | ||
}); | ||
return (0, config_plugins_1.withXcodeProject)(config, (newConfig) => { | ||
newConfig.modResults = setExcludedArchitectures(newConfig.modResults); | ||
return newConfig; | ||
}); | ||
}; | ||
const withDefaultInfoPlist = (config, props) => { | ||
let savePhotosPermission = withViro_1.DEFAULTS.ios.savePhotosPermission; | ||
let photosPermission = withViro_1.DEFAULTS.ios.photosPermission; | ||
let cameraUsagePermission = withViro_1.DEFAULTS.ios.cameraUsagePermission; | ||
let microphoneUsagePermission = | ||
withViro_1.DEFAULTS.ios.microphoneUsagePermission; | ||
if (Array.isArray(config.plugins)) { | ||
const pluginConfig = config?.plugins?.find( | ||
(plugin) => | ||
Array.isArray(plugin) && plugin[0] === "@reactvision/react-viro" | ||
); | ||
if (Array.isArray(pluginConfig) && pluginConfig.length > 1) { | ||
const config = pluginConfig[1]; | ||
savePhotosPermission = | ||
config.ios?.savePhotosPermission || savePhotosPermission; | ||
photosPermission = config.ios?.photosPermission || photosPermission; | ||
microphoneUsagePermission = | ||
config.ios?.microphoneUsagePermission || microphoneUsagePermission; | ||
cameraUsagePermission = | ||
config.ios?.cameraUsagePermission || cameraUsagePermission; | ||
let savePhotosPermission = withViro_1.DEFAULTS.ios.savePhotosPermission; | ||
let photosPermission = withViro_1.DEFAULTS.ios.photosPermission; | ||
let cameraUsagePermission = withViro_1.DEFAULTS.ios.cameraUsagePermission; | ||
let microphoneUsagePermission = withViro_1.DEFAULTS.ios.microphoneUsagePermission; | ||
if (Array.isArray(config.plugins)) { | ||
const pluginConfig = config?.plugins?.find((plugin) => Array.isArray(plugin) && plugin[0] === "@reactvision/react-viro"); | ||
if (Array.isArray(pluginConfig) && pluginConfig.length > 1) { | ||
const config = pluginConfig[1]; | ||
savePhotosPermission = | ||
config.ios?.savePhotosPermission || savePhotosPermission; | ||
photosPermission = config.ios?.photosPermission || photosPermission; | ||
microphoneUsagePermission = | ||
config.ios?.microphoneUsagePermission || microphoneUsagePermission; | ||
cameraUsagePermission = | ||
config.ios?.cameraUsagePermission || cameraUsagePermission; | ||
} | ||
} | ||
} | ||
if (!config.ios) config.ios = {}; | ||
if (!config.ios.infoPlist) config.ios.infoPlist = {}; | ||
config.ios.infoPlist.NSPhotoLibraryUsageDescription = | ||
config.ios.infoPlist.NSPhotoLibraryUsageDescription || photosPermission; | ||
config.ios.infoPlist.NSPhotoLibraryAddUsageDescription = | ||
config.ios.infoPlist.NSPhotoLibraryAddUsageDescription || | ||
savePhotosPermission; | ||
config.ios.infoPlist.NSCameraUsageDescription = | ||
config.ios.infoPlist.NSCameraUsageDescription || cameraUsagePermission; | ||
config.ios.infoPlist.NSMicrophoneUsageDescription = | ||
config.ios.infoPlist.NSMicrophoneUsageDescription || | ||
microphoneUsagePermission; | ||
return config; | ||
if (!config.ios) | ||
config.ios = {}; | ||
if (!config.ios.infoPlist) | ||
config.ios.infoPlist = {}; | ||
config.ios.infoPlist.NSPhotoLibraryUsageDescription = | ||
config.ios.infoPlist.NSPhotoLibraryUsageDescription || photosPermission; | ||
config.ios.infoPlist.NSPhotoLibraryAddUsageDescription = | ||
config.ios.infoPlist.NSPhotoLibraryAddUsageDescription || | ||
savePhotosPermission; | ||
config.ios.infoPlist.NSCameraUsageDescription = | ||
config.ios.infoPlist.NSCameraUsageDescription || cameraUsagePermission; | ||
config.ios.infoPlist.NSMicrophoneUsageDescription = | ||
config.ios.infoPlist.NSMicrophoneUsageDescription || | ||
microphoneUsagePermission; | ||
return config; | ||
}; | ||
exports.withDefaultInfoPlist = withDefaultInfoPlist; | ||
const withViroIos = (config, props) => { | ||
(0, config_plugins_1.withPlugins)(config, [[withViroPods, props]]); | ||
(0, exports.withDefaultInfoPlist)(config, props); | ||
withEnabledBitcode(config); | ||
withExcludedSimulatorArchitectures(config); | ||
return config; | ||
(0, config_plugins_1.withPlugins)(config, [[withViroPods, props]]); | ||
(0, exports.withDefaultInfoPlist)(config, props); | ||
withEnabledBitcode(config); | ||
withExcludedSimulatorArchitectures(config); | ||
return config; | ||
}; | ||
exports.withViroIos = withViroIos; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters