fix: align RN test host with Gate C Maven handoff

This commit is contained in:
OpenAI Codex
2026-09-07 19:31:55 +08:00
parent 80f360be78
commit 48b93b8609

View File

@@ -3,14 +3,14 @@ const { withProjectBuildGradle } = require("@expo/config-plugins");
const marker = "// MapLibreParticleRNTestHost custom OpenGL SDK";
/**
* Pins MLRN's configurable native dependency and makes org.maplibre.gl resolve from Maven Local
* only. A missing locally-published custom SDK is therefore a build error, never a fallback to
* Maven Central's official AAR.
* Pins the one custom MapLibre Native SDK coordinate to Maven Local. A missing locally-published
* SDK is therefore a build error, never a fallback to Maven Central's official AAR. MLRN's
* separate turf/annotation/scalebar artifacts remain available from Maven Central.
*/
module.exports = function withParticleNativeAndroid(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.clear()\n p.repositories.mavenLocal()\n p.repositories.google()\n p.repositories.mavenCentral { content { excludeGroup(\"org.maplibre.gl\") } }\n }\n}\nrootProject.ext.set(\"org.maplibre.reactnative.nativeVersion\", \"13.4.1\")\nrootProject.ext.set(\"org.maplibre.reactnative.nativeVariant\", \"opengl\")\n`;
project.modResults.contents += `\n${marker}\ngradle.projectsEvaluated {\n allprojects { p ->\n p.repositories.clear()\n p.repositories.mavenLocal()\n p.repositories.google()\n p.repositories.mavenCentral { content { excludeModule(\"org.maplibre.gl\", \"android-sdk-opengl\") } }\n }\n}\nrootProject.ext.set(\"org.maplibre.reactnative.nativeVersion\", \"13.4.1\")\nrootProject.ext.set(\"org.maplibre.reactnative.nativeVariant\", \"opengl\")\n`;
return project;
});
};