Files
MapLibreParticleLab/integration/react-native/MapLibreParticleRNTestHost/plugins/withParticleNativeAndroid.js
2026-09-08 17:46:20 +08:00

17 lines
1.1 KiB
JavaScript

const { withProjectBuildGradle } = require("@expo/config-plugins");
const marker = "// MapLibreParticleRNTestHost custom OpenGL SDK";
/**
* 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 { excludeModule(\"org.maplibre.gl\", \"android-sdk-opengl\") } }\n }\n}\nrootProject.ext.set(\"org.maplibre.reactnative.nativeVersion\", \"13.4.1-step060d\")\nrootProject.ext.set(\"org.maplibre.reactnative.nativeVariant\", \"opengl\")\n`;
return project;
});
};