diff --git a/.vscode/launch.json b/.vscode/launch.json index 5ff010415..189a01ba2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,7 @@ "name": "Launch", "type": "mono", "request": "launch", - "program": "${workspaceRoot}packages/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe ${workspaceRoot}bin/TestDebug/Xamarin.Android.Build.Tests.dll", + "program": "${workspaceRoot}packages/nunit.consolerunner/3.9.0/tools/nunit3-console.exe ${workspaceRoot}bin/TestDebug/Xamarin.Android.Build.Tests.dll", "cwd": "${workspaceRoot}bin/TestDebug/" }, { diff --git a/.vscode/settings.json b/.vscode/settings.json index 65cbacf6f..157e2faf4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "nxunitExplorer.nunit": "packages/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe", + "nxunitExplorer.nunit": "packages/nunit.consolerunner/3.9.0/tools/nunit3-console.exe", "nxunitExplorer.modules": [ "bin/TestDebug/MSBuildDeviceIntegration/MSBuildDeviceIntegration.dll", "bin/TestDebug/Xamarin.Android.Build.Tests.dll", diff --git a/Configuration.props b/Configuration.props index 746e9eb40..967a3464a 100644 --- a/Configuration.props +++ b/Configuration.props @@ -182,7 +182,7 @@ <_Runtime Condition=" '$(HostOS)' != 'Windows' ">$(ManagedRuntime) $(ManagedRuntimeArgs) - <_NUnit>$(_Runtime) packages\NUnit.ConsoleRunner.3.9.0\tools\nunit3-console.exe + <_NUnit>$(_Runtime) packages\nunit.consolerunner\3.9.0\tools\nunit3-console.exe diff --git a/NuGet.config b/NuGet.config index b82b970d2..e35b0ced4 100644 --- a/NuGet.config +++ b/NuGet.config @@ -7,4 +7,7 @@ - \ No newline at end of file + + + + diff --git a/build-tools/automation/yaml-templates/run-nunit-tests.yaml b/build-tools/automation/yaml-templates/run-nunit-tests.yaml index 96e65d9ff..67aca76f6 100644 --- a/build-tools/automation/yaml-templates/run-nunit-tests.yaml +++ b/build-tools/automation/yaml-templates/run-nunit-tests.yaml @@ -1,5 +1,5 @@ parameters: - nunitConsole: packages/NUnit.ConsoleRunner.$(NUnitConsoleVersion)/tools/nunit3-console.exe + nunitConsole: $(System.DefaultWorkingDirectory)/packages/nunit.consolerunner/$(NUnitConsoleVersion)/tools/nunit3-console.exe testRunTitle: Xamarin Android Tests testAssembly: [] testResultsFile: TestResult.xml diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index 96f513588..aa14493f2 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -38,15 +38,20 @@ steps: versionSpec: 5.x - task: NuGetCommand@2 - displayName: nuget restore Xamarin.Android solutions + displayName: nuget restore Xamarin.Android.Build.Tasks.sln inputs: - restoreSolution: '**/Xamarin.Android*.sln' - feedsToUse: config - nugetConfigPath: NuGet.config + command: custom + arguments: restore Xamarin.Android.Build.Tasks.sln -ConfigFile NuGet.config + +- task: NuGetCommand@2 + displayName: nuget restore Xamarin.Android-Tests.sln + inputs: + command: custom + arguments: restore Xamarin.Android-Tests.sln -ConfigFile NuGet.config - task: MSBuild@1 displayName: build Xamarin.Android.Tools.BootstrapTasks.csproj inputs: solution: build-tools/xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj configuration: ${{ parameters.configuration }} - msbuildArguments: /bl:$(System.DefaultWorkingDirectory)/bin/Test${{ parameters.configuration }}/BootstrapTasks.binlog + msbuildArguments: /restore /bl:$(System.DefaultWorkingDirectory)/bin/Test${{ parameters.configuration }}/BootstrapTasks.binlog diff --git a/build-tools/xaprepare/xaprepare/OperatingSystems/Windows.cs b/build-tools/xaprepare/xaprepare/OperatingSystems/Windows.cs index fa62dfdf4..a85fe6233 100644 --- a/build-tools/xaprepare/xaprepare/OperatingSystems/Windows.cs +++ b/build-tools/xaprepare/xaprepare/OperatingSystems/Windows.cs @@ -58,7 +58,7 @@ namespace Xamarin.Android.Prepare return base.Which (programPath, required); } - string packagePath = Path.Combine (homeDir, ".nuget", "packages", "7-zip.commandline", "18.1.0", "tools"); + string packagePath = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "packages", "7-zip.commandline", "18.1.0", "tools"); if (Is64Bit) packagePath = Path.Combine (packagePath, "x64"); return Path.Combine (packagePath, "7za.exe"); diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/LibZipSharp.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/LibZipSharp.cs index ce0e8676e..2d319f50c 100644 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/LibZipSharp.cs +++ b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/LibZipSharp.cs @@ -9,8 +9,8 @@ namespace Xamarin.Android.Prepare { static readonly Uri url = new Uri ("https://github.com/xamarin/LibZipSharp/"); internal static readonly string LibZipSharpVersion = "1.0.6"; - static readonly string licenseFile = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.UserProfile), - ".nuget", "packages", "xamarin.libzipsharp", LibZipSharpVersion, + static readonly string licenseFile = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, + "packages", "xamarin.libzipsharp", LibZipSharpVersion, "Licences", "LICENSE"); public override string LicenseFile => licenseFile; diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/libzip.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/libzip.cs index 046456804..0df5bf85e 100644 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/libzip.cs +++ b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/libzip.cs @@ -8,8 +8,8 @@ namespace Xamarin.Android.Prepare class libzip_nih_at_libzip_TPN : ThirdPartyNotice { static readonly Uri url = new Uri ("https://github.com/nih-at/libzip/"); - static readonly string licenseFile = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.UserProfile), - ".nuget", "packages", "xamarin.libzipsharp", LibZipSharp_grendello_LibZipSharp_TPN.LibZipSharpVersion, + static readonly string licenseFile = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, + "packages", "xamarin.libzipsharp", LibZipSharp_grendello_LibZipSharp_TPN.LibZipSharpVersion, "Licences", "libzip", "LICENSE"); public override string LicenseFile => licenseFile; diff --git a/src/Mono.Android/Mono.Android.targets b/src/Mono.Android/Mono.Android.targets index c3cca5f36..e0718d0e1 100644 --- a/src/Mono.Android/Mono.Android.targets +++ b/src/Mono.Android/Mono.Android.targets @@ -173,7 +173,7 @@ Inputs="$(TargetPath);@(ApiCompatibilityFiles)" Outputs="$(IntermediateOutputPath)CheckApiCompatibility.stamp"> Packages { get; private set; } public IList References { get; private set; } public IList PackageReferences { get; private set; } - public string GlobalPackagesFolder { get; set; } + public string GlobalPackagesFolder { get; set; } = Path.Combine (XABuildPaths.TopDirectory, "packages"); public IList ExtraNuGetConfigSources { get; set; } public virtual bool ShouldRestorePackageReferences => PackageReferences?.Count > 0; diff --git a/tests/CodeBehind/UnitTests/run.sh b/tests/CodeBehind/UnitTests/run.sh index 91cec5f8e..8ef4d2479 100755 --- a/tests/CodeBehind/UnitTests/run.sh +++ b/tests/CodeBehind/UnitTests/run.sh @@ -4,4 +4,4 @@ export USE_MSBUILD=1 export MSBUILD=msbuild msbuild CodeBehindUnitTests.csproj cd ../../../ -exec mono --debug packages/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe bin/TestDebug/CodeBehind/CodeBehindUnitTests.dll +exec mono --debug packages/nunit.consolerunner/3.9.0/tools/nunit3-console.exe bin/TestDebug/CodeBehind/CodeBehindUnitTests.dll diff --git a/tests/EmbeddedDSOs/EmbeddedDSO-UnitTests/run.sh b/tests/EmbeddedDSOs/EmbeddedDSO-UnitTests/run.sh index 89cf409dd..e6d419a0f 100755 --- a/tests/EmbeddedDSOs/EmbeddedDSO-UnitTests/run.sh +++ b/tests/EmbeddedDSOs/EmbeddedDSO-UnitTests/run.sh @@ -5,4 +5,4 @@ export MSBUILD=msbuild CONFIGURATION=${1:-Debug} msbuild /p:Configuration=${CONFIGURATION} EmbeddedDSO-UnitTests.csproj cd ../../../ -exec mono --debug packages/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe bin/Test${CONFIGURATION}/EmbeddedDSOUnitTests.dll +exec mono --debug packages/nunit.consolerunner/3.9.0/tools/nunit3-console.exe bin/Test${CONFIGURATION}/EmbeddedDSOUnitTests.dll