|
1 | 1 | <Project> |
| 2 | + |
2 | 3 | <PropertyGroup> |
3 | 4 | <Version>0.0.9</Version> |
4 | 5 | <LangVersion>9</LangVersion> |
|
9 | 10 | <PackageFolderName>package-dev</PackageFolderName> |
10 | 11 | <PackageRuntimePath>../../$(PackageFolderName)/Runtime</PackageRuntimePath> |
11 | 12 | <PackageEditorPath>../../$(PackageFolderName)/Editor</PackageEditorPath> |
| 13 | + <!-- warning NU1701: Package 'NUnit 3.5.0' was restored using '.NETFramework,Version=v4.6.1 --> |
| 14 | + <NoWarn>$(NoWarn);NU1701</NoWarn> |
12 | 15 | </PropertyGroup> |
| 16 | + |
13 | 17 | <ItemGroup> |
14 | 18 | <PackageReference Include="Roslynator.Analyzers" Version="3.0.0" PrivateAssets="All" /> |
15 | 19 | <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" /> |
16 | 20 | <PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.0" PrivateAssets="All" /> |
17 | 21 | <PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="All" /> |
18 | 22 | </ItemGroup> |
19 | | - <PropertyGroup> |
20 | | - <UnityPath Condition="Exists('C:\Program Files\Unity\Hub\Editor\$(UnityVersion)\Editor\Data\Managed\UnityEngine.dll')">C:\Program Files\Unity\Hub\Editor\$(UnityVersion)\Editor\Data\Managed</UnityPath> |
21 | | - <UnityPath Condition="$(UnityPath) == '' AND Exists('/Applications/Unity/Hub/Editor/$(UnityVersion)/Unity.app/Contents/Managed/UnityEngine.dll')">/Applications/Unity/Hub/Editor/$(UnityVersion)/Unity.app/Contents/Managed/</UnityPath> |
| 23 | + |
| 24 | + <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))"> |
| 25 | + <UnityRoot Condition="Exists('C:\Program Files\Unity\Hub\Editor\$(UnityVersion)\Editor\Data\Managed\UnityEngine.dll')">C:\Program Files\Unity\Hub\Editor\$(UnityVersion)\Editor</UnityRoot> |
| 26 | + <!--If not using Unity Hub, tries to pick whatever Unity version is installed on the machine--> |
| 27 | + <UnityRoot Condition="$(UnityRoot) == '' AND Exists('C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll')">C:\Program Files\Unity\Editor</UnityRoot> |
| 28 | + <UnityManagedPath>$(UnityRoot)\Data\Managed</UnityManagedPath> |
| 29 | + <UnityExec>$(UnityRoot)\Unity.exe</UnityExec> |
| 30 | + <StandalonePlayerName>buildWindows64Player</StandalonePlayerName> |
| 31 | + <ArtifactName>game.exe</ArtifactName> |
| 32 | + </PropertyGroup> |
| 33 | + |
| 34 | + <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))"> |
| 35 | + <UnityRoot Condition="Exists('/Applications/Unity/Hub/Editor/$(UnityVersion)/Unity.app/Contents/Managed/UnityEngine.dll')">/Applications/Unity/Hub/Editor/$(UnityVersion)/Unity.app/</UnityRoot> |
22 | 36 | <!--If not using Unity Hub, tries to pick whatever Unity version is installed on the machine--> |
23 | | - <UnityPath Condition="$(UnityPath) == '' AND Exists('C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll')">C:\Program Files\Unity\Editor\Data\Managed</UnityPath> |
24 | | - <UnityPath Condition="$(UnityPath) == '' AND Exists('/Applications/Unity/Unity.app/Contents/Managed/UnityEngine.dll')">/Applications/Unity/Unity.app/Contents/Managed</UnityPath> |
| 37 | + <UnityRoot Condition="$(UnityRoot) == '' AND Exists('/Applications/Unity/Unity.app/Contents/Managed/UnityEngine.dll')">/Applications/Unity/Unity.app/</UnityRoot> |
| 38 | + <UnityManagedPath>$(UnityRoot)/Contents/Managed</UnityManagedPath> |
| 39 | + <UnityExec>$(UnityRoot)/Contents/MacOS/Unity</UnityExec> |
| 40 | + <StandalonePlayerName>buildMacOS64Player</StandalonePlayerName> |
| 41 | + <ArtifactName>game</ArtifactName> |
25 | 42 | </PropertyGroup> |
| 43 | + |
| 44 | + <!-- If Unity Libraries don't exist, run a Unity build --> |
| 45 | + <Target Name="BuildUnityProject" |
| 46 | + Condition="'$(MSBuildProjectName)' == 'Sentry.Unity' and !Exists('$(MSBuildProjectDirectory)/../../samples/unity-of-bugs/Library')" |
| 47 | + BeforeTargets="BeforeBuild"> |
| 48 | + <Error Condition="$(UnityRoot) == ''" Text="Couldn't find Unity."></Error> |
| 49 | + |
| 50 | + <!-- Even with a successful build, Unity will error on 'usbmuxd' or log out to std-error which breaks msbuild. |
| 51 | + We need to run a unity build to restore the test packages and for that reason we'll ignore errors here and assume a later step will validation the build is actually working: |
| 52 | + The offending error: |
| 53 | + [usbmuxd] Stop listen thread |
| 54 | + [usbmuxd] Error: |
| 55 | + [usbmuxd] Listen thread exitingit -batchmode -nographics -logFile - -projectPath $(MSBuildProjectDirectory)/../../samples/unity-of-bugs -$(StandalonePlayerName) $(ArtifactName) |
| 56 | + Related: https://forum.unity.com/threads/6572-debugger-agent-unable-to-listen-on-27.500387/ --> |
| 57 | + <Exec Command="$(UnityExec) -quit -batchmode -nographics -logFile - -projectPath $(MSBuildProjectDirectory)/../../samples/unity-of-bugs -$(StandalonePlayerName) $(ArtifactName) " |
| 58 | + IgnoreStandardErrorWarningFormat="true" |
| 59 | + IgnoreExitCode="true"></Exec> |
| 60 | + </Target> |
| 61 | + |
26 | 62 | </Project> |
0 commit comments