posthog-react-native 4.65.1 → 4.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,13 @@
1
+ /**
2
+ * How the release a build belongs to gets associated with the exceptions it reports.
3
+ * `symbol-set` stamps the release onto the uploaded source maps, dSYMs and mappings, and an
4
+ * exception inherits the release of the symbols its frames resolved against. `event` uploads them
5
+ * release-independent and lets each event resolve its own release from the app version and
6
+ * namespace the SDK already sends.
7
+ */
8
+ export type PostHogReleaseMode = 'symbol-set' | 'event';
9
+ export declare const POSTHOG_RELEASE_MODES: PostHogReleaseMode[];
10
+ export declare function resolveReleaseModeProp(releaseMode?: string): PostHogReleaseMode | undefined;
1
11
  export declare function buildAndroidSkipOnConflictGradleLine(skipOnConflict: boolean): string | null;
2
12
  export declare function addPostHogAndroidGradlePluginClasspath(projectBuildGradle: string): {
3
13
  contents: string;
@@ -7,11 +17,11 @@ export declare function applyPostHogAndroidGradlePlugin(appBuildGradle: string):
7
17
  type BuildPhase = {
8
18
  shellScript: string;
9
19
  };
10
- export declare function modifyExistingXcodeBuildScript(script: BuildPhase | undefined, skipOnConflict?: boolean): void;
11
- export declare function addPostHogWithBundledScriptsToBundleShellScript(script: string, skipOnConflict?: boolean): string;
12
- export declare function buildDsymUploadShellScript(includeSource?: boolean, skipOnConflict?: boolean): string;
20
+ export declare function modifyExistingXcodeBuildScript(script: BuildPhase | undefined, skipOnConflict?: boolean, releaseMode?: PostHogReleaseMode): void;
21
+ export declare function addPostHogWithBundledScriptsToBundleShellScript(script: string, skipOnConflict?: boolean, releaseMode?: PostHogReleaseMode): string;
22
+ export declare function buildDsymUploadShellScript(includeSource?: boolean, skipOnConflict?: boolean, releaseMode?: PostHogReleaseMode): string;
13
23
  export declare function moveDsymUploadBuildPhaseToEnd(xcodeProject: any): void;
14
- export declare function addDsymUploadBuildPhase(xcodeProject: any, includeSource?: boolean, skipOnConflict?: boolean): void;
24
+ export declare function addDsymUploadBuildPhase(xcodeProject: any, includeSource?: boolean, skipOnConflict?: boolean, releaseMode?: PostHogReleaseMode): void;
15
25
  export declare function disableUserScriptSandboxing(xcodeProject: any): void;
16
26
  export declare function resolveDotenvFileProp(dotenvFile?: string): string | undefined;
17
27
  export declare function buildIosDotenvFileBuildSetting(dotenvFile: string): string;
@@ -23,6 +33,7 @@ type GradlePropertiesItem = {
23
33
  };
24
34
  export declare function buildAndroidDotenvFileGradleValue(dotenvFile: string): string;
25
35
  export declare function updateDotenvFileGradleProperties(properties: GradlePropertiesItem[], dotenvFile?: string): GradlePropertiesItem[];
36
+ export declare function updateReleaseModeGradleProperties(properties: GradlePropertiesItem[], releaseMode?: PostHogReleaseMode): GradlePropertiesItem[];
26
37
  type PostHogPluginProps = {
27
38
  /**
28
39
  * Whether to disable Xcode's user script sandboxing (ENABLE_USER_SCRIPT_SANDBOXING=NO).
@@ -80,10 +91,9 @@ type PostHogPluginProps = {
80
91
  * The path reaches every upload hook as POSTHOG_CLI_DOTENV_FILE: on iOS as a
81
92
  * build setting (Xcode exports it to the bundle and dSYM script phases), on
82
93
  * Android as a `posthog.dotenvFile` entry in android/gradle.properties read
83
- * by the SDK's `posthog.gradle` hermes upload and, on gradle plugin >= 1.4.0
84
- * (the version this plugin injects), by the `com.posthog.android` mapping
85
- * upload. Process env always wins inside the CLI; a missing file is a
86
- * warning, not a build failure.
94
+ * by the SDK's `posthog.gradle` hermes upload and, on gradle plugin >= 1.4.0,
95
+ * by the `com.posthog.android` mapping upload. Process env always wins inside
96
+ * the CLI; a missing file is a warning, not a build failure.
87
97
  *
88
98
  * Requires posthog-cli >= 0.8.4 — older CLIs ignore the variable and fall
89
99
  * back to their other credential sources. With `disableSandboxing: false`,
@@ -91,6 +101,34 @@ type PostHogPluginProps = {
91
101
  * error (an unreadable-but-present file does not fall through).
92
102
  */
93
103
  dotenvFile?: string;
104
+ /**
105
+ * How the release a build belongs to gets associated with the exceptions it reports.
106
+ *
107
+ * `symbol-set` (the default) stamps the release onto everything the build uploads — Hermes
108
+ * source maps, iOS dSYMs, Android R8 mappings — and an exception inherits the release of the
109
+ * symbols its frames resolved against.
110
+ *
111
+ * EXPERIMENTAL `event` uploads them release-independent, and each event resolves its own
112
+ * release from the `$app_namespace` / `$app_version` / `$app_build` the SDK already sends.
113
+ * Nothing is injected into the app in exchange. Use it when two releases can ship identical
114
+ * JavaScript or identical native code: symbol ids are derived from content, so in `symbol-set`
115
+ * mode both releases report whichever one uploaded first.
116
+ *
117
+ * Reaches every upload hook: iOS as `POSTHOG_RELEASE_MODE` in the bundle build phase (plus
118
+ * `POSTHOG_NO_RELEASE_BIND` in the dSYM phase when `uploadNativeSymbols` is on), Android as a
119
+ * `posthog.releaseMode` entry in android/gradle.properties.
120
+ *
121
+ * Requires posthog-cli >= 0.13.0 and the `com.posthog.android` gradle plugin >= 1.5.0 for the
122
+ * Android mapping upload. Plugin 1.4.0 ignores `posthog.releaseMode` and keeps binding the
123
+ * mapping. A fresh prebuild injects a version that reads it, but a project whose
124
+ * android/build.gradle already carries the classpath line keeps its version: bump that line by
125
+ * hand or prebuild with `--clean`. The dSYM half needs posthog-cli >= 0.10.0 and
126
+ * posthog-ios >= 3.69.1; older ones ignore `POSTHOG_NO_RELEASE_BIND` and keep binding.
127
+ * The Hermes source map upload needs posthog-cli >= 0.16.0, which carries `--release-mode` on
128
+ * the `hermes` commands; the build fails on an older one and names the upgrade. That floor
129
+ * lives in posthog-xcode.sh and posthog.gradle: update them and this line together.
130
+ */
131
+ releaseMode?: PostHogReleaseMode;
94
132
  };
95
133
  export declare function resolveNativeSymbolUpload(prop: PostHogPluginProps['uploadNativeSymbols']): {
96
134
  enabled: boolean;
@@ -1 +1 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.addDsymUploadBuildPhase=addDsymUploadBuildPhase;exports.addPostHogAndroidGradlePluginClasspath=addPostHogAndroidGradlePluginClasspath;exports.addPostHogWithBundledScriptsToBundleShellScript=addPostHogWithBundledScriptsToBundleShellScript;exports.applyDotenvFileBuildSetting=applyDotenvFileBuildSetting;exports.applyPostHogAndroidGradlePlugin=applyPostHogAndroidGradlePlugin;exports.buildAndroidDotenvFileGradleValue=buildAndroidDotenvFileGradleValue;exports.buildAndroidSkipOnConflictGradleLine=buildAndroidSkipOnConflictGradleLine;exports.buildDsymUploadShellScript=buildDsymUploadShellScript;exports.buildIosDotenvFileBuildSetting=buildIosDotenvFileBuildSetting;exports.disableUserScriptSandboxing=disableUserScriptSandboxing;exports.modifyExistingXcodeBuildScript=modifyExistingXcodeBuildScript;exports.moveDsymUploadBuildPhaseToEnd=moveDsymUploadBuildPhaseToEnd;exports.resolveDotenvFileProp=resolveDotenvFileProp;exports.resolveNativeSymbolUpload=resolveNativeSymbolUpload;exports.updateDotenvFileGradleProperties=updateDotenvFileGradleProperties;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _excluded=["nextMod"];function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){(0,_defineProperty2["default"])(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}var _require=require('@expo/config-plugins'),withAppBuildGradle=_require.withAppBuildGradle,withBaseMod=_require.withBaseMod,withGradleProperties=_require.withGradleProperties,withProjectBuildGradle=_require.withProjectBuildGradle,withXcodeProject=_require.withXcodeProject;var POSTHOG_ANDROID_GRADLE_PLUGIN_VERSION='1.4.0';var resolvePostHogReactNativePackageJsonPath="[\"node\", \"--print\", \"require('path').join(require('path').dirname(require.resolve('posthog-react-native')), '..', 'tooling', 'posthog.gradle')\"].execute().text.trim()";var POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY='posthogReactNativeSkipOnConflict';function buildAndroidSkipOnConflictGradleLine(skipOnConflict){if(!skipOnConflict){return null;}return"project.ext.".concat(POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY," = true");}var withAndroidPlugin=function withAndroidPlugin(config){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return withAppBuildGradle(config,function(config){if(config.modResults.language!=='groovy'){console.warn('Cannot configure PostHog in the app gradle because the build.gradle is not groovy');}var buildGradle=config.modResults.contents;var applyFrom="apply from: new File(".concat(resolvePostHogReactNativePackageJsonPath,")");var skipOnConflictLine=buildAndroidSkipOnConflictGradleLine(skipOnConflict);var applyBlock=skipOnConflictLine?"".concat(skipOnConflictLine,"\n").concat(applyFrom):applyFrom;var skipOnConflictPattern=new RegExp("^project\\.ext\\.".concat(POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY,"\\s*=\\s*(true|false)\\n?"),'m');if(buildGradle.includes(applyFrom)){var contents=buildGradle.replace(skipOnConflictPattern,'');if(skipOnConflictLine){contents=contents.replace(applyFrom,"".concat(skipOnConflictLine,"\n").concat(applyFrom));}config.modResults.contents=contents;return config;}var pattern=/^android\s*\{/m;if(buildGradle.match(pattern)){config.modResults.contents=buildGradle.replace(pattern,"".concat(applyBlock,"\n\nandroid {"));}else{console.warn('PostHog: Could not find "android {" block in build.gradle');}return config;});};function matchingBraceIndex(s,openBraceIndex){var depth=0;for(var i=openBraceIndex;i<s.length;i++){if(s[i]==='{'){depth++;}else if(s[i]==='}'){depth--;if(depth===0){return i;}}}return-1;}function addPostHogAndroidGradlePluginClasspath(projectBuildGradle){if(projectBuildGradle.includes('posthog-android-gradle-plugin')){return{contents:projectBuildGradle,classpathPresent:true};}var classpathLine=" classpath(\"com.posthog:posthog-android-gradle-plugin:".concat(POSTHOG_ANDROID_GRADLE_PLUGIN_VERSION,"\")");var buildscriptMatch=/buildscript\s*\{/.exec(projectBuildGradle);var buildscriptOpenBrace=buildscriptMatch?buildscriptMatch.index+buildscriptMatch[0].length-1:-1;var buildscriptEnd=buildscriptOpenBrace===-1?-1:matchingBraceIndex(projectBuildGradle,buildscriptOpenBrace);var buildscriptBody=buildscriptEnd===-1?'':projectBuildGradle.slice(buildscriptOpenBrace,buildscriptEnd);var dependenciesMatch=buildscriptBody?/dependencies\s*\{/.exec(buildscriptBody):null;if(!dependenciesMatch){console.warn('PostHog: Could not find a buildscript dependencies block in the project build.gradle; '+'skipping the com.posthog.android classpath. Native symbols will not be uploaded.');return{contents:projectBuildGradle,classpathPresent:false};}var insertAt=buildscriptOpenBrace+dependenciesMatch.index+dependenciesMatch[0].length;return{contents:"".concat(projectBuildGradle.slice(0,insertAt),"\n").concat(classpathLine).concat(projectBuildGradle.slice(insertAt)),classpathPresent:true};}function applyPostHogAndroidGradlePlugin(appBuildGradle){if(/apply plugin: ["']com\.posthog\.android["']/.test(appBuildGradle)){return appBuildGradle;}var applyLine='apply plugin: "com.posthog.android"';var appPluginPattern=/^([ \t]*apply plugin: ["']com\.android\.application["'].*)$/m;if(appPluginPattern.test(appBuildGradle)){return appBuildGradle.replace(appPluginPattern,"$1\n".concat(applyLine));}var androidBlockPattern=/^android\s*\{/m;if(androidBlockPattern.test(appBuildGradle)){return appBuildGradle.replace(androidBlockPattern,"".concat(applyLine,"\n\nandroid {"));}console.warn('PostHog: Could not find where to apply com.posthog.android in the app build.gradle');return appBuildGradle;}var withAndroidNativeSymbolsPlugin=function withAndroidNativeSymbolsPlugin(config){var classpathPresent=false;config=withProjectBuildGradle(config,function(config){if(config.modResults.language!=='groovy'){console.warn('Cannot configure the PostHog Android Gradle plugin because the project build.gradle is not groovy');return config;}var result=addPostHogAndroidGradlePluginClasspath(config.modResults.contents);config.modResults.contents=result.contents;classpathPresent=result.classpathPresent;return config;});return withAppBuildGradle(config,function(config){if(config.modResults.language!=='groovy'){console.warn('Cannot configure the PostHog Android Gradle plugin because the app build.gradle is not groovy');return config;}if(!classpathPresent){return config;}config.modResults.contents=applyPostHogAndroidGradlePlugin(config.modResults.contents);return config;});};function modifyExistingXcodeBuildScript(script){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!(script===null||script===void 0?void 0:script.shellScript)){console.warn("[posthog-react-native] Could not find the 'Bundle React Native code and images' build phase; "+'skipping sourcemap upload setup.');return;}if(!script.shellScript.match(/(packager|scripts)\/react-native-xcode\.sh\b/)){return;}if(script.shellScript.includes('posthog-xcode.sh')){var _code=migrateLegacyPostHogWrapperInvocation(JSON.parse(script.shellScript));script.shellScript=JSON.stringify(updatePostHogSkipOnConflict(_code,skipOnConflict));return;}if(script.shellScript.includes('posthog-react-native')){return;}var code=JSON.parse(script.shellScript);script.shellScript=JSON.stringify(addPostHogWithBundledScriptsToBundleShellScript(code,skipOnConflict));}var POSTHOG_REACT_NATIVE_XCODE_PATH="`\"$NODE_BINARY\" --print \"require('path').join(require('path').dirname(require.resolve('posthog-react-native')), '..', 'tooling', 'posthog-xcode.sh')\"`";var POSTHOG_SKIP_ON_CONFLICT_EXPORT='export POSTHOG_SKIP_ON_CONFLICT=1';var REACT_NATIVE_XCODE_LINE=/^([ \t]*)(?![A-Za-z_][A-Za-z0-9_]*=)([^\n]*(?:packager|scripts)\/react-native-xcode\.sh\b[^\n]*)$/m;function migrateLegacyPostHogWrapperInvocation(script){return script.replace("/bin/sh ".concat(POSTHOG_REACT_NATIVE_XCODE_PATH),POSTHOG_REACT_NATIVE_XCODE_PATH);}function updatePostHogSkipOnConflict(script,skipOnConflict){var _a,_b;var skipArg='--posthog-skip-on-conflict --';var lines=script.replace(new RegExp("\\s*".concat(skipArg,"\\s*"),'g'),' ').split('\n').filter(function(line){return line.trim()!==POSTHOG_SKIP_ON_CONFLICT_EXPORT;});if(skipOnConflict){var commandIndex=lines.findIndex(function(line){return line.includes(POSTHOG_REACT_NATIVE_XCODE_PATH);});if(commandIndex!==-1){var indent=(_b=(_a=lines[commandIndex].match(/^[ \t]*/))===null||_a===void 0?void 0:_a[0])!==null&&_b!==void 0?_b:'';lines.splice(commandIndex,0,"".concat(indent).concat(POSTHOG_SKIP_ON_CONFLICT_EXPORT));}}return lines.join('\n');}function addPostHogWithBundledScriptsToBundleShellScript(script){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return script.replace(REACT_NATIVE_XCODE_LINE,function(_match,indent,rnCommand){var skipOnConflictExport=skipOnConflict?"".concat(indent).concat(POSTHOG_SKIP_ON_CONFLICT_EXPORT,"\n"):'';return"".concat(skipOnConflictExport).concat(indent).concat(POSTHOG_REACT_NATIVE_XCODE_PATH," ").concat(rnCommand);});}var POSTHOG_DSYM_BUILD_PHASE_NAME='Upload PostHog Debug Symbols';var POSTHOG_DSYM_INPUT_PATH='"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)/Contents/Resources/DWARF/$(EXECUTABLE_NAME)"';function buildDsymUploadShellScript(){var includeSource=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var lines=['# Upload iOS dSYMs to PostHog so native crashes can be symbolicated.','# upload-symbols.sh ships inside the posthog-ios dependency.'];if(includeSource){lines.push('# Also upload native source files for source-code context around crashes.','export POSTHOG_INCLUDE_SOURCE=1');}if(skipOnConflict){lines.push('# Skip dSYMs that already exist in PostHog with different content instead of failing the build.','export POSTHOG_SKIP_ON_CONFLICT=1');}lines.push('PODS_SCRIPT="${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh"','SPM_SCRIPT="${BUILD_DIR%/Build/*}/SourcePackages/checkouts/posthog-ios/build-tools/upload-symbols.sh"','if [ -f "$PODS_SCRIPT" ]; then',' /bin/sh "$PODS_SCRIPT"','elif [ -f "$SPM_SCRIPT" ]; then',' /bin/sh "$SPM_SCRIPT"','else',' echo "warning: PostHog upload-symbols.sh not found in Pods or SwiftPM checkouts; skipping dSYM upload."','fi');return lines.join('\n');}function encodePbxShellScript(script){return'"'+script.replace(/"/g,'\\"')+'"';}function decodePbxShellScript(stored){if(!stored.startsWith('"')||!stored.endsWith('"')){return stored;}return stored.slice(1,-1).replace(/\\(.)/g,function(_match,ch){return ch==='n'?'\n':ch==='t'?'\t':ch;});}function isPluginGeneratedDsymUploadBuildPhase(phase){if(typeof(phase===null||phase===void 0?void 0:phase.shellScript)!=='string'){return false;}return[false,true].some(function(source){return[false,true].some(function(skip){return decodePbxShellScript(phase.shellScript)===buildDsymUploadShellScript(source,skip);});});}function moveDsymUploadBuildPhaseToEnd(xcodeProject){var _a,_b;var existing=xcodeProject.pbxItemByComment(POSTHOG_DSYM_BUILD_PHASE_NAME,'PBXShellScriptBuildPhase');if(!isPluginGeneratedDsymUploadBuildPhase(existing)){return;}var buildPhases=(_b=(_a=xcodeProject.getFirstTarget)===null||_a===void 0?void 0:_a.call(xcodeProject).firstTarget)===null||_b===void 0?void 0:_b.buildPhases;if(Array.isArray(buildPhases)){var phaseIndex=buildPhases.findIndex(function(phase){return phase.comment===POSTHOG_DSYM_BUILD_PHASE_NAME;});if(phaseIndex!==-1&&phaseIndex!==buildPhases.length-1){buildPhases.push.apply(buildPhases,(0,_toConsumableArray2["default"])(buildPhases.splice(phaseIndex,1)));}}}function addDsymUploadBuildPhase(xcodeProject){var includeSource=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var skipOnConflict=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var existing=xcodeProject.pbxItemByComment(POSTHOG_DSYM_BUILD_PHASE_NAME,'PBXShellScriptBuildPhase');if(existing){if(isPluginGeneratedDsymUploadBuildPhase(existing)){existing.shellScript=encodePbxShellScript(buildDsymUploadShellScript(includeSource,skipOnConflict));existing.inputPaths=Array.from(new Set([].concat((0,_toConsumableArray2["default"])(Array.isArray(existing.inputPaths)?existing.inputPaths:[]),[POSTHOG_DSYM_INPUT_PATH])));}}else{xcodeProject.addBuildPhase([],'PBXShellScriptBuildPhase',POSTHOG_DSYM_BUILD_PHASE_NAME,null,{inputPaths:[POSTHOG_DSYM_INPUT_PATH],shellPath:'/bin/sh',shellScript:buildDsymUploadShellScript(includeSource,skipOnConflict)});}moveDsymUploadBuildPhaseToEnd(xcodeProject);}function disableUserScriptSandboxing(xcodeProject){var configurations=xcodeProject.pbxXCBuildConfigurationSection();for(var key in configurations){var configuration=configurations[key];if(configuration&&configuration.buildSettings){configuration.buildSettings.ENABLE_USER_SCRIPT_SANDBOXING='"NO"';}}}var POSTHOG_DOTENV_BUILD_SETTING='POSTHOG_CLI_DOTENV_FILE';var POSTHOG_DOTENV_GRADLE_PROPERTY='posthog.dotenvFile';function normalizeDotenvFileProp(dotenvFile){return dotenvFile.replace(/^\.\//,'');}function resolveDotenvFileProp(dotenvFile){var trimmed=dotenvFile===null||dotenvFile===void 0?void 0:dotenvFile.trim();return trimmed?trimmed:undefined;}function isAbsoluteDotenvPath(dotenvFile){return dotenvFile.startsWith('/')||/^[A-Za-z]:[\\/]/.test(dotenvFile);}function buildIosDotenvFileBuildSetting(dotenvFile){var value=isAbsoluteDotenvPath(dotenvFile)?dotenvFile:"$(SRCROOT)/../".concat(normalizeDotenvFileProp(dotenvFile));return'"'+value.replace(/(["\\])/g,'\\$1')+'"';}function applyDotenvFileBuildSetting(xcodeProject,dotenvFile){var configurations=xcodeProject.pbxXCBuildConfigurationSection();for(var key in configurations){var configuration=configurations[key];if(configuration&&configuration.buildSettings){if(dotenvFile){configuration.buildSettings[POSTHOG_DOTENV_BUILD_SETTING]=buildIosDotenvFileBuildSetting(dotenvFile);}else{delete configuration.buildSettings[POSTHOG_DOTENV_BUILD_SETTING];}}}}function buildAndroidDotenvFileGradleValue(dotenvFile){return isAbsoluteDotenvPath(dotenvFile)?dotenvFile:"../".concat(normalizeDotenvFileProp(dotenvFile));}function updateDotenvFileGradleProperties(properties,dotenvFile){var rest=properties.filter(function(item){return!(item.type==='property'&&item.key===POSTHOG_DOTENV_GRADLE_PROPERTY);});if(!dotenvFile){return rest;}rest.push({type:'property',key:POSTHOG_DOTENV_GRADLE_PROPERTY,value:buildAndroidDotenvFileGradleValue(dotenvFile)});return rest;}var withPostHogGradleProperties=function withPostHogGradleProperties(config,dotenvFile){return withGradleProperties(config,function(config){config.modResults=updateDotenvFileGradleProperties(config.modResults,dotenvFile);return config;});};function resolveNativeSymbolUpload(prop){if(prop===true){return{enabled:true,includeSource:false};}if(prop&&(0,_typeof2["default"])(prop)==='object'){return{enabled:true,includeSource:prop.includeSource===true};}return{enabled:false,includeSource:false};}var withFinalizedXcodeProject=function withFinalizedXcodeProject(config,_action){return withBaseMod(config,{platform:'ios',mod:'xcodeproj',action:function action(config){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){var _config$modRequest,nextMod,modRequest,results;return _regenerator["default"].wrap(function(_context){while(1)switch(_context.prev=_context.next){case 0:_config$modRequest=config.modRequest,nextMod=_config$modRequest.nextMod,modRequest=(0,_objectWithoutProperties2["default"])(_config$modRequest,_excluded);_context.next=1;return nextMod(_objectSpread(_objectSpread({},config),{},{modRequest:modRequest}));case 1:results=_context.sent;return _context.abrupt("return",_action(results));case 2:case"end":return _context.stop();}},_callee);}))();}});};var withIosPlugin=function withIosPlugin(config){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var nativeSymbols=resolveNativeSymbolUpload(props.uploadNativeSymbols);config=withXcodeProject(config,function(config){var xcodeProject=config.modResults;var bundleReactNativePhase=xcodeProject.pbxItemByComment('Bundle React Native code and images','PBXShellScriptBuildPhase');modifyExistingXcodeBuildScript(bundleReactNativePhase,props.skipOnConflict===true);if(nativeSymbols.enabled){addDsymUploadBuildPhase(xcodeProject,nativeSymbols.includeSource,props.skipOnConflict===true);}applyDotenvFileBuildSetting(xcodeProject,props.dotenvFile);if(props.disableSandboxing!==false){disableUserScriptSandboxing(xcodeProject);console.warn('[posthog-react-native] Setting ENABLE_USER_SCRIPT_SANDBOXING=NO on all Xcode '+'build configurations so sourcemap uploads can resolve git metadata. '+'If your org requires sandboxing to stay enabled, set `{ disableSandboxing: false }` '+'on the plugin in app.json — note that stock Expo projects may fail to build under '+'sandboxing until every script build phase declares its input/output files.');}return config;});if(nativeSymbols.enabled){config=withFinalizedXcodeProject(config,function(config){moveDsymUploadBuildPhaseToEnd(config.modResults);return config;});}return config;};var withPostHogPlugin=function withPostHogPlugin(config){var rawProps=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var props=_objectSpread(_objectSpread({},rawProps),{},{dotenvFile:resolveDotenvFileProp(rawProps.dotenvFile)});if(resolveNativeSymbolUpload(props.uploadNativeSymbols).enabled){config=withAndroidNativeSymbolsPlugin(config);}config=withAndroidPlugin(config,props.skipOnConflict===true);config=withPostHogGradleProperties(config,props.dotenvFile);return withIosPlugin(config,props);};var postHogPlugin=function postHogPlugin(config){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return withPostHogPlugin(config,props);};module.exports=postHogPlugin;module.exports.modifyExistingXcodeBuildScript=modifyExistingXcodeBuildScript;module.exports.addPostHogWithBundledScriptsToBundleShellScript=addPostHogWithBundledScriptsToBundleShellScript;module.exports.disableUserScriptSandboxing=disableUserScriptSandboxing;module.exports.buildDsymUploadShellScript=buildDsymUploadShellScript;module.exports.addDsymUploadBuildPhase=addDsymUploadBuildPhase;module.exports.moveDsymUploadBuildPhaseToEnd=moveDsymUploadBuildPhaseToEnd;module.exports.resolveNativeSymbolUpload=resolveNativeSymbolUpload;module.exports.buildAndroidSkipOnConflictGradleLine=buildAndroidSkipOnConflictGradleLine;module.exports.addPostHogAndroidGradlePluginClasspath=addPostHogAndroidGradlePluginClasspath;module.exports.applyPostHogAndroidGradlePlugin=applyPostHogAndroidGradlePlugin;module.exports.buildIosDotenvFileBuildSetting=buildIosDotenvFileBuildSetting;module.exports.applyDotenvFileBuildSetting=applyDotenvFileBuildSetting;module.exports.resolveDotenvFileProp=resolveDotenvFileProp;module.exports.buildAndroidDotenvFileGradleValue=buildAndroidDotenvFileGradleValue;module.exports.updateDotenvFileGradleProperties=updateDotenvFileGradleProperties;
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.POSTHOG_RELEASE_MODES=void 0;exports.addDsymUploadBuildPhase=addDsymUploadBuildPhase;exports.addPostHogAndroidGradlePluginClasspath=addPostHogAndroidGradlePluginClasspath;exports.addPostHogWithBundledScriptsToBundleShellScript=addPostHogWithBundledScriptsToBundleShellScript;exports.applyDotenvFileBuildSetting=applyDotenvFileBuildSetting;exports.applyPostHogAndroidGradlePlugin=applyPostHogAndroidGradlePlugin;exports.buildAndroidDotenvFileGradleValue=buildAndroidDotenvFileGradleValue;exports.buildAndroidSkipOnConflictGradleLine=buildAndroidSkipOnConflictGradleLine;exports.buildDsymUploadShellScript=buildDsymUploadShellScript;exports.buildIosDotenvFileBuildSetting=buildIosDotenvFileBuildSetting;exports.disableUserScriptSandboxing=disableUserScriptSandboxing;exports.modifyExistingXcodeBuildScript=modifyExistingXcodeBuildScript;exports.moveDsymUploadBuildPhaseToEnd=moveDsymUploadBuildPhaseToEnd;exports.resolveDotenvFileProp=resolveDotenvFileProp;exports.resolveNativeSymbolUpload=resolveNativeSymbolUpload;exports.resolveReleaseModeProp=resolveReleaseModeProp;exports.updateDotenvFileGradleProperties=updateDotenvFileGradleProperties;exports.updateReleaseModeGradleProperties=updateReleaseModeGradleProperties;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _excluded=["nextMod"];function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){(0,_defineProperty2["default"])(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}var _require=require('@expo/config-plugins'),withAppBuildGradle=_require.withAppBuildGradle,withBaseMod=_require.withBaseMod,withGradleProperties=_require.withGradleProperties,withProjectBuildGradle=_require.withProjectBuildGradle,withXcodeProject=_require.withXcodeProject;var POSTHOG_ANDROID_GRADLE_PLUGIN_VERSION='1.5.1';var resolvePostHogReactNativePackageJsonPath="[\"node\", \"--print\", \"require('path').join(require('path').dirname(require.resolve('posthog-react-native')), '..', 'tooling', 'posthog.gradle')\"].execute().text.trim()";var POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY='posthogReactNativeSkipOnConflict';var POSTHOG_RELEASE_MODES=exports.POSTHOG_RELEASE_MODES=['symbol-set','event'];function resolveReleaseModeProp(releaseMode){var trimmed=releaseMode===null||releaseMode===void 0?void 0:releaseMode.trim();if(!trimmed){return undefined;}if(!POSTHOG_RELEASE_MODES.includes(trimmed)){throw new Error("[posthog-react-native] releaseMode must be one of ".concat(POSTHOG_RELEASE_MODES.join(', '),", was '").concat(trimmed,"'"));}return trimmed;}function buildAndroidSkipOnConflictGradleLine(skipOnConflict){if(!skipOnConflict){return null;}return"project.ext.".concat(POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY," = true");}var withAndroidPlugin=function withAndroidPlugin(config){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return withAppBuildGradle(config,function(config){if(config.modResults.language!=='groovy'){console.warn('Cannot configure PostHog in the app gradle because the build.gradle is not groovy');}var buildGradle=config.modResults.contents;var applyFrom="apply from: new File(".concat(resolvePostHogReactNativePackageJsonPath,")");var skipOnConflictLine=buildAndroidSkipOnConflictGradleLine(skipOnConflict);var applyBlock=skipOnConflictLine?"".concat(skipOnConflictLine,"\n").concat(applyFrom):applyFrom;var skipOnConflictPattern=new RegExp("^project\\.ext\\.".concat(POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY,"\\s*=\\s*(true|false)\\n?"),'m');if(buildGradle.includes(applyFrom)){var contents=buildGradle.replace(skipOnConflictPattern,'');if(skipOnConflictLine){contents=contents.replace(applyFrom,"".concat(skipOnConflictLine,"\n").concat(applyFrom));}config.modResults.contents=contents;return config;}var pattern=/^android\s*\{/m;if(buildGradle.match(pattern)){config.modResults.contents=buildGradle.replace(pattern,"".concat(applyBlock,"\n\nandroid {"));}else{console.warn('PostHog: Could not find "android {" block in build.gradle');}return config;});};function matchingBraceIndex(s,openBraceIndex){var depth=0;for(var i=openBraceIndex;i<s.length;i++){if(s[i]==='{'){depth++;}else if(s[i]==='}'){depth--;if(depth===0){return i;}}}return-1;}function addPostHogAndroidGradlePluginClasspath(projectBuildGradle){if(projectBuildGradle.includes('posthog-android-gradle-plugin')){return{contents:projectBuildGradle,classpathPresent:true};}var classpathLine=" classpath(\"com.posthog:posthog-android-gradle-plugin:".concat(POSTHOG_ANDROID_GRADLE_PLUGIN_VERSION,"\")");var buildscriptMatch=/buildscript\s*\{/.exec(projectBuildGradle);var buildscriptOpenBrace=buildscriptMatch?buildscriptMatch.index+buildscriptMatch[0].length-1:-1;var buildscriptEnd=buildscriptOpenBrace===-1?-1:matchingBraceIndex(projectBuildGradle,buildscriptOpenBrace);var buildscriptBody=buildscriptEnd===-1?'':projectBuildGradle.slice(buildscriptOpenBrace,buildscriptEnd);var dependenciesMatch=buildscriptBody?/dependencies\s*\{/.exec(buildscriptBody):null;if(!dependenciesMatch){console.warn('PostHog: Could not find a buildscript dependencies block in the project build.gradle; '+'skipping the com.posthog.android classpath. Native symbols will not be uploaded.');return{contents:projectBuildGradle,classpathPresent:false};}var insertAt=buildscriptOpenBrace+dependenciesMatch.index+dependenciesMatch[0].length;return{contents:"".concat(projectBuildGradle.slice(0,insertAt),"\n").concat(classpathLine).concat(projectBuildGradle.slice(insertAt)),classpathPresent:true};}function applyPostHogAndroidGradlePlugin(appBuildGradle){if(/apply plugin: ["']com\.posthog\.android["']/.test(appBuildGradle)){return appBuildGradle;}var applyLine='apply plugin: "com.posthog.android"';var appPluginPattern=/^([ \t]*apply plugin: ["']com\.android\.application["'].*)$/m;if(appPluginPattern.test(appBuildGradle)){return appBuildGradle.replace(appPluginPattern,"$1\n".concat(applyLine));}var androidBlockPattern=/^android\s*\{/m;if(androidBlockPattern.test(appBuildGradle)){return appBuildGradle.replace(androidBlockPattern,"".concat(applyLine,"\n\nandroid {"));}console.warn('PostHog: Could not find where to apply com.posthog.android in the app build.gradle');return appBuildGradle;}var withAndroidNativeSymbolsPlugin=function withAndroidNativeSymbolsPlugin(config){var classpathPresent=false;config=withProjectBuildGradle(config,function(config){if(config.modResults.language!=='groovy'){console.warn('Cannot configure the PostHog Android Gradle plugin because the project build.gradle is not groovy');return config;}var result=addPostHogAndroidGradlePluginClasspath(config.modResults.contents);config.modResults.contents=result.contents;classpathPresent=result.classpathPresent;return config;});return withAppBuildGradle(config,function(config){if(config.modResults.language!=='groovy'){console.warn('Cannot configure the PostHog Android Gradle plugin because the app build.gradle is not groovy');return config;}if(!classpathPresent){return config;}config.modResults.contents=applyPostHogAndroidGradlePlugin(config.modResults.contents);return config;});};function modifyExistingXcodeBuildScript(script){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var releaseMode=arguments.length>2?arguments[2]:undefined;if(!(script===null||script===void 0?void 0:script.shellScript)){console.warn("[posthog-react-native] Could not find the 'Bundle React Native code and images' build phase; "+'skipping sourcemap upload setup.');return;}if(!script.shellScript.match(/(packager|scripts)\/react-native-xcode\.sh\b/)){return;}if(script.shellScript.includes('posthog-xcode.sh')){var _code=migrateLegacyPostHogWrapperInvocation(JSON.parse(script.shellScript));script.shellScript=JSON.stringify(updatePostHogBundlePhaseExports(_code,skipOnConflict,releaseMode));return;}if(script.shellScript.includes('posthog-react-native')){return;}var code=JSON.parse(script.shellScript);script.shellScript=JSON.stringify(addPostHogWithBundledScriptsToBundleShellScript(code,skipOnConflict,releaseMode));}var POSTHOG_REACT_NATIVE_XCODE_PATH="`\"$NODE_BINARY\" --print \"require('path').join(require('path').dirname(require.resolve('posthog-react-native')), '..', 'tooling', 'posthog-xcode.sh')\"`";var POSTHOG_SKIP_ON_CONFLICT_EXPORT='export POSTHOG_SKIP_ON_CONFLICT=1';var POSTHOG_RELEASE_MODE_EXPORT_PREFIX='export POSTHOG_RELEASE_MODE=';function buildBundlePhaseExports(skipOnConflict,releaseMode){var exports=[];if(skipOnConflict){exports.push(POSTHOG_SKIP_ON_CONFLICT_EXPORT);}if(releaseMode){exports.push("".concat(POSTHOG_RELEASE_MODE_EXPORT_PREFIX).concat(releaseMode));}return exports;}var REACT_NATIVE_XCODE_LINE=/^([ \t]*)(?![A-Za-z_][A-Za-z0-9_]*=)([^\n]*(?:packager|scripts)\/react-native-xcode\.sh\b[^\n]*)$/m;function migrateLegacyPostHogWrapperInvocation(script){return script.replace("/bin/sh ".concat(POSTHOG_REACT_NATIVE_XCODE_PATH),POSTHOG_REACT_NATIVE_XCODE_PATH);}function updatePostHogBundlePhaseExports(script,skipOnConflict,releaseMode){var _a,_b;var skipArg='--posthog-skip-on-conflict --';var lines=script.replace(new RegExp("\\s*".concat(skipArg,"\\s*"),'g'),' ').split('\n').filter(function(line){return line.trim()!==POSTHOG_SKIP_ON_CONFLICT_EXPORT;}).filter(function(line){return!line.trim().startsWith(POSTHOG_RELEASE_MODE_EXPORT_PREFIX);});var exports=buildBundlePhaseExports(skipOnConflict,releaseMode);if(exports.length>0){var commandIndex=lines.findIndex(function(line){return line.includes(POSTHOG_REACT_NATIVE_XCODE_PATH);});if(commandIndex!==-1){var indent=(_b=(_a=lines[commandIndex].match(/^[ \t]*/))===null||_a===void 0?void 0:_a[0])!==null&&_b!==void 0?_b:'';lines.splice.apply(lines,[commandIndex,0].concat((0,_toConsumableArray2["default"])(exports.map(function(line){return"".concat(indent).concat(line);}))));}}return lines.join('\n');}function addPostHogWithBundledScriptsToBundleShellScript(script){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var releaseMode=arguments.length>2?arguments[2]:undefined;return script.replace(REACT_NATIVE_XCODE_LINE,function(_match,indent,rnCommand){var exports=buildBundlePhaseExports(skipOnConflict,releaseMode).map(function(line){return"".concat(indent).concat(line,"\n");}).join('');return"".concat(exports).concat(indent).concat(POSTHOG_REACT_NATIVE_XCODE_PATH," ").concat(rnCommand);});}var POSTHOG_DSYM_BUILD_PHASE_NAME='Upload PostHog Debug Symbols';var POSTHOG_DSYM_INPUT_PATH='"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)/Contents/Resources/DWARF/$(EXECUTABLE_NAME)"';function buildDsymUploadShellScript(){var includeSource=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var releaseMode=arguments.length>2?arguments[2]:undefined;return composeDsymUploadShellScript(includeSource,skipOnConflict,buildDsymReleaseModeLines(releaseMode));}function buildLegacyDsymUploadShellScript(includeSource,skipOnConflict){return composeDsymUploadShellScript(includeSource,skipOnConflict,[]);}function composeDsymUploadShellScript(includeSource,skipOnConflict,releaseModeLines){var lines=['# Upload iOS dSYMs to PostHog so native crashes can be symbolicated.','# upload-symbols.sh ships inside the posthog-ios dependency.'];if(includeSource){lines.push('# Also upload native source files for source-code context around crashes.','export POSTHOG_INCLUDE_SOURCE=1');}if(skipOnConflict){lines.push('# Skip dSYMs that already exist in PostHog with different content instead of failing the build.','export POSTHOG_SKIP_ON_CONFLICT=1');}lines.push.apply(lines,(0,_toConsumableArray2["default"])(releaseModeLines));lines.push('PODS_SCRIPT="${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh"','SPM_SCRIPT="${BUILD_DIR%/Build/*}/SourcePackages/checkouts/posthog-ios/build-tools/upload-symbols.sh"','if [ -f "$PODS_SCRIPT" ]; then',' /bin/sh "$PODS_SCRIPT"','elif [ -f "$SPM_SCRIPT" ]; then',' /bin/sh "$SPM_SCRIPT"','else',' echo "warning: PostHog upload-symbols.sh not found in Pods or SwiftPM checkouts; skipping dSYM upload."','fi');return lines.join('\n');}function buildDsymReleaseModeLines(releaseMode){return[releaseMode?"POSTHOG_RESOLVED_RELEASE_MODE=\"".concat(releaseMode,"\""):'POSTHOG_RESOLVED_RELEASE_MODE="${POSTHOG_RELEASE_MODE:-}"','case "$POSTHOG_RESOLVED_RELEASE_MODE" in',' ""|symbol-set) ;;',' event)',' # Upload dSYMs without binding them to a release, so each crash resolves its own from the',' # app version and namespace the SDK sends. posthog-ios versions whose upload-symbols.sh',' # does not read this variable ignore it and keep binding the dSYMs.',' export POSTHOG_NO_RELEASE_BIND=1',' ;;',' *)'," echo \"error: posthog release mode must be 'symbol-set' or 'event', was '$POSTHOG_RESOLVED_RELEASE_MODE'\"",' exit 1',' ;;','esac'];}function encodePbxShellScript(script){return'"'+script.replace(/"/g,'\\"')+'"';}function decodePbxShellScript(stored){if(!stored.startsWith('"')||!stored.endsWith('"')){return stored;}return stored.slice(1,-1).replace(/\\(.)/g,function(_match,ch){return ch==='n'?'\n':ch==='t'?'\t':ch;});}function isPluginGeneratedDsymUploadBuildPhase(phase){if(typeof(phase===null||phase===void 0?void 0:phase.shellScript)!=='string'){return false;}var stored=decodePbxShellScript(phase.shellScript);return[false,true].some(function(source){return[false,true].some(function(skip){return stored===buildLegacyDsymUploadShellScript(source,skip)||[undefined].concat(POSTHOG_RELEASE_MODES).some(function(mode){return stored===buildDsymUploadShellScript(source,skip,mode);});});});}function moveDsymUploadBuildPhaseToEnd(xcodeProject){var _a,_b;var existing=xcodeProject.pbxItemByComment(POSTHOG_DSYM_BUILD_PHASE_NAME,'PBXShellScriptBuildPhase');if(!isPluginGeneratedDsymUploadBuildPhase(existing)){return;}var buildPhases=(_b=(_a=xcodeProject.getFirstTarget)===null||_a===void 0?void 0:_a.call(xcodeProject).firstTarget)===null||_b===void 0?void 0:_b.buildPhases;if(Array.isArray(buildPhases)){var phaseIndex=buildPhases.findIndex(function(phase){return phase.comment===POSTHOG_DSYM_BUILD_PHASE_NAME;});if(phaseIndex!==-1&&phaseIndex!==buildPhases.length-1){buildPhases.push.apply(buildPhases,(0,_toConsumableArray2["default"])(buildPhases.splice(phaseIndex,1)));}}}function addDsymUploadBuildPhase(xcodeProject){var includeSource=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var skipOnConflict=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var releaseMode=arguments.length>3?arguments[3]:undefined;var existing=xcodeProject.pbxItemByComment(POSTHOG_DSYM_BUILD_PHASE_NAME,'PBXShellScriptBuildPhase');if(existing){if(isPluginGeneratedDsymUploadBuildPhase(existing)){existing.shellScript=encodePbxShellScript(buildDsymUploadShellScript(includeSource,skipOnConflict,releaseMode));existing.inputPaths=Array.from(new Set([].concat((0,_toConsumableArray2["default"])(Array.isArray(existing.inputPaths)?existing.inputPaths:[]),[POSTHOG_DSYM_INPUT_PATH])));}}else{xcodeProject.addBuildPhase([],'PBXShellScriptBuildPhase',POSTHOG_DSYM_BUILD_PHASE_NAME,null,{inputPaths:[POSTHOG_DSYM_INPUT_PATH],shellPath:'/bin/sh',shellScript:buildDsymUploadShellScript(includeSource,skipOnConflict,releaseMode)});}moveDsymUploadBuildPhaseToEnd(xcodeProject);}function disableUserScriptSandboxing(xcodeProject){var configurations=xcodeProject.pbxXCBuildConfigurationSection();for(var key in configurations){var configuration=configurations[key];if(configuration&&configuration.buildSettings){configuration.buildSettings.ENABLE_USER_SCRIPT_SANDBOXING='"NO"';}}}var POSTHOG_DOTENV_BUILD_SETTING='POSTHOG_CLI_DOTENV_FILE';var POSTHOG_DOTENV_GRADLE_PROPERTY='posthog.dotenvFile';var POSTHOG_RELEASE_MODE_GRADLE_PROPERTY='posthog.releaseMode';function normalizeDotenvFileProp(dotenvFile){return dotenvFile.replace(/^\.\//,'');}function resolveDotenvFileProp(dotenvFile){var trimmed=dotenvFile===null||dotenvFile===void 0?void 0:dotenvFile.trim();return trimmed?trimmed:undefined;}function isAbsoluteDotenvPath(dotenvFile){return dotenvFile.startsWith('/')||/^[A-Za-z]:[\\/]/.test(dotenvFile);}function buildIosDotenvFileBuildSetting(dotenvFile){var value=isAbsoluteDotenvPath(dotenvFile)?dotenvFile:"$(SRCROOT)/../".concat(normalizeDotenvFileProp(dotenvFile));return'"'+value.replace(/(["\\])/g,'\\$1')+'"';}function applyDotenvFileBuildSetting(xcodeProject,dotenvFile){var configurations=xcodeProject.pbxXCBuildConfigurationSection();for(var key in configurations){var configuration=configurations[key];if(configuration&&configuration.buildSettings){if(dotenvFile){configuration.buildSettings[POSTHOG_DOTENV_BUILD_SETTING]=buildIosDotenvFileBuildSetting(dotenvFile);}else{delete configuration.buildSettings[POSTHOG_DOTENV_BUILD_SETTING];}}}}function buildAndroidDotenvFileGradleValue(dotenvFile){return isAbsoluteDotenvPath(dotenvFile)?dotenvFile:"../".concat(normalizeDotenvFileProp(dotenvFile));}function updateDotenvFileGradleProperties(properties,dotenvFile){var rest=properties.filter(function(item){return!(item.type==='property'&&item.key===POSTHOG_DOTENV_GRADLE_PROPERTY);});if(!dotenvFile){return rest;}rest.push({type:'property',key:POSTHOG_DOTENV_GRADLE_PROPERTY,value:buildAndroidDotenvFileGradleValue(dotenvFile)});return rest;}function updateReleaseModeGradleProperties(properties,releaseMode){var rest=properties.filter(function(item){return!(item.type==='property'&&item.key===POSTHOG_RELEASE_MODE_GRADLE_PROPERTY);});if(!releaseMode){return rest;}rest.push({type:'property',key:POSTHOG_RELEASE_MODE_GRADLE_PROPERTY,value:releaseMode});return rest;}var withPostHogGradleProperties=function withPostHogGradleProperties(config,dotenvFile,releaseMode){return withGradleProperties(config,function(config){config.modResults=updateDotenvFileGradleProperties(config.modResults,dotenvFile);config.modResults=updateReleaseModeGradleProperties(config.modResults,releaseMode);return config;});};function resolveNativeSymbolUpload(prop){if(prop===true){return{enabled:true,includeSource:false};}if(prop&&(0,_typeof2["default"])(prop)==='object'){return{enabled:true,includeSource:prop.includeSource===true};}return{enabled:false,includeSource:false};}var withFinalizedXcodeProject=function withFinalizedXcodeProject(config,_action){return withBaseMod(config,{platform:'ios',mod:'xcodeproj',action:function action(config){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){var _config$modRequest,nextMod,modRequest,results;return _regenerator["default"].wrap(function(_context){while(1)switch(_context.prev=_context.next){case 0:_config$modRequest=config.modRequest,nextMod=_config$modRequest.nextMod,modRequest=(0,_objectWithoutProperties2["default"])(_config$modRequest,_excluded);_context.next=1;return nextMod(_objectSpread(_objectSpread({},config),{},{modRequest:modRequest}));case 1:results=_context.sent;return _context.abrupt("return",_action(results));case 2:case"end":return _context.stop();}},_callee);}))();}});};var withIosPlugin=function withIosPlugin(config){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var nativeSymbols=resolveNativeSymbolUpload(props.uploadNativeSymbols);config=withXcodeProject(config,function(config){var xcodeProject=config.modResults;var bundleReactNativePhase=xcodeProject.pbxItemByComment('Bundle React Native code and images','PBXShellScriptBuildPhase');modifyExistingXcodeBuildScript(bundleReactNativePhase,props.skipOnConflict===true,props.releaseMode);if(nativeSymbols.enabled){addDsymUploadBuildPhase(xcodeProject,nativeSymbols.includeSource,props.skipOnConflict===true,props.releaseMode);}applyDotenvFileBuildSetting(xcodeProject,props.dotenvFile);if(props.disableSandboxing!==false){disableUserScriptSandboxing(xcodeProject);console.warn('[posthog-react-native] Setting ENABLE_USER_SCRIPT_SANDBOXING=NO on all Xcode '+'build configurations so sourcemap uploads can resolve git metadata. '+'If your org requires sandboxing to stay enabled, set `{ disableSandboxing: false }` '+'on the plugin in app.json — note that stock Expo projects may fail to build under '+'sandboxing until every script build phase declares its input/output files.');}return config;});if(nativeSymbols.enabled){config=withFinalizedXcodeProject(config,function(config){moveDsymUploadBuildPhaseToEnd(config.modResults);return config;});}return config;};var withPostHogPlugin=function withPostHogPlugin(config){var rawProps=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var props=_objectSpread(_objectSpread({},rawProps),{},{dotenvFile:resolveDotenvFileProp(rawProps.dotenvFile),releaseMode:resolveReleaseModeProp(rawProps.releaseMode)});if(resolveNativeSymbolUpload(props.uploadNativeSymbols).enabled){config=withAndroidNativeSymbolsPlugin(config);}config=withAndroidPlugin(config,props.skipOnConflict===true);config=withPostHogGradleProperties(config,props.dotenvFile,props.releaseMode);return withIosPlugin(config,props);};var postHogPlugin=function postHogPlugin(config){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return withPostHogPlugin(config,props);};module.exports=postHogPlugin;module.exports.modifyExistingXcodeBuildScript=modifyExistingXcodeBuildScript;module.exports.addPostHogWithBundledScriptsToBundleShellScript=addPostHogWithBundledScriptsToBundleShellScript;module.exports.disableUserScriptSandboxing=disableUserScriptSandboxing;module.exports.buildDsymUploadShellScript=buildDsymUploadShellScript;module.exports.addDsymUploadBuildPhase=addDsymUploadBuildPhase;module.exports.moveDsymUploadBuildPhaseToEnd=moveDsymUploadBuildPhaseToEnd;module.exports.resolveNativeSymbolUpload=resolveNativeSymbolUpload;module.exports.buildAndroidSkipOnConflictGradleLine=buildAndroidSkipOnConflictGradleLine;module.exports.addPostHogAndroidGradlePluginClasspath=addPostHogAndroidGradlePluginClasspath;module.exports.applyPostHogAndroidGradlePlugin=applyPostHogAndroidGradlePlugin;module.exports.buildIosDotenvFileBuildSetting=buildIosDotenvFileBuildSetting;module.exports.applyDotenvFileBuildSetting=applyDotenvFileBuildSetting;module.exports.resolveDotenvFileProp=resolveDotenvFileProp;module.exports.buildAndroidDotenvFileGradleValue=buildAndroidDotenvFileGradleValue;module.exports.updateDotenvFileGradleProperties=updateDotenvFileGradleProperties;module.exports.POSTHOG_RELEASE_MODES=POSTHOG_RELEASE_MODES;module.exports.resolveReleaseModeProp=resolveReleaseModeProp;module.exports.updateReleaseModeGradleProperties=updateReleaseModeGradleProperties;
@@ -1 +1 @@
1
- {"version":3,"file":"expoconfig.js","sourceRoot":"","sources":["../../src/tooling/expoconfig.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,4BAA4B;AAC5B,wGAAwG;AAExG,MAAM,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,GACvG,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAEjC,uFAAuF;AACvF,0CAA0C;AAC1C,MAAM,qCAAqC,GAAG,OAAO,CAAA;AAErD,MAAM,wCAAwC,GAC5C,8KAA8K,CAAA;AAEhL,MAAM,yCAAyC,GAAG,kCAAkC,CAAA;AAEpF,MAAM,UAAU,oCAAoC,CAAC,cAAuB;IAC1E,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,eAAe,yCAAyC,SAAS,CAAA;AAC1E,CAAC;AAED,MAAM,iBAAiB,GAAG,CAAC,MAAW,EAAE,cAAc,GAAG,KAAK,EAAE,EAAE;IAChE,OAAO,kBAAkB,CAAC,MAAM,EAAE,CAAC,MAAW,EAAE,EAAE;QAChD,IAAI,MAAM,CA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AA+B,GAAG,+BAA+B,CAAA;AAChF,MAAM,CAAC,OAAO,CAAC,8BAA8B,GAAG,8BAA8B,CAAA;AAC9E,MAAM,CAAC,OAAO,CAAC,2BAA2B,GAAG,2BAA2B,CAAA;AACxE,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAA;AAC5D,MAAM,CAAC,OAAO,CAAC,iCAAiC,GAAG,iCAAiC,CAAA;AACpF,MAAM,CAAC,OAAO,CAAC,gCAAgC,GAAG,gCAAgC,CAAA;AAClF,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAA;AAC5D,MAAM,CAAC,OAAO,CAAC,sBAAsB,GAAG,sBAAsB,CAAA;AAC9D,MAAM,CAAC,OAAO,CAAC,iCAAiC,GAAG,iCAAiC,CAAA"}
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "4.65.1";
1
+ export declare const version = "4.66.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.65.1";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.66.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-react-native",
3
- "version": "4.65.1",
3
+ "version": "4.66.0",
4
4
  "bugs": {
5
5
  "url": "https://github.com/PostHog/posthog-js/issues"
6
6
  },
@@ -34,8 +34,8 @@
34
34
  "directory": "packages/react-native"
35
35
  },
36
36
  "dependencies": {
37
- "@posthog/types": "^1.407.0",
38
- "@posthog/core": "^1.48.12"
37
+ "@posthog/core": "^1.49.0",
38
+ "@posthog/types": "^1.407.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@babel/cli": "^7.19.3",
@@ -74,9 +74,9 @@
74
74
  "react-native-svg": "^15.0.0",
75
75
  "ts-jest": "29.4.11",
76
76
  "typescript": "5.8.2",
77
- "@posthog-tooling/rollup-utils": "1.1.1",
77
+ "@posthog-tooling/tsconfig-base": "1.1.1",
78
78
  "@posthog/react-native-plugin": "2.5.0",
79
- "@posthog-tooling/tsconfig-base": "1.1.1"
79
+ "@posthog-tooling/rollup-utils": "1.1.1"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "@react-native-async-storage/async-storage": ">=1.0.0",
@@ -33,12 +33,26 @@ print_command_error() {
33
33
  # WITH_ENVIRONMENT is executed by React Native
34
34
 
35
35
  POSTHOG_SKIP_ON_CONFLICT_ENABLED="${POSTHOG_SKIP_ON_CONFLICT:-}"
36
+ POSTHOG_RELEASE_MODE_VALUE="${POSTHOG_RELEASE_MODE:-}"
36
37
  while [ "$#" -gt 0 ]; do
37
38
  case "$1" in
38
39
  --posthog-skip-on-conflict)
39
40
  POSTHOG_SKIP_ON_CONFLICT_ENABLED=1
40
41
  shift
41
42
  ;;
43
+ --posthog-release-mode)
44
+ # `shift 2` past the end of the argument list makes `set -e` abort the wrapper silently.
45
+ if [ "$#" -lt 2 ]; then
46
+ echo "error: --posthog-release-mode needs a value ('symbol-set' or 'event')"
47
+ exit 1
48
+ fi
49
+ POSTHOG_RELEASE_MODE_VALUE="$2"
50
+ shift 2
51
+ ;;
52
+ --posthog-release-mode=*)
53
+ POSTHOG_RELEASE_MODE_VALUE="${1#*=}"
54
+ shift
55
+ ;;
42
56
  --)
43
57
  shift
44
58
  break
@@ -54,6 +68,32 @@ if [ "$POSTHOG_SKIP_ON_CONFLICT_ENABLED" = "1" ] || [ "$POSTHOG_SKIP_ON_CONFLICT
54
68
  POSTHOG_UPLOAD_ARGS+=(--skip-on-conflict)
55
69
  fi
56
70
 
71
+ # How the release a build belongs to gets associated with the exceptions it reports.
72
+ # symbol-set (the default) stamps the release onto the uploaded source maps, and an exception
73
+ # inherits the release of the maps its frames resolved against.
74
+ # event uploads the maps release-independent, and each event resolves its own release from the
75
+ # $app_namespace / $app_version / $app_build the SDK already sends. Xcode's build settings
76
+ # supply matching coordinates below, so nothing has to be injected into the app.
77
+ POSTHOG_RELEASE_MODE_ARGS=()
78
+ if [ -n "$POSTHOG_RELEASE_MODE_VALUE" ]; then
79
+ case "$POSTHOG_RELEASE_MODE_VALUE" in
80
+ symbol-set|event) ;;
81
+ *)
82
+ echo "error: posthog release mode must be 'symbol-set' or 'event', was '$POSTHOG_RELEASE_MODE_VALUE'"
83
+ exit 1
84
+ ;;
85
+ esac
86
+
87
+ # posthog-cli reads POSTHOG_RELEASE_MODE itself when --release-mode is absent, which it
88
+ # deliberately is in symbol-set mode so the flag stays optional against a CLI predating it. Pin
89
+ # the resolved mode so a variable inherited from the build environment cannot quietly override
90
+ # an explicit --posthog-release-mode.
91
+ export POSTHOG_RELEASE_MODE="$POSTHOG_RELEASE_MODE_VALUE"
92
+ if [ "$POSTHOG_RELEASE_MODE_VALUE" != "symbol-set" ]; then
93
+ POSTHOG_RELEASE_MODE_ARGS=(--release-mode "$POSTHOG_RELEASE_MODE_VALUE")
94
+ fi
95
+ fi
96
+
57
97
  REACT_NATIVE_XCODE_DEFAULT="../node_modules/react-native/scripts/react-native-xcode.sh"
58
98
  REACT_NATIVE_XCODE="$REACT_NATIVE_XCODE_DEFAULT"
59
99
  # A config plugin may already wrap the React Native script. Keep the complete
@@ -134,6 +174,26 @@ if [ -n "$PH_CLI_VERSION" ]; then
134
174
  fi
135
175
  fi
136
176
 
177
+ # The CLI is whatever the machine has, not a pinned version, so an older one rejects --release-mode
178
+ # with a bare argument-parser error. Checks the version read above, and mirrors the floor check in
179
+ # posthog-ios build-tools/upload-symbols.sh. POSTHOG_SKIP_CLI_VERSION_CHECK=1 allows a posthog-cli
180
+ # built from source, which reports its Cargo manifest version rather than the version it ships as.
181
+ # posthog-cli 0.16.0 added --release-mode to the hermes commands (PostHog/posthog#87660). Keep this
182
+ # in step with PostHogCli.MIN_RELEASE_MODE_VERSION in posthog.gradle.
183
+ MIN_RELEASE_MODE_CLI_VERSION="0.16.0"
184
+ if [ ${#POSTHOG_RELEASE_MODE_ARGS[@]} -gt 0 ] && [ "${POSTHOG_SKIP_CLI_VERSION_CHECK:-}" != "1" ]; then
185
+ if [ -z "$PH_CLI_VERSION" ]; then
186
+ echo "error: could not determine the posthog-cli version, which release mode '$POSTHOG_RELEASE_MODE_VALUE' needs. Upgrade: npm install -g @posthog/cli@latest"
187
+ exit 1
188
+ fi
189
+ # If the minimum sorts first, the installed version is at or above it.
190
+ PH_CLI_LOWEST=$(printf '%s\n%s\n' "$MIN_RELEASE_MODE_CLI_VERSION" "$PH_CLI_VERSION" | sort -t. -k1,1n -k2,2n -k3,3n | head -n1)
191
+ if [ "$PH_CLI_LOWEST" != "$MIN_RELEASE_MODE_CLI_VERSION" ]; then
192
+ echo "error: release mode '$POSTHOG_RELEASE_MODE_VALUE' needs posthog-cli >= ${MIN_RELEASE_MODE_CLI_VERSION} (found ${PH_CLI_VERSION}). Upgrade: npm install -g @posthog/cli@latest"
193
+ exit 1
194
+ fi
195
+ fi
196
+
137
197
  # mimics how the file is defined in node_modules/react-native/scripts/react-native-xcode.sh (PACKAGER_SOURCEMAP_FILE)
138
198
  SOURCEMAP_PACKAGER_FILE="$CONFIGURATION_BUILD_DIR/$SOURCEMAP_NAME"
139
199
 
@@ -304,7 +364,7 @@ fi
304
364
 
305
365
  # Execute posthog cli clone
306
366
  set +x +e
307
- CLI_CLONE_OUTPUT=$("$PH_CLI_PATH" hermes clone --minified-map-path "$SOURCEMAP_PACKAGER_FILE" --composed-map-path "$SOURCEMAP_FILE" "${CLI_RELEASE_ARGS[@]}" 2>&1)
367
+ CLI_CLONE_OUTPUT=$("$PH_CLI_PATH" hermes clone --minified-map-path "$SOURCEMAP_PACKAGER_FILE" --composed-map-path "$SOURCEMAP_FILE" "${CLI_RELEASE_ARGS[@]}" "${POSTHOG_RELEASE_MODE_ARGS[@]}" 2>&1)
308
368
  CLONE_EXIT_CODE=$?
309
369
  if [ $CLONE_EXIT_CODE -eq 0 ]; then
310
370
  echo "$CLI_CLONE_OUTPUT" | awk '{print "output: posthog-cli - " $0}'
@@ -316,7 +376,7 @@ set -x -e
316
376
 
317
377
  # Execute posthog cli upload
318
378
  set +x +e
319
- CLI_UPLOAD_OUTPUT=$("$PH_CLI_PATH" hermes upload --directory "$DERIVED_FILE_DIR" "${CLI_RELEASE_ARGS[@]}" "${POSTHOG_UPLOAD_ARGS[@]}" 2>&1)
379
+ CLI_UPLOAD_OUTPUT=$("$PH_CLI_PATH" hermes upload --directory "$DERIVED_FILE_DIR" "${CLI_RELEASE_ARGS[@]}" "${POSTHOG_UPLOAD_ARGS[@]}" "${POSTHOG_RELEASE_MODE_ARGS[@]}" 2>&1)
320
380
  UPLOAD_EXIT_CODE=$?
321
381
  if [ $UPLOAD_EXIT_CODE -eq 0 ]; then
322
382
  echo "$CLI_UPLOAD_OUTPUT" | awk '{print "output: posthog-cli - " $0}'
@@ -97,6 +97,20 @@ plugins.withId('com.android.application') {
97
97
  posthogUploadArgs.add("--skip-on-conflict")
98
98
  }
99
99
 
100
+ // How the release a build belongs to gets associated with the exceptions
101
+ // it reports. `symbol-set` (the default) stamps the release onto the
102
+ // uploaded source maps; `event` uploads them release-independent and lets
103
+ // each event resolve its own release from the $app_namespace /
104
+ // $app_version / $app_build the SDK already sends, which the release
105
+ // coordinates below are built from. Passed only outside the default mode,
106
+ // so a symbol-set build keeps working against a posthog-cli predating the
107
+ // flag.
108
+ def posthogReleaseMode = resolvePostHogReleaseMode(project)
109
+ def posthogReleaseModeArgs = []
110
+ if (posthogReleaseMode != null && posthogReleaseMode != "symbol-set") {
111
+ posthogReleaseModeArgs.addAll(["--release-mode", posthogReleaseMode])
112
+ }
113
+
100
114
  // posthog.dotenvFile (gradle.properties): dotenv file with POSTHOG_CLI_*
101
115
  // credentials, relative paths resolved against the android root project.
102
116
  // Exported to the CLI as POSTHOG_CLI_DOTENV_FILE (posthog-cli >= 0.8.4;
@@ -128,12 +142,22 @@ plugins.withId('com.android.application') {
128
142
 
129
143
  doFirst {
130
144
  def cliPackage = PostHogCli.resolveCliPackagePath(rootDirFile, reactRoot)
145
+ if (!posthogReleaseModeArgs.isEmpty() && System.getenv("POSTHOG_SKIP_CLI_VERSION_CHECK") != "1") {
146
+ def cliVersion = PostHogCli.resolveVersion([*osCompatibility, cliPackage])
147
+ if (cliVersion == null) {
148
+ throw new GradleException("Could not determine the posthog-cli version, which posthog.releaseMode '${posthogReleaseMode}' needs. Upgrade: npm install -g @posthog/cli@latest")
149
+ }
150
+ if (!PostHogCli.meetsMinimumVersion(cliVersion, PostHogCli.MIN_RELEASE_MODE_VERSION)) {
151
+ throw new GradleException("posthog.releaseMode '${posthogReleaseMode}' needs posthog-cli >= ${PostHogCli.MIN_RELEASE_MODE_VERSION} (found ${cliVersion}). Upgrade: npm install -g @posthog/cli@latest")
152
+ }
153
+ }
131
154
  def args = [cliPackage]
132
155
  args.addAll(["hermes", "clone",
133
156
  "--minified-map-path", packagerSourcemapOutput, // The path to a sourcemap
134
157
  "--composed-map-path", sourcemapOutput // The path of the composed source map
135
158
  ])
136
159
  args.addAll(extraArgs)
160
+ args.addAll(posthogReleaseModeArgs)
137
161
  logger.info("posthog-cli clone arguments: ${args}")
138
162
 
139
163
  injected.execOps.exec {
@@ -141,6 +165,13 @@ plugins.withId('com.android.application') {
141
165
  if (posthogDotenvFilePath != null) {
142
166
  environment "POSTHOG_CLI_DOTENV_FILE", posthogDotenvFilePath
143
167
  }
168
+ // posthog-cli reads POSTHOG_RELEASE_MODE itself when
169
+ // --release-mode is absent, which it deliberately is in symbol-set
170
+ // mode. Pin the resolved mode so a daemon that inherited the
171
+ // variable cannot override an explicit posthog.releaseMode.
172
+ if (posthogReleaseMode != null) {
173
+ environment "POSTHOG_RELEASE_MODE", posthogReleaseMode
174
+ }
144
175
  commandLine(*osCompatibility, *args)
145
176
  }
146
177
  }
@@ -153,6 +184,7 @@ plugins.withId('com.android.application') {
153
184
  ])
154
185
  args.addAll(extraArgs)
155
186
  args.addAll(posthogUploadArgs)
187
+ args.addAll(posthogReleaseModeArgs)
156
188
  logger.info("posthog-cli upload arguments: ${args}")
157
189
 
158
190
  injected.execOps.exec {
@@ -160,6 +192,9 @@ plugins.withId('com.android.application') {
160
192
  if (posthogDotenvFilePath != null) {
161
193
  environment "POSTHOG_CLI_DOTENV_FILE", posthogDotenvFilePath
162
194
  }
195
+ if (posthogReleaseMode != null) {
196
+ environment "POSTHOG_RELEASE_MODE", posthogReleaseMode
197
+ }
163
198
  commandLine(*osCompatibility, *args)
164
199
  }
165
200
  }
@@ -269,6 +304,48 @@ abstract class PostHogCli {
269
304
  logger.info("falling back to global posthog-cli")
270
305
  return "posthog-cli"
271
306
  }
307
+
308
+ /**
309
+ * The CLI is whatever the machine has, not a pinned version, so an older one rejects
310
+ * --release-mode with a bare argument-parser error. Mirrors the floor check in posthog-ios
311
+ * build-tools/upload-symbols.sh. POSTHOG_SKIP_CLI_VERSION_CHECK=1 allows a posthog-cli built
312
+ * from source, which reports its Cargo manifest version rather than the version it ships as.
313
+ * posthog-cli 0.16.0 added --release-mode to the hermes commands (PostHog/posthog#87660). Keep
314
+ * this in step with MIN_RELEASE_MODE_CLI_VERSION in posthog-xcode.sh.
315
+ */
316
+ static final String MIN_RELEASE_MODE_VERSION = "0.16.0"
317
+
318
+ /** Null when the version cannot be read. */
319
+ static String resolveVersion(List command) {
320
+ try {
321
+ def process = (command + ["--version"]).execute()
322
+ def stdout = new StringBuffer()
323
+ def stderr = new StringBuffer()
324
+ process.waitForProcessOutput(stdout, stderr)
325
+ if (process.exitValue() != 0) {
326
+ return null
327
+ }
328
+ return (stdout.toString() + stderr.toString()).find(/\d+(\.\d+)+/)
329
+ } catch (Throwable ignored) {
330
+ return null
331
+ }
332
+ }
333
+
334
+ /** Compares numeric fields left to right, so 0.9.0 stays below 0.16.0. */
335
+ static boolean meetsMinimumVersion(String found, String minimum) {
336
+ def fields = { String version -> version.tokenize(".").collect { (it.find(/^\d+/) ?: "0") as int } }
337
+ def a = fields(found)
338
+ def b = fields(minimum)
339
+ // Pad the shorter one so 0.16 and 0.16.0 compare equal.
340
+ while (a.size() < b.size()) a << 0
341
+ while (b.size() < a.size()) b << 0
342
+ for (int i = 0; i < a.size(); i++) {
343
+ if (a[i] != b[i]) {
344
+ return a[i] > b[i]
345
+ }
346
+ }
347
+ return true
348
+ }
272
349
  }
273
350
 
274
351
  def resolvePostHogReactNativeSDKPath(reactRoot) {
@@ -280,6 +357,29 @@ def resolvePostHogReactNativeSDKPath(reactRoot) {
280
357
  return packagePath
281
358
  }
282
359
 
360
+ /**
361
+ * Release mode for this build: the `posthog.releaseMode` gradle property, then the
362
+ * `POSTHOG_RELEASE_MODE` environment variable posthog-cli and the bundler plugins already read,
363
+ * then null for the posthog-cli default. `com.posthog.android` reads the same property for the R8
364
+ * mapping upload, so one entry covers both halves of an Android build.
365
+ *
366
+ * An unrecognized value fails the build rather than falling back, so a typo cannot silently leave
367
+ * a build binding its source maps to a release it meant to keep independent.
368
+ */
369
+ static String resolvePostHogReleaseMode(Project project) {
370
+ def value = project.findProperty("posthog.releaseMode")?.toString()?.trim()
371
+ if (!value) {
372
+ value = System.getenv("POSTHOG_RELEASE_MODE")?.trim()
373
+ }
374
+ if (!value) {
375
+ return null
376
+ }
377
+ if (!(value in ["symbol-set", "event"])) {
378
+ throw new GradleException("posthog.releaseMode must be one of symbol-set, event, was '${value}'")
379
+ }
380
+ return value
381
+ }
382
+
283
383
  /** Extract from arguments collection bundle and sourcemap files output names. */
284
384
  static extractBundleTaskArgumentsLegacy(cmdArgs, Project project) {
285
385
  def bundleOutput = null