feat: validate ios RN particle metal path
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
This commit is contained in:
@@ -1,12 +1,38 @@
|
||||
const { withProjectBuildGradle } = require("@expo/config-plugins");
|
||||
// Resolve through the consuming Expo project first. This keeps a config plugin
|
||||
// installed from an npm tarball aligned with the host's Expo SDK instead of
|
||||
// accidentally loading a nested or globally-hoisted copy.
|
||||
const configPlugins = require(
|
||||
require.resolve("expo/config-plugins", {
|
||||
paths: [process.cwd(), __dirname],
|
||||
}),
|
||||
);
|
||||
|
||||
const marker = "// @navsea/maplibre-particle-rn Android OpenGL release";
|
||||
const {
|
||||
CodeGenerator,
|
||||
withPodfile,
|
||||
withProjectBuildGradle,
|
||||
} = configPlugins;
|
||||
|
||||
const androidMarker = "// @navsea/maplibre-particle-rn Android OpenGL release";
|
||||
const iosTag = "navsea-maplibre-particle-rn-maplibre-spm";
|
||||
|
||||
/** Resolves MLRN's single Native SDK request to the NavSea release artifact, never a second AAR. */
|
||||
module.exports = function withNavSeaMapLibreParticle(config) {
|
||||
return withProjectBuildGradle(config, (project) => {
|
||||
if (project.modResults.contents.includes(marker)) return project;
|
||||
project.modResults.contents += `\n${marker}\ngradle.projectsEvaluated {\n allprojects { p ->\n p.repositories.maven { repository -> repository.url = p.uri("https://pbf.jpcn.ccwu.cc/maven") }\n p.configurations.configureEach { configuration ->\n configuration.resolutionStrategy.dependencySubstitution {\n substitute module("org.maplibre.gl:android-sdk-opengl") using module("cc.navsea.maplibre:android-sdk-particle-opengl:13.4.1-particle.5")\n }\n }\n }\n}\nrootProject.ext.set("org.maplibre.reactnative.nativeVersion", "13.4.1")\nrootProject.ext.set("org.maplibre.reactnative.nativeVariant", "opengl")\n`;
|
||||
config = withProjectBuildGradle(config, (project) => {
|
||||
if (project.modResults.contents.includes(androidMarker)) return project;
|
||||
project.modResults.contents += `\n${androidMarker}\ngradle.projectsEvaluated {\n allprojects { p ->\n p.repositories.maven { repository -> repository.url = p.uri("https://pbf.jpcn.ccwu.cc/maven") }\n p.configurations.configureEach { configuration ->\n configuration.resolutionStrategy.dependencySubstitution {\n substitute module("org.maplibre.gl:android-sdk-opengl") using module("cc.navsea.maplibre:android-sdk-particle-opengl:13.4.1-particle.5")\n }\n }\n }\n}\nrootProject.ext.set("org.maplibre.reactnative.nativeVersion", "13.4.1")\nrootProject.ext.set("org.maplibre.reactnative.nativeVariant", "opengl")\n`;
|
||||
return project;
|
||||
});
|
||||
|
||||
return withPodfile(config, (podfile) => {
|
||||
podfile.modResults.contents = CodeGenerator.mergeContents({
|
||||
src: podfile.modResults.contents,
|
||||
newSrc: "$MLRN_PARTICLE.post_install(installer)",
|
||||
tag: iosTag,
|
||||
comment: "#",
|
||||
anchor: /post_install do \|installer\|/,
|
||||
offset: 1,
|
||||
}).contents;
|
||||
return podfile;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user