Skip to content

Commit 2f5ea50

Browse files
committed
add docs per strategy
1 parent 40dbe8a commit 2f5ea50

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

sentry-kotlin-multiplatform-gradle-plugin/src/main/java/io/sentry/kotlin/multiplatform/gradle/FrameworkPathResolver.kt

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ sealed interface FrameworkResolutionStrategy {
5656
}
5757

5858
/**
59-
* Handles the custom framework paths set by the user. This should generally be executed first.
59+
* Finds the framework path based on the custom framework paths set by the user. This should generally be executed first.
6060
*/
6161
class CustomPathStrategy(
6262
private val project: Project,
@@ -90,6 +90,13 @@ class CustomPathStrategy(
9090
}
9191
}
9292

93+
/**
94+
* Finds framework paths based on the derived data path.
95+
*
96+
* This strategy prioritizes:
97+
* 1. A user-specified Xcode project path via [LinkerExtension].
98+
* 2. An auto-found Xcode project in the root directory. (mainly works for mono repo)
99+
*/
93100
class DerivedDataStrategy(
94101
private val project: Project,
95102
) : FrameworkResolutionStrategy {
@@ -98,9 +105,7 @@ class DerivedDataStrategy(
98105
override fun resolvePaths(architectures: Set<String>): FrameworkPaths {
99106
project.logger.lifecycle("Resolving Sentry Cocoa framework paths using derived data path")
100107

101-
// First priority: User-specified xcodeproj path
102108
val xcodeprojSetByUser = linker.xcodeprojPath.orNull?.takeIf { it.isNotEmpty() }
103-
// Second priority: Auto-discovered xcodeproj in project root
104109
val foundXcodeproj = xcodeprojSetByUser ?: findXcodeprojFile2(project.rootDir)?.absolutePath
105110

106111
val derivedDataPath = foundXcodeproj?.let { path ->
@@ -146,6 +151,16 @@ class DerivedDataStrategy(
146151
}
147152
}
148153

154+
/**
155+
* Performs a manual search for Sentry Cocoa frameworks using system tools.
156+
*
157+
* This strategy:
158+
* - Searches the DerivedData for valid framework paths
159+
* - Returns first validated paths found for either static or dynamic frameworks
160+
*
161+
* If multiple paths were found for a single framework type, the most recently used is chosen.
162+
* See [ManualFrameworkPathSearchValueSource] for details.
163+
*/
149164
class ManualSearchStrategy(
150165
private val project: Project,
151166
) : FrameworkResolutionStrategy {
@@ -223,5 +238,4 @@ class FrameworkPathResolver(
223238
)
224239
}
225240
}
226-
227241
}

0 commit comments

Comments
 (0)