@@ -388,25 +388,20 @@ def upload_gutenberg_sourcemaps(app:, flavor:, build_type:, release_version:)
388388 # The format is: <app><flavor><build_type>
389389 # E.g.: jetpackJalapenoDebug
390390 build_asset_folder_name = "#{ app . downcase } #{ flavor } #{ build_type } "
391- bundle_source_map_path = File . join ( PROJECT_ROOT_FOLDER , 'WordPress' , 'build' , 'intermediates' , 'assets' , build_asset_folder_name )
392-
393- Dir . mktmpdir do |sourcemaps_folder |
394- # It's important that the bundle and source map files have specific names, otherwise, Sentry won't symbolicate the stack traces.
395- FileUtils . cp ( File . join ( bundle_source_map_path , 'index.android.bundle' ) , File . join ( sourcemaps_folder , 'index.android.bundle' ) )
396- FileUtils . cp ( File . join ( bundle_source_map_path , 'index.android.bundle.map' ) , File . join ( sourcemaps_folder , 'index.android.bundle.map' ) )
397-
398- sentry_upload_sourcemap (
399- auth_token : sentry_token ,
400- org_slug : org_slug ,
401- project_slug : project_slug ,
402- version : release_version ,
403- dist : current_build_code ,
404- # When the React native bundle is generated, the source map file references include the local machine path;
405- # With the `rewrite` and `strip_common_prefix` options, Sentry automatically strips this part.
406- rewrite : true ,
407- strip_common_prefix : true ,
408- sourcemap : sourcemaps_folder
409- )
410- end
391+ # Bundle and source map files are copied to a specific folder as part of the build process.
392+ bundle_source_map_path = File . join ( PROJECT_ROOT_FOLDER , 'WordPress' , 'build' , 'react-native-bundle-source-map' )
393+
394+ sentry_upload_sourcemap (
395+ auth_token : sentry_token ,
396+ org_slug : org_slug ,
397+ project_slug : project_slug ,
398+ version : release_version ,
399+ dist : current_build_code ,
400+ # When the React native bundle is generated, the source map file references include the local machine path;
401+ # With the `rewrite` and `strip_common_prefix` options, Sentry automatically strips this part.
402+ rewrite : true ,
403+ strip_common_prefix : true ,
404+ sourcemap : bundle_source_map_path
405+ )
411406 end
412407end
0 commit comments