Skip to content

Commit

Permalink
Merge d187887 into 34aba08
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich authored May 30, 2023
2 parents 34aba08 + d187887 commit c9bea84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Features

- Dynamically resolve `collectModulesScript` path to support monorepos ([#3092])(https://github.com/getsentry/sentry-react-native/pull/3092)

### Dependencies

- Bump JavaScript SDK from v7.52.0 to v7.52.1 ([#3071](https://github.com/getsentry/sentry-react-native/pull/3071))
Expand Down
8 changes: 7 additions & 1 deletion sentry.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,15 @@ gradle.projectsEvaluated {

workingDir reactRoot

def resolvedSentryPath = null
try {
resolvedSentryPath = new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile();
} catch (Throwable ignored) {}
def sentryPackage = resolvedSentryPath != null && resolvedSentryPath.exists() ? resolvedSentryPath.getAbsolutePath() : "$reactRoot/node_modules/@sentry/react-native"

def collectModulesScript = config.collectModulesScript
? file(config.collectModulesScript).getAbsolutePath()
: "$reactRoot/node_modules/@sentry/react-native/dist/js/tools/collectModules.js"
: "$sentryPackage/dist/js/tools/collectModules.js"
def modulesPaths = config.modulesPaths
? config.modulesPaths.join(',')
: "$reactRoot/node_modules"
Expand Down

0 comments on commit c9bea84

Please sign in to comment.