17 lines
1.3 KiB
JavaScript
17 lines
1.3 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 without deleting
|
|
* Expo/RN local repositories. Maven Central is filtered only for the custom OpenGL SDK,
|
|
* so a missing local custom AAR fails instead of silently using the official Central AAR.
|
|
*/
|
|
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.mavenLocal()\n p.repositories.withType(org.gradle.api.artifacts.repositories.MavenArtifactRepository).configureEach { repo ->\n def repoUrl = repo.url.toString()\n if (repoUrl.contains(\"repo.maven.apache.org/maven2\") || repoUrl.contains(\"repo1.maven.org/maven2\")) {\n repo.content { excludeModule(\"org.maplibre.gl\", \"android-sdk-opengl\") }\n }\n }\n }\n}\nrootProject.ext.set(\"org.maplibre.reactnative.nativeVersion\", \"13.4.1-step061\")\nrootProject.ext.set(\"org.maplibre.reactnative.nativeVariant\", \"opengl\")\n`;
|
|
return project;
|
|
});
|
|
};
|