|
10 | 10 | <UnitySampleProjectUnityVersion>$(SolutionDir)samples/unity-of-bugs/ProjectSettings/ProjectVersion.txt</UnitySampleProjectUnityVersion>
|
11 | 11 | <UnityTestPlayModeResultFilePath>../../artifacts/test/playmode/results.xml</UnityTestPlayModeResultFilePath>
|
12 | 12 | <UnityTestEditModeResultFilePath>../../artifacts/test/editmode/results.xml</UnityTestEditModeResultFilePath>
|
13 |
| - <!-- Cocoa--> |
14 |
| - <CocoaRoot>$(SolutionDir)src/sentry-cocoa/</CocoaRoot> |
15 |
| - <CocoaFrameworkDestination>$(SolutionDir)package-dev/Plugins/iOS/Sentry.framework/</CocoaFrameworkDestination> |
| 13 | + <!-- Cocoa --> |
| 14 | + <SentryCocoaRoot>$(SolutionDir)src/sentry-cocoa/</SentryCocoaRoot> |
| 15 | + <SentryCocoaArtifactsDestination>$(SolutionDir)package-dev/Plugins/iOS/Sentry.framework/</SentryCocoaArtifactsDestination> |
| 16 | + <!-- Android --> |
| 17 | + <SentryAndroidRoot>$(SolutionDir)src/sentry-java/</SentryAndroidRoot> |
| 18 | + <SentryAndroidArtifactsDestination>$(SolutionDir)package-dev/Plugins/Android/Sentry/</SentryAndroidArtifactsDestination> |
16 | 19 | </PropertyGroup>
|
17 | 20 |
|
18 | 21 | <!-- Use the Unity Editor version set in the sample project of the repo -->
|
|
56 | 59 | <RemoveDir Directories="$(UnityPackageProject)" />
|
57 | 60 | </Target>
|
58 | 61 |
|
59 |
| - <Target Name="CleanCocoaSDK" AfterTargets="Clean" Condition="Exists('$(CocoaFrameworkDestination)')"> |
60 |
| - <RemoveDir Directories="$(CocoaFrameworkPath)Sentry.framework" /> |
| 62 | + <Target Name="CleanCocoaSDK" AfterTargets="Clean" Condition="Exists('$(SentryCocoaArtifactsDestination)')"> |
| 63 | + <RemoveDir Directories="$(SentryCocoaArtifactsDestination)" ContinueOnError="true" /> |
| 64 | + </Target> |
| 65 | + |
| 66 | + <Target Name="CleanAndroidSDK" AfterTargets="Clean" Condition="Exists('$(SentryAndroidArtifactsDestination)')"> |
| 67 | + <RemoveDir Directories="$(SentryAndroidArtifactsDestination)" ContinueOnError="true" /> |
61 | 68 | </Target>
|
62 | 69 |
|
63 | 70 | <!-- Build the iOS SDK: dotnet msbuild /t:BuildCocoaSDK -->
|
64 | 71 | <Target Name="BuildCocoaSDK"
|
65 | 72 | Condition="$([MSBuild]::IsOSPlatform('OSX'))
|
66 | 73 | And '$(MSBuildProjectName)' == 'Sentry.Unity'
|
67 |
| - And !Exists('$(CocoaFrameworkDestination)')" |
| 74 | + And !Exists('$(SentryCocoaArtifactsDestination)')" |
68 | 75 | BeforeTargets="BeforeBuild">
|
69 |
| - <Error Condition="!Exists('$(CocoaRoot)')" Text="Couldn't find the Cocoa root at $(CocoaRoot)."></Error> |
| 76 | + <Error Condition="!Exists('$(SentryCocoaRoot)')" Text="Couldn't find the Cocoa root at $(SentryCocoaRoot)."></Error> |
| 77 | + <Message Importance="High" Text="Building Sentry iOS SDK."></Message> |
70 | 78 |
|
71 |
| - <Exec WorkingDirectory="$(CocoaRoot)" Command="carthage build --use-xcframeworks --no-skip-current --platform iOS"></Exec> |
| 79 | + <Exec WorkingDirectory="$(SentryCocoaRoot)" Command="carthage build --use-xcframeworks --no-skip-current --platform iOS"></Exec> |
72 | 80 |
|
73 | 81 | <!-- Itemgroup for the output Sentry.framework so we have access to '%(RecursiveDir)' when copying -->
|
74 | 82 | <ItemGroup>
|
75 |
| - <CocoaBuildPath Include="$(CocoaRoot)Carthage/Build/Sentry.xcframework/ios-arm64_armv7/Sentry.framework/**/*" /> |
| 83 | + <CocoaBuildPath Include="$(SentryCocoaRoot)Carthage/Build/Sentry.xcframework/ios-arm64_armv7/Sentry.framework/**/*" /> |
76 | 84 | </ItemGroup>
|
77 | 85 | <Copy SourceFiles="@(CocoaBuildPath)"
|
78 |
| - DestinationFiles="@(CocoaBuildPath->'$(CocoaFrameworkDestination)%(RecursiveDir)%(Filename)%(Extension)')"> |
| 86 | + DestinationFiles="@(CocoaBuildPath->'$(SentryCocoaArtifactsDestination)%(RecursiveDir)%(Filename)%(Extension)')"> |
| 87 | + </Copy> |
| 88 | + |
| 89 | + <Error Condition="!Exists('$(SentryCocoaArtifactsDestination)')" Text="Failed to build the Cocoa SDK."></Error> |
| 90 | + </Target> |
| 91 | + |
| 92 | + <!-- Build the Android SDK: dotnet msbuild /t:BuildAndroidSDK --> |
| 93 | + <Target Name="BuildAndroidSDK" |
| 94 | + Condition="'$(MSBuildProjectName)' == 'Sentry.Unity' |
| 95 | + And !Exists('$(SentryAndroidArtifactsDestination)')" |
| 96 | + BeforeTargets="BeforeBuild"> |
| 97 | + <Error Condition="!Exists('$(SentryAndroidRoot)')" Text="Couldn't find the Android root at $(SentryAndroidRoot)."></Error> |
| 98 | + <Message Importance="High" Text="Building Sentry Android SDK."></Message> |
| 99 | + |
| 100 | + <Exec WorkingDirectory="$(SentryAndroidRoot)" Command="./gradlew :sentry-android-core:assembleRelease :sentry-android-ndk:assembleRelease :sentry:jar"></Exec> |
| 101 | + |
| 102 | + <ItemGroup> |
| 103 | + <!-- building snapshot based on version, i.e: sentry-5.0.0-beta.3-SNAPSHOT.jar --> |
| 104 | + <AndroidSdkArtifacts Include="$(SentryAndroidRoot)sentry/build/libs/sentry*.jar" /> |
| 105 | + <AndroidSdkArtifacts Include="$(SentryAndroidRoot)sentry-android-ndk/build/outputs/aar/sentry-android-ndk-release.aar" /> |
| 106 | + <AndroidSdkArtifacts Include="$(SentryAndroidRoot)sentry-android-core/build/outputs/aar/sentry-android-core-release.aar" /> |
| 107 | + <AndroidSdkArtifacts Include="$(SolutionDir)lib/gson-2.8.5.jar" /> |
| 108 | + </ItemGroup> |
| 109 | + |
| 110 | + <Copy SourceFiles="@(AndroidSdkArtifacts)" |
| 111 | + DestinationFiles="@(AndroidSdkArtifacts->'$(SentryAndroidArtifactsDestination)%(RecursiveDir)%(Filename)%(Extension)')"> |
79 | 112 | </Copy>
|
80 | 113 |
|
81 |
| - <Error Condition="!Exists('$(CocoaFrameworkDestination)')" Text="Failed to build the Cocoa SDK."></Error> |
| 114 | + <Error Condition="!Exists('$(SentryAndroidArtifactsDestination)')" Text="Failed to build the Android SDK."></Error> |
82 | 115 | </Target>
|
83 | 116 |
|
84 | 117 | <!-- Even with a successful build, Unity will error on 'usbmuxd' or log out to std-error which breaks msbuild.
|
|
0 commit comments