Skip to content

Commit

Permalink
Using forward slashes for Android sourcemaps Gradle path
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-saia-datadog committed Jul 16, 2024
1 parent 559aa74 commit 3c9539a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/plugin/withAndroidSourcemaps/withAndroidSourcemaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ const withAndroidSourcemaps: ConfigPlugin<void> = (config) => {
return config;
}

const sourcemapsGradlePath = `${require("path").dirname(
require.resolve("@datadog/mobile-react-native/package.json")
)}/datadog-sourcemaps.gradle`.replace(/\\/g, "/");

appBuildGradle.contents = appBuildGradle.contents.replace(
/apply plugin: "com\.facebook\.react"/,
`apply plugin: "com.facebook.react"\napply from: "${require("path").dirname(
require.resolve("@datadog/mobile-react-native/package.json")
)}/datadog-sourcemaps.gradle"`
`apply plugin: "com.facebook.react"\napply from: "${sourcemapsGradlePath}"`
);

return config;
Expand Down

0 comments on commit 3c9539a

Please sign in to comment.