From 2534b96547ed2fad64ad7deea7a125590b521a9e Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Mon, 9 Oct 2023 16:03:40 -0400 Subject: [PATCH 1/2] [build] Update docs and remove `xabuild` mentions Removes mentions and references to `xabuild` as it is not used as part of .NET Android. --- .vscode/tasks.json | 24 --- Documentation/README.md | 2 - Documentation/building/unix/instructions.md | 22 +- .../building/windows/instructions.md | 21 +- .../project-docs/ExploringSources.md | 2 - Documentation/workflow/OSSBuildArtifacts.md | 188 ------------------ Documentation/workflow/UsingYourBuild.md | 79 -------- Makefile | 33 --- .../yaml-templates/kill-processes.yaml | 2 +- build-tools/scripts/BuildEverything.mk | 1 - build-tools/scripts/Packaging.mk | 73 ------- build-tools/scripts/XABuildConfig.cs.in | 30 --- build-tools/scripts/XABuildPaths.cs.in | 17 -- .../Step_DetermineAzurePipelinesTestJobs.cs | 5 - .../Xamarin.ProjectTools/Common/Builder.cs | 20 +- .../Xamarin.ProjectTools/XABuildPaths.cs | 2 - .../Xamarin.Android.Build.Tasks.targets | 22 -- .../run-perf-test.sh | 178 ----------------- tools/xabuild/xabuild.csproj | 4 - 19 files changed, 8 insertions(+), 717 deletions(-) delete mode 100644 Documentation/workflow/OSSBuildArtifacts.md delete mode 100644 Documentation/workflow/UsingYourBuild.md delete mode 100644 build-tools/scripts/XABuildConfig.cs.in delete mode 100644 build-tools/scripts/XABuildPaths.cs.in delete mode 100755 tests/Xamarin.Forms-Performance-Integration/run-perf-test.sh diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 451e38fccbe..e79dfcacc8d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -109,30 +109,6 @@ "$msCompile" ] }, - { - "label": "build-sample", - "type": "shell", - "command": "bin/${input:configuration}/bin/xabuild ${input:project} /t:${input:target} /p:Configuration=${input:configuration}", - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": [ - "$msCompile" - ] - }, - { - "label": "run-sample", - "type": "shell", - "command": "bin/${input:configuration}/bin/xabuild ${input:project} /restore \"/t:Install;_Run\" /p:AndroidAttachDebugger=${input:attach} /p:Configuration=${input:configuration}", - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": [ - "$msCompile" - ] - }, { "label": "prepare-sample-under-dotnet", "type": "shell", diff --git a/Documentation/README.md b/Documentation/README.md index 1d5c4a402ec..65dc258de6e 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -38,8 +38,6 @@ # Development Workflow * [How to add support for a new Android API level](workflow/HowToAddNewApiLevel.md) - * [Using Your Build](workflow/UsingYourBuild.md) - * [OSS Build Artifacts](workflow/OSSBuildArtifacts.md) * [Development tips and native debugging](workflow/DevelopmentTips.md) * [Localization](workflow/Localization.md) * [Custom system properties](workflow/SystemProperties.md) diff --git a/Documentation/building/unix/instructions.md b/Documentation/building/unix/instructions.md index cea4a849c4b..ceebd59daf8 100644 --- a/Documentation/building/unix/instructions.md +++ b/Documentation/building/unix/instructions.md @@ -111,13 +111,6 @@ Several `.nupkg` files will be output in `./bin/Build$(Configuration)/nuget-unsi Commercial installers will be created by this command if the `make prepare-external-git-dependencies` command was ran before building. -# Building Unit Tests - -Once `make all` or `make jenkins` have completed, the unit tests may -be built with: - - make all-tests - # Running Unit Tests @@ -199,13 +192,6 @@ All `.apk`-based unit test projects provide the following targets: To run an individual `.apk`-based test project, a package must be built, using the `SignAndroidPackage` target, installed, and executed. -For example: - - $ bin/Debug/bin/xabuild /t:SignAndroidPackage tests/locales/Xamarin.Android.Locale-Tests/Xamarin.Android.Locale-Tests.csproj - $ bin/Debug/bin/xabuild /t:DeployTestApks tests/locales/Xamarin.Android.Locale-Tests/Xamarin.Android.Locale-Tests.csproj - $ bin/Debug/bin/xabuild /t:RunTestApks tests/locales/Xamarin.Android.Locale-Tests/Xamarin.Android.Locale-Tests.csproj - - ## Running `.apk` Projects with Include/Exclude If an `.apk`-based unit test uses the NUnit `[Category]` custom attribute, then @@ -227,11 +213,7 @@ A single NUnit *Test Fixture* -- a class with the `[TestFixture]` custom attribute -- may be executed instead of executing *all* test fixtures. The `RunTestApks` target accepts a `TestFixture` MSBuild property -to specify the test fixture class to execute: - - $ bin/Debug/bin/xabuild /t:RunTestApks \ - /p:TestFixture=Xamarin.Android.LocaleTests.SatelliteAssemblyTests \ - tests/locales/Xamarin.Android.Locale-Tests/Xamarin.Android.Locale-Tests.csproj +to specify the test fixture class to execute. If using `Xamarin.Android.NUnitLite` for projects outside the `xamarin-android` repository, such as NUnit tests for a custom app, the `RunTestApks` target @@ -360,7 +342,7 @@ where the "relevant directory" is the target of interest within `src/mono-runtimes/obj/$(Configuration)`. When `make` has completed, invoke the `_InstallRuntimes` target so that the updated native libraries are copied into `bin/$(Configuration)/lib`, which will allow subsequent -top-level `make` and [`xabuild`](../../../tools/xabuild) invocations to use them. +top-level `make` invocations to use them. For example, to rebuild Mono for armeabi-v7a: diff --git a/Documentation/building/windows/instructions.md b/Documentation/building/windows/instructions.md index eb34a08c4ca..04d146ac2fa 100644 --- a/Documentation/building/windows/instructions.md +++ b/Documentation/building/windows/instructions.md @@ -39,17 +39,9 @@ MSBuild version 15 or later is required. This will clone and build external proprietary components such as `monodroid`. -After the solution has built successfully, you can [use your -build][using-your-build] to build Xamarin.Android application and library -projects. Note that by default `Xamarin.Android.sln` only builds support for -the `$(TargetFrameworkVersion)` specified in the `$(AndroidFrameworkVersion)` -property of the [`Configuration.props`][configprops-main] file (`v12.0` when -this guide was last updated), so you will need to ensure that your application -and library projects are configured to use that particular target framework -version. +After the solution has built successfully, you can use `dotnet-local.cmd` to create and build Android projects. [developer-prompt]: https://docs.microsoft.com/dotnet/framework/tools/developer-command-prompt-for-vs -[using-your-build]: https://github.com/xamarin/xamarin-android/blob/main/Documentation/workflow/UsingYourBuild.md [configprops-main]: https://github.com/xamarin/xamarin-android/blob/main/Configuration.props ## Windows Build Notes @@ -141,10 +133,10 @@ command was ran before building. # Building Unit Tests -Once `msbuild Xamarin.Android.sln` has completed, the unit tests may +Once `dotnet msbuild Xamarin.Android.sln` has completed, the unit tests may be built with e.g.: - bin\Debug\bin\xabuild.exe Xamarin.Android-Tests.sln /restore /p:Configuration=Debug /bl:bin\TestDebug\msbuild-build-tests.binlog + dotnet-local.cmd build Xamarin.Android-Tests.sln /restore /p:Configuration=Debug /bl:bin\TestDebug\msbuild-build-tests.binlog Note that the `Debug` in `bin\Debug` must match the Configuration which was built. If xamarin-android was built with `msbuild /p:Configuration=Release ...`, @@ -193,13 +185,6 @@ All `.apk`-based unit test projects provide the following targets: To run an individual `.apk`-based test project, a package must be built, using the `SignAndroidPackage` target, installed, and executed. -For example: - - $ bin/Debug/bin/xabuild /t:SignAndroidPackage tests/locales/Xamarin.Android.Locale-Tests/Xamarin.Android.Locale-Tests.csproj - $ bin/Debug/bin/xabuild /t:DeployTestApks tests/locales/Xamarin.Android.Locale-Tests/Xamarin.Android.Locale-Tests.csproj - $ bin/Debug/bin/xabuild /t:RunTestApks tests/locales/Xamarin.Android.Locale-Tests/Xamarin.Android.Locale-Tests.csproj - - ## Running `.apk` Projects with Include/Exclude If an `.apk`-based unit test uses the NUnit `[Category]` custom attribute, then diff --git a/Documentation/project-docs/ExploringSources.md b/Documentation/project-docs/ExploringSources.md index 87f24d3dc6c..85c8be77959 100644 --- a/Documentation/project-docs/ExploringSources.md +++ b/Documentation/project-docs/ExploringSources.md @@ -47,8 +47,6 @@ is used within many of the output directories which are created. * `Xamarin.Android.Tools.BootstrapTasks`: supplemental build tasks used by some build-tools. (This should be in `build-tools`; oops.) * `tools`: Utilities which are built into `bin/$(Configuration)`. - * `xabuild`: MSBuild "wrapper" to easily build Xamarin.Android projects without - requiring system-wide installation of Xamarin.Android diff --git a/Documentation/workflow/OSSBuildArtifacts.md b/Documentation/workflow/OSSBuildArtifacts.md deleted file mode 100644 index 5e079385f45..00000000000 --- a/Documentation/workflow/OSSBuildArtifacts.md +++ /dev/null @@ -1,188 +0,0 @@ -# Open Source Build Artifacts - -The [**Xamarin.Android-OSS** Azure Pipeline][xa-oss-pipeline] contains a list of all -recent builds. To view Open Source software (OSS) artifacts for a specific build: - - 1) Click on the build `Run` that you are interested in. - 2) At the top of the `Summary` tab in the `Related` section, there should be a link titled `'x' published`. - 3) Click on the `'x' published` link. - 4) Scroll over any relevant artifacts with the `Installers -` prefix, and an ellipses should appear on the right side of the artifact with a download option. - -[xa-oss-pipeline]: https://dev.azure.com/xamarin/public/_build?definitionId=48&_a=summary - -The Open Source software (OSS) build artifacts do *not* include Android SDK or NDK bits, -while requiring that parts of the Android SDK be installed to work. -Please see the [Android SDK Setup](#Android_SDK_Setup) section for instructions -on setting up the Android NDK & SDK if an Android SDK is not already setup. - -# Installing Build Artifacts - -The OSS pipeline should contain OSS installer packages for Linux, macOS, and Windows. - -## Linux (Debian) Installation - -Download the `xamarin.android-oss*.deb` package and double click to install. - -## macOS Installation - -Download the `Xamarin.Android.Sdk-OSS*.pkg` package and double click to install. - -## Windows Installation - -The `Xamarin.Android.Sdk-OSS*.vsix` file can be installed into -Visual Studio 2019. This requires that the **Mobile development with .NET** -workload be previously installed within Visual Studio 2019. - -Installing the `Xamarin.Android.Sdk-OSS*.vsix` file is easy: -double-click the file within Windows Explorer, and complete the -VSIX Installer window. - -The problem is *uninstalling* the `Xamarin.Android.Sdk-OSS.vsix` file, in order -to use the *stable*/commercial version of Xamarin.Android, if desired. The -OSS `.vsix` file is [*Experimental*][vsix-schema], which -complicates the uninstallation process. - -[vsix-schema]: https://msdn.microsoft.com/en-us/library/hh696828.aspx - -When using Visual Studio 15.3 or later, search for `Xamarin.Android` within -the Visual Studio Extension Manager, and then click the **Revert** button -to uninstall the `Xamarn.Android.Sdk-OSS` package and revert to the previously -installed and stable commercial Xamarin.Android version. - -![VS Extensions Window](../images/VS-Extensions-Revert.png) - -Visual Studio 15.2 and earlier do not have a **Revert** button. The only way to -return to a stable Xamarin.Android version is to uninstall and reinstall the -**Mobile development with .NET** component from within the Visual Studio Installer. - -For simplicity, we suggest installing *multiple* Visual Studio 2019 products, -e.g. both Visual Studio Community and Visual Studio Professional, and -designating one of them for "stable" use and one for OSS use as needed. - -Once the `Xamarin.Android.Sdk-OSS*.vsix` file has been downloaded, you can -double-click the file, and within the **VSIX Installer** window you can select -which products the Xamarin.Android SDK should be installed into: - -![VSIX Installer Window](../images/VSIX-Installer.png) - -Once you've selected the desired Visual Studio products, click the **Install** -button to install the Xamarin.Android SDK extension into Visual Studio 2019. - -# Using OSS Build Artifacts - -OSS artifacts can be used in the same way commercial artifacts are used, from within -Visual Studio, Visual Studio for Mac, or command line. Do note however that there are -various limitations with debugging and debug deployment options when using OSS artifacts. - -## Command-line use: Linux and macOS - -Within the `oss-xamarin.android*.zip` extracted contents is a -`oss-xamarin.android*/bin/Debug/bin/xabuild` script. - -`xabuild` requires that the `$ANDROID_SDK_PATH` and `$ANDROID_NDK_PATH` -environment variables be set to the location of the Android SDK and -Android NDK directories, respectively. - -If you have a xamarin-android build environment, then -`$HOME/android-toolchain` will contain an Android SDK and NDK: - - export ANDROID_SDK_PATH=$HOME/android-toolchain/sdk - export ANDROID_NDK_PATH=$HOME/android-toolchain/ndk - -If you followed the [Android SDK Setup](#Android_SDK_Setup) instructions, then: - - export ANDROID_SDK_PATH=$HOME/xa-sdk/android-sdk - export ANDROID_NDK_PATH=$HOME/xa-sdk/android-ndk/android-ndk-r14 - -Once the `oss-xamarin.android*.zip` file has been installed, Unix users -may use the `oss-xamarin.android*/bin/Debug/bin/xabuild` script to build -projects. - - # macOS users: build the xamarin-android HelloWorld.csproj sample - $HOME/Downloads/oss-xamarin.android_v7.2.99.19_Darwin-x86_64_master_3b893cd/bin/Debug/bin/xabuild \ - /t:SignAndroidPackage \ - samples/HelloWorld/HelloWorld/HelloWorld.csproj - - - -## Command-line use: Windows - -There is not currently an `xabuild.cmd` script for Windows use. Instead, -Windows users should execute `msbuild.exe` directly, providing the following -MSBuild properties: - -* `AndroidSdkDirectory`: The location of the Android SDK. -* `AndroidNdkDirectory`: The location of the Android NDK. -* `JavaSdkDirectory`: The location of the Java SDK/JDK. - -For example (using the paths from [Android SDK Setup](#Android_SDK_Setup)): - - msbuild /p:AndroidSdkDirectory="C:\xa-sdk\android-sdk" ^ - /p:AndroidNdkDirectory="C:\xa-sdk\android-ndk\android-ndk-r14" ^ - /t:SignAndroidPackage ^ - samples\HelloWorld\HelloWorld\HelloWorld.csproj - - - -# Android SDK Setup - -Please see the [Android Studio][android-studio] page to download the -Android SDK, if you do not already have the Android SDK installed. -If you don't want Android Studio, you can follow the -**Get just the command line tools** section at the Android Studio page. - -[android-studio]: https://developer.android.com/studio/index.html - -The Android NDK can be downloaded from the [NDK Downloads][ndk-downloads] -page. - -[ndk-downloads]: https://developer.android.com/ndk/downloads/index.html - -## macOS Android SDK Setup - -Download the macOS SDK tools package, e.g. -[tools_r25.2.3-macosx.zip][android-tools-macOS], and the - macOS NDK package, e.g. [android-ndk-r14-darwin-x86_64.zip][ndk-macOS] - -[android-tools-macOS]: https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip -[ndk-macOS]: https://dl.google.com/android/repository/android-ndk-r14-darwin-x86_64.zip - -Within **Terminal.app**, run the following commands, assuming that the -above mentioned files were downloaded into `$HOME/Downloads`, and we want -to create a new Android SDK & NDK within `$HOME/xa-sdk`: - - mkdir -p $HOME/xa-sdk/android-sdk - cd $HOME/xa-sdk/android-sdk - unzip $HOME/Downloads/tools_r25.2.3-macosx.zip - tools/bin/sdkmanager "build-tools;25.0.2" - tools/bin/sdkmanager "platform-tools" - tools/bin/sdkmanager "platforms;android-25" - - mkdir -p $HOME/xa-sdk/android-ndk - cd $HOME/xa-sdk/android-ndk - unzip $HOME/Downloads/android-ndk-r14-darwin-x86_64.zip - -## Windows Android SDK Setup - -1. Download the Windows SDK tools package, e.g. -[tools_r25.2.3-windows.zip][android-tools-windows], and the - Windows NDK package, e.g. [android-ndk-r14-windows-x86.zip][ndk-win64] - -[android-tools-windows]: https://dl.google.com/android/repository/tools_r25.2.3-windows.zip -[ndk-win64]: https://dl.google.com/android/repository/android-ndk-r14-windows-x86.zip - - -2. Right-click the `tools*.zip` file within Explorer, then click - **Extract All...** -3. Within the **Extract Compressed (Zipped) Folders** dialog, enter - a path such as `C:\xa-sdk\android-sdk`. Click **Next**. -4. Right-click the `android-ndk*.zip` file within Explorer, then click - **Extract All...** -5. Within the **Extract Compressed (Zipped) Folders** dialog, enter - a path such as `C:\xa-sdk\android-ndk`. Click **Next**. -6. Within `cmd.exe`, execute the following commands: - - cd C:\xa-sdk\android-sdk - tools\bin\sdkmanager "build-tools;25.0.2" - tools\bin\sdkmanager "platform-tools" - tools\bin\sdkmanager "platforms;android-25" diff --git a/Documentation/workflow/UsingYourBuild.md b/Documentation/workflow/UsingYourBuild.md deleted file mode 100644 index a64ec3359b3..00000000000 --- a/Documentation/workflow/UsingYourBuild.md +++ /dev/null @@ -1,79 +0,0 @@ -# Using Your Xamarin.Android Build - -Once the build has finished, `bin/$(Configuration)/bin/xabuild` may be -used to build projects. This is a shell script on Linux and macOS, -and will execute `xabuild.exe` on Windows. - -**Note:** In order to successfully run `xabuild.exe` on Windows, you'll -need to first enable '[Developer Mode][win-dev-settings]' on your Windows -machine so that various symbolic links can be created. - -[win-dev-settings]: https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development#accessing-settings-for-developers - -## Linux and macOS System-Wide Installation - -Linux and macOS users may use the `make install` target to install -Xamarin.Android into `/usr/local`. This may be overridden by setting -the `$(prefix)` make variable: - - make install prefix=/opt/local - -In order for `xbuild` or `msbuild` within `$PATH` to resolve the -Xamarin.Android assemblies, you must install Xamarin.Android into the -same prefix as mono. - - -## Windows System-Wide Installation - -Windows users may use `bin\$(Configuration)\bin\setup-windows.exe` to -install the current build tree into `%ProgramFiles%`, allowing -`msbuild.exe` to use the current build tree. - -If you have Visual Studio 2017 installed, `setup-window.exe` *must* be run -within an Administrator-elevated **Developer Command Prompt for VS 2017** -window: - - 1. In the Start menu, search for **Developer Command Prompt for VS 2017**. - 2. Right-click the **Developer Command Prompt for VS 2017** entry. - 3. Click **Run as administrator**. - -Within the elevated command prompt, execute the `setup-windows.exe` program: - - > bin\Debug\bin\setup-windows.exe - Executing: MKLINK /D "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid" "C:\xa-sdk\oss-xamarin.android_v7.4.99.57_Darwin-x86_64_master_97f08f7\bin\Debug\lib\xamarin.android\xbuild-frameworks\MonoAndroid" - Executing: MKLINK /D "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid" "C:\xa-sdk\oss-xamarin.android_v7.4.99.57_Darwin-x86_64_master_97f08f7\bin\Debug\lib\xamarin.android\xbuild-frameworks\MonoAndroid" - Executing: MKLINK /D "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android" "C:\xa-sdk\oss-xamarin.android_v7.4.99.57_Darwin-x86_64_master_97f08f7\bin\Debug\lib\xamarin.android\xbuild\Xamarin\Android" - Executing: MKLINK "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Xamarin.Android.Sdk.props" "C:\xa-sdk\oss-xamarin.android_v7.4.99.57_Darwin-x86_64_master_97f08f7\bin\Debug\lib\xamarin.android\xbuild\Xamarin\Xamarin.Android.Sdk.props" - Executing: MKLINK "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Xamarin.Android.Sdk.targets" "C:\xa-sdk\oss-xamarin.android_v7.4.99.57_Darwin-x86_64_master_97f08f7\bin\Debug\lib\xamarin.android\xbuild\Xamarin\Xamarin.Android.Sdk.targets" - Success! - -To uninstall, run `setup-windows.exe /uninstall`: - - > bin\Debug\bin\setup-windows.exe /uninstall - -The `setup-windows.exe` utility checks for an existing Xamarin.Android install, -renames the existing directories for backup/easy restoration purposes, then -create symbolic links into the extracted Xamarin.Android directory. - -(Unfortunately, this means that you can't easily have side-by-side installs -of the Xamarin.Android SDK. Only one install can be active at a time.) - -# Samples - -The [HelloWorld](samples/HelloWorld) sample may be built with the -[xabuild](tools/scripts/xabuild) script: - - bin/Debug/bin/xabuild /t:SignAndroidPackage samples/HelloWorld/HelloWorld/HelloWorld.csproj - -`xabuild /t:SignAndroidPackage` will generate an `.apk` file, which may be -installed onto an Android device with the [`adb install`][adb-commands] -command: - -[adb-commands]: http://developer.android.com/tools/help/adb.html#commandsummary - - adb install samples/HelloWorld/bin/Debug/com.xamarin.android.helloworld-Signed.apk - -**HelloWorld** may be launched manually through the Android app launcher, -or via `adb shell am`: - - adb shell am start com.xamarin.android.helloworld/example.MainActivity diff --git a/Makefile b/Makefile index 064b86f7005..914a2a03225 100644 --- a/Makefile +++ b/Makefile @@ -85,47 +85,15 @@ include build-tools/scripts/msbuild.mk ifeq ($(USE_MSBUILD),1) _SLN_BUILD = $(MSBUILD) -else # $(MSBUILD) != 1 -_SLN_BUILD = MSBUILD="$(MSBUILD)" tools/scripts/xabuild endif # $(USE_MSBUILD) == 1 ifneq ($(API_LEVEL),) MSBUILD_FLAGS += /p:AndroidApiLevel=$(API_LEVEL) /p:AndroidFrameworkVersion=$(word $(API_LEVEL), $(ALL_FRAMEWORKS)) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS)) endif -all-tests:: - MSBUILD="$(MSBUILD)" $(call MSBUILD_BINLOG,all-tests,tools/scripts/xabuild) /restore $(MSBUILD_FLAGS) Xamarin.Android-Tests.sln - pack-dotnet:: $(call DOTNET_BINLOG,pack-dotnet) $(MSBUILD_FLAGS) -m:1 $(SOLUTION) -t:PackDotNet -install:: - @if [ ! -d "bin/$(CONFIGURATION)" ]; then \ - echo "run 'make all' before you execute 'make install'!"; \ - exit 1; \ - fi - -mkdir -p "$(prefix)/bin" - -mkdir -p "$(prefix)/lib/mono/xbuild-frameworks" - -mkdir -p "$(prefix)/lib/xamarin.android" - -mkdir -p "$(prefix)/lib/mono/xbuild/Xamarin/" - cp -a "bin/$(CONFIGURATION)/lib/xamarin.android/." "$(prefix)/lib/xamarin.android/" - -rm -rf "$(prefix)/lib/mono/xbuild/Novell" - -rm -rf "$(prefix)/lib/mono/xbuild/Xamarin/Xamarin.Android.Sdk.props" - -rm -rf "$(prefix)/lib/mono/xbuild/Xamarin/Xamarin.Android.Sdk.targets" - -rm -rf "$(prefix)/lib/mono/xbuild/Xamarin/Android" - -rm -rf "$(prefix)/lib/mono/xbuild-frameworks/MonoAndroid" - ln -s "$(prefix)/lib/xamarin.android/xbuild/Xamarin/Android/" "$(prefix)/lib/mono/xbuild/Xamarin/Android" - ln -s "$(prefix)/lib/xamarin.android/xbuild/Novell/" "$(prefix)/lib/mono/xbuild/Novell" - ln -s "$(prefix)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/" "$(prefix)/lib/mono/xbuild-frameworks/MonoAndroid" - if [ ! -e "$(prefix)/bin/mono" ]; then \ - cp tools/scripts/xabuild "$(prefix)/bin/xabuild"; \ - fi - -uninstall:: - rm -rf "$(prefix)/lib/xamarin.android/" "$(prefix)/bin/xabuild" - rm -rf "$(prefix)/lib/mono/xbuild/Xamarin/Android" - rm -rf "$(prefix)/lib/mono/xbuild-frameworks/MonoAndroid" - topdir := $(shell pwd) include build-tools/scripts/BuildEverything.mk @@ -142,7 +110,6 @@ run-all-tests: clean: $(call DOTNET_BINLOG,clean) -t:Clean $(SOLUTION) -m:1 - tools/scripts/xabuild $(MSBUILD_FLAGS) /t:Clean Xamarin.Android-Tests.sln distclean: # It may fail if we're cleaning a half-built tree, no harm done if we ignore it diff --git a/build-tools/automation/yaml-templates/kill-processes.yaml b/build-tools/automation/yaml-templates/kill-processes.yaml index d1cd52e6caf..1e8587ff71f 100644 --- a/build-tools/automation/yaml-templates/kill-processes.yaml +++ b/build-tools/automation/yaml-templates/kill-processes.yaml @@ -2,7 +2,7 @@ steps: - powershell: | $ErrorActionPreference = 'SilentlyContinue' Get-Process - $procsToKill = @("nunit3-console", "xabuild", "MSBuild", "adb") + $procsToKill = @("nunit3-console", "MSBuild", "adb") Write-Host "Attempting to kill stray processes: $procsToKill ..." Stop-Process -Name $procsToKill -PassThru Write-Host "Running processes that should have been killed:" diff --git a/build-tools/scripts/BuildEverything.mk b/build-tools/scripts/BuildEverything.mk index 1798b26ea42..e1e5ae37077 100644 --- a/build-tools/scripts/BuildEverything.mk +++ b/build-tools/scripts/BuildEverything.mk @@ -1,5 +1,4 @@ .PHONY: leeroy jenkins leeroy-all -.PHONY: create-vsix # # framework-assemblies lives in bin/Build$(CONFIGURATION)/rules.mk generated by `make prepare` diff --git a/build-tools/scripts/Packaging.mk b/build-tools/scripts/Packaging.mk index 30f2c5afeee..594e851bf42 100644 --- a/build-tools/scripts/Packaging.mk +++ b/build-tools/scripts/Packaging.mk @@ -1,79 +1,6 @@ -# If commercial components exist in output, set required variables -ifneq ("$(wildcard $(topdir)/bin/$(CONFIGURATION)/lib/xamarin.android/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets)","") -PKG_LICENSE_EN=$(topdir)/external/monodroid/tools/scripts/License.txt -USE_COMMERCIAL_INSTALLER_NAME=true -EXPERIMENTAL=false -endif - create-installers: create-nupkgs create-nupkgs: @echo Disk usage before create-nupkgs -df -h $(call DOTNET_BINLOG,create-all-packs) -t:CreateAllPacks $(topdir)/build-tools/create-packs/Microsoft.Android.Sdk.proj - -create-pkg: - $(call SYSTEM_DOTNET_BINLOG,create-pkg) /t:CreatePkg \ - build-tools/create-pkg/create-pkg.csproj \ - $(if $(PACKAGE_VERSION),/p:ProductVersion="$(PACKAGE_VERSION)") \ - $(if $(PACKAGE_VERSION_REV),/p:XAVersionCommitCount="$(PACKAGE_VERSION_REV)") \ - $(if $(PKG_LICENSE_EN),/p:PkgLicenseSrcEn="$(PKG_LICENSE_EN)") \ - $(if $(PKG_OUTPUT_PATH),/p:PkgProductOutputPath="$(PKG_OUTPUT_PATH)") \ - $(if $(USE_COMMERCIAL_INSTALLER_NAME),/p:UseCommercialInstallerName="$(USE_COMMERCIAL_INSTALLER_NAME)") \ - $(if $(_MSBUILD_ARGS),"$(_MSBUILD_ARGS)") - -# create-vsix.csproj dependencies do not yet support `dotnet build`: -# .nuget/packages/microsoft.vssdk.buildtools/17.0.4207-preview4/build/Microsoft.VSSDK.BuildTools.targets(16,5): error MSB4801: The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild. -create-vsix: - MONO_IOMAP=all MONO_OPTIONS="$(MONO_OPTIONS)" $(call MSBUILD_BINLOG,create-vsix) /p:Configuration=$(CONFIGURATION) /p:CreateVsixContainer=True \ - build-tools/create-vsix/create-vsix.csproj \ - $(if $(VSIX),"/p:VsixPath=$(VSIX)") \ - $(if $(EXPERIMENTAL),/p:IsExperimental="$(EXPERIMENTAL)") \ - $(if $(PRODUCT_COMPONENT),/p:IsProductComponent="$(PRODUCT_COMPONENT)") \ - $(if $(PACKAGE_VERSION),/p:ProductVersion="$(PACKAGE_VERSION)") \ - $(if $(REPO_NAME),/p:XARepositoryName="$(REPO_NAME)") \ - $(if $(PACKAGE_HEAD_BRANCH),/p:XAVersionBranch="$(PACKAGE_HEAD_BRANCH)") \ - $(if $(PACKAGE_VERSION_REV),/p:XAVersionCommitCount="$(PACKAGE_VERSION_REV)") \ - $(if $(COMMIT),/p:XAVersionHash="$(COMMIT)") \ - $(if $(USE_COMMERCIAL_INSTALLER_NAME),/p:UseCommercialInstallerName="$(USE_COMMERCIAL_INSTALLER_NAME)") \ - $(if $(_MSBUILD_ARGS),"$(_MSBUILD_ARGS)") - -package-oss-name: - @echo ZIP_OUTPUT=$(ZIP_OUTPUT) - -package-oss $(ZIP_OUTPUT): - if [ -d bin/Debug/bin ] ; then cp tools/scripts/xabuild bin/Debug/bin ; fi - if [ -d bin/Release/bin ] ; then cp tools/scripts/xabuild bin/Release/bin ; fi - if [ ! -d $(ZIP_OUTPUT_BASENAME) ] ; then mkdir $(ZIP_OUTPUT_BASENAME) ; fi - if [ ! -L $(ZIP_OUTPUT_BASENAME)/bin ] ; then ln -s ../bin $(ZIP_OUTPUT_BASENAME) ; fi - if [ ! -f $(ZIP_OUTPUT_BASENAME)/ThirdPartyNotices.txt ] ; then \ - for f in bin/*/lib/xamarin.android/ThirdPartyNotices.txt ; do \ - cp -n "$$f" $(ZIP_OUTPUT_BASENAME) || true; \ - done; \ - fi - _exclude_list=".__exclude_list.txt"; \ - ls -1d $(_BUNDLE_ZIPS_EXCLUDE) > "$$_exclude_list" 2>/dev/null ; \ - _sl="$(ZIP_OUTPUT_BASENAME)/bin/$(CONFIGURATION)/lib/xamarin.android/xbuild/.__sys_links.txt"; \ - if [ ! -f "$$_sl" ]; then continue; fi; \ - for f in `cat $$_sl` ; do \ - echo "$(ZIP_OUTPUT_BASENAME)/bin/$(CONFIGURATION)/lib/xamarin.android/xbuild/$$f" >> "$$_exclude_list"; \ - done - echo "Exclude List:" - cat ".__exclude_list.txt" -ifeq ($(ZIP_EXTENSION),zip) - zip -r "$(ZIP_OUTPUT)" \ - `ls -1d $(_BUNDLE_ZIPS_INCLUDE) 2>/dev/null` \ - "-x@.__exclude_list.txt" -else ifeq ($(ZIP_EXTENSION),tar.bz2) - tar --exclude-from=.__exclude_list.txt -cjhvf "$(ZIP_OUTPUT)" `ls -1d $(_BUNDLE_ZIPS_INCLUDE) 2>/dev/null` -endif - -rm ".__exclude_list.txt" - -package-deb: $(ZIP_OUTPUT) - rm -fr $(ZIP_OUTPUT_BASENAME) - tar xf $(ZIP_OUTPUT) - cp -a build-tools/debian-metadata $(ZIP_OUTPUT_BASENAME)/debian - sed "s/%CONFIG%/$(CONFIGURATION)/" $(ZIP_OUTPUT_BASENAME)/debian/xamarin.android-oss.install.in > $(ZIP_OUTPUT_BASENAME)/debian/xamarin.android-oss.install && rm -f $(ZIP_OUTPUT_BASENAME)/debian/xamarin.android-oss.install.in - cp LICENSE $(ZIP_OUTPUT_BASENAME)/debian/copyright - cd $(ZIP_OUTPUT_BASENAME) && DEBEMAIL="Xamarin Public Jenkins (auto-signing) " dch --create -v $(PRODUCT_VERSION).$(-num-commits-since-version-change) --package xamarin.android-oss --force-distribution --distribution alpha "New release - please see git log for $(GIT_COMMIT)" - cd $(ZIP_OUTPUT_BASENAME) && dpkg-buildpackage -us -uc -rfakeroot diff --git a/build-tools/scripts/XABuildConfig.cs.in b/build-tools/scripts/XABuildConfig.cs.in deleted file mode 100644 index 1dc9f717dc7..00000000000 --- a/build-tools/scripts/XABuildConfig.cs.in +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Xamarin.Android.Tools -{ - static class XABuildConfig - { - public const string SupportedABIs = "@XA_SUPPORTED_ABIS@"; - public const string NDKRevision = "@NDK_REVISION@"; - public const string NDKRelease = "@NDK_RELEASE@"; - public const string XamarinAndroidVersion = "@XAMARIN_ANDROID_VERSION@"; - public const string XamarinAndroidCommitHash = "@XAMARIN_ANDROID_COMMIT_HASH@"; - public const string XamarinAndroidBranch = "@XAMARIN_ANDROID_BRANCH@"; - public const int AndroidMinimumDotNetApiLevel = @ANDROID_DEFAULT_MINIMUM_DOTNET_API_LEVEL@; - public const int AndroidLatestStableApiLevel = @ANDROID_LATEST_STABLE_API_LEVEL@; - public const int AndroidLatestUnstableApiLevel = @ANDROID_LATEST_UNSTABLE_API_LEVEL@; - public const int AndroidDefaultTargetDotnetApiLevel = @ANDROID_DEFAULT_TARGET_DOTNET_API_LEVEL@; - public static readonly Version NDKVersion = new Version (@NDK_VERSION_MAJOR@, @NDK_VERSION_MINOR@, @NDK_VERSION_MICRO@); - - public static readonly Dictionary ArchAPILevels = new Dictionary (StringComparer.Ordinal) { - {"armeabi-v7a", @NDK_ARMEABI_V7_API@}, - { "arm", @NDK_ARMEABI_V7_API@}, - { "arm64-v8a", @NDK_ARM64_V8A_API@}, - { "arm64", @NDK_ARM64_V8A_API@}, - { "aarch64", @NDK_ARM64_V8A_API@}, - { "x86", @NDK_X86_API@}, - { "x86_64", @NDK_X86_64_API@}, - }; - } -} diff --git a/build-tools/scripts/XABuildPaths.cs.in b/build-tools/scripts/XABuildPaths.cs.in deleted file mode 100644 index ccc9fd39123..00000000000 --- a/build-tools/scripts/XABuildPaths.cs.in +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.IO; - -namespace Xamarin.Android.Build -{ - public static class Paths - { - public const string Configuration = "@CONFIGURATION@"; - public const string TopDirectory = @"@TOP_DIRECTORY@"; - - public static readonly string PrefixDirectory = Path.Combine (TopDirectory, "bin", Configuration); - public static readonly string BinDirectory = Path.Combine (PrefixDirectory, "bin"); - public static readonly string XABuildScript = Path.Combine (BinDirectory, "xabuild"); - public static readonly string XABuildExe = Path.Combine (BinDirectory, "xabuild.exe"); - public static readonly string TestOutputDirectory = Path.Combine (TopDirectory, "bin", "Test@CONFIGURATION@"); - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_DetermineAzurePipelinesTestJobs.cs b/build-tools/xaprepare/xaprepare/Steps/Step_DetermineAzurePipelinesTestJobs.cs index 9c3496ec96c..ec5cc892572 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_DetermineAzurePipelinesTestJobs.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_DetermineAzurePipelinesTestJobs.cs @@ -148,11 +148,6 @@ protected override async Task Execute (Context context) if (file.Contains ("tests/msbuild-times-reference")) { testAreas.Add ("MSBuildDevice"); } - - if (file.Contains ("tools/xabuild")) { - testAreas.Add ("MSBuild"); - testAreas.Add ("MSBuildDevice"); - } } Log.MessageLine ($"##vso[task.setvariable variable=TestAreas;isOutput=true]{string.Join (",", testAreas)}"); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs index 8798d7e7ffa..341fa33daa3 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs @@ -53,18 +53,6 @@ public IEnumerable LastBuildOutput { /// public bool AutomaticNuGetRestore { get; set; } = true; - public string BuildTool { - get { - if (UseDotNet) - return Path.Combine (TestEnvironment.DotNetPreviewDirectory, "dotnet"); - - string xabuild = IsUnix ? XABuildPaths.XABuildScript : XABuildPaths.XABuildExe; - if (File.Exists (xabuild) && TestEnvironment.UseLocalBuildOutput) - return xabuild; - return IsUnix ? "msbuild" : TestEnvironment.GetVisualStudioInstance ().MSBuildPath; - } - } - public bool CrossCompilerAvailable (string supportedAbis) { var crossCompilerLookup = new Dictionary { @@ -202,7 +190,7 @@ protected bool BuildInternal (string projectOrSolution, string target, string [] var start = DateTime.UtcNow; var args = new StringBuilder (); - var psi = new ProcessStartInfo (BuildTool); + var psi = new ProcessStartInfo (Path.Combine (TestEnvironment.DotNetPreviewDirectory, "dotnet")); var responseFile = Path.Combine (XABuildPaths.TestOutputDirectory, Path.GetDirectoryName (projectOrSolution), "project.rsp"); if (UseDotNet) { args.Append ("build "); @@ -224,11 +212,7 @@ protected bool BuildInternal (string projectOrSolution, string target, string [] args.Append (" -nodeReuse:false"); // Disable the MSBuild daemon everywhere! if (MaxCpuCount != null) { - if (!string.Equals (Path.GetFileNameWithoutExtension (psi.FileName), "xabuild", StringComparison.OrdinalIgnoreCase)) { - args.Append ($" /maxCpuCount:{MaxCpuCount}"); - } else { - Console.WriteLine ($"Ignoring MaxCpuCount={MaxCpuCount}, running with xabuild."); - } + args.Append ($" /maxCpuCount:{MaxCpuCount}"); } args.Append ($" @\"{responseFile}\""); using (var sw = new StreamWriter (responseFile, append: false, encoding: Encoding.UTF8)) { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/XABuildPaths.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/XABuildPaths.cs index e2ebdf721ae..321693f8161 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/XABuildPaths.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/XABuildPaths.cs @@ -16,8 +16,6 @@ public class XABuildPaths public static readonly string PrefixDirectory = Path.Combine (TopDirectory, "bin", Configuration); public static readonly string BinDirectory = Path.Combine (PrefixDirectory, "bin"); - public static readonly string XABuildScript = Path.Combine (BinDirectory, "xabuild"); - public static readonly string XABuildExe = Path.Combine (BinDirectory, "xabuild.exe"); public static readonly string TestAssemblyOutputDirectory = Path.Combine (TopDirectory, "bin", $"Test{Configuration}"); public static readonly string TestOutputDirectory = GetTestDirectoryRoot (); public static readonly string BuildOutputDirectory = Path.Combine (TopDirectory, "bin", $"Build{Configuration}"); diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets index ad49a5e4116..bb45a722e04 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets @@ -381,26 +381,4 @@ SkipUnchangedFiles="True" /> - - - - - - - diff --git a/tests/Xamarin.Forms-Performance-Integration/run-perf-test.sh b/tests/Xamarin.Forms-Performance-Integration/run-perf-test.sh deleted file mode 100755 index 6a787ac94ef..00000000000 --- a/tests/Xamarin.Forms-Performance-Integration/run-perf-test.sh +++ /dev/null @@ -1,178 +0,0 @@ -#!/bin/bash -e -CONFIGURATION="${1:-Release}" -XA_ROOT=~/xamarin-android/ -XA_GIT_HASH="$(cd $XA_ROOT; git log --pretty=%H -1)" -XA_GIT_BRANCH="$(cd $XA_ROOT; git branch --show-current)" -DEVICE="$(adb shell getprop ro.product.model)" -ARCH="$(adb shell getprop ro.product.cpu.abi)" -SDK_VER="$(adb shell getprop ro.build.version.sdk)" -RUNS=10 -CSV_FILE="performance-report.csv" -TABLE_FILE="performance-table.md" -ACTIVITY_NAME="Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity" -SLEEP_TIME=5 - -function build_and_install_app() -{ - local count=$1 - local tag="$2" - local build_properties="$3" - - pushd Droid > /dev/null - rm -rf bin obj - - echo - echo "Build ${GLOBAL_RUN_COUNTER} of ${TOTAL_RUNS}: restoring packages..." - xabuild /noConsoleLogger /bl:restore-${XA_GIT_HASH}-${XA_GIT_BRANCH}-${tag}-${count}.binlog /t:Restore /p:Configuration=${CONFIGURATION} ${build_properties} - - echo - echo "Build ${GLOBAL_RUN_COUNTER} of ${TOTAL_RUNS}: building..." - xabuild /noConsoleLogger /bl:build-${XA_GIT_HASH}-${XA_GIT_BRANCH}-${tag}-${count}.binlog /t:Install /p:Configuration=${CONFIGURATION} ${build_properties} - - popd > /dev/null -} - -function _do_convert_to_ns() -{ - local sec="$1" - local ms="$2" - local ns="$3" - - echo $((($sec * 1000000000) + ($ms * 1000000) + $ns)) -} - -function convert_to_ns() -{ - local raw="$1" - _do_convert_to_ns $(echo $raw | tr ':' ' ' | tr -d 's' | tr -s ' ') -} - -function convert_to_ms() -{ - local ns="$1" - - echo "scale=3;$1 / 1000000" | bc -l -} - -function update_averages() -{ - local native_to_managed=$1 - local total_init=$2 - local displayed=$3 - local scale="scale=2;(" - local first="no" - - if [ -z "$NATIVE_TO_MANAGED_AVERAGE" ]; then - NATIVE_TO_MANAGED_AVERAGE="${scale}${native_to_managed}" - TOTAL_INIT_AVERAGE="${scale}${total_init}" - DISPLAYED_AVERAGE="${scale}${displayed}" - first="yes" - fi - - if [ "$first" = "yes" ]; then - return - fi - - NATIVE_TO_MANAGED_AVERAGE="${NATIVE_TO_MANAGED_AVERAGE} + ${native_to_managed}" - TOTAL_INIT_AVERAGE="${TOTAL_INIT_AVERAGE} + ${total_init}" - DISPLAYED_AVERAGE="${DISPLAYED_AVERAGE} + ${displayed}" -} - -declare -a RUN_NUMBERS - -function run() -{ - local logcat_tag="$1" - local note="$2" - local build_properties="$3" - local logcat_name - - NATIVE_TO_MANAGED_AVERAGE= - TOTAL_INIT_AVERAGE= - DISPLAYED_AVERAGE= - RUN_COUNTER=1 - - while [ ${RUN_COUNTER} -le ${RUNS} ]; do - clear - build_and_install_app ${RUN_COUNTER} "${logcat_tag}" "${build_properties}" - adb shell setprop debug.mono.log default,timing=bare - adb logcat -G 16M - adb logcat -c - - NATIVE_TO_MANAGED= - TOTAL_INIT= - DISPLAYED= - while [ -z "$NATIVE_TO_MANAGED" -o -z "$TOTAL_INIT" -o -z "$DISPLAYED" ]; do - echo - echo "Run: ${GLOBAL_RUN_COUNTER} of ${TOTAL_RUNS} (${note})" - echo "Build complete." - - echo Starting application - adb shell am start -n "${ACTIVITY_NAME}" - - echo Sleeping for ${SLEEP_TIME}s - sleep ${SLEEP_TIME} - - echo Recording statistics - logcat_name=logcat-${XA_GIT_HASH}-${XA_GIT_BRANCH}-${logcat_tag}-${RUN_COUNTER}.txt - adb logcat -d > $logcat_name - - NATIVE_TO_MANAGED=$(grep 'Runtime.init: end native-to-managed transition; elapsed:' $logcat_name | sed -n -e 's/^.*Runtime\.init:.*; elapsed: \(.*\)/\1/p') - TOTAL_INIT=$(grep 'Runtime.init: end, total time; elapsed:' $logcat_name | sed -n -e 's/^.*Runtime\.init:.*; elapsed: \(.*\)/\1/p') - DISPLAYED=$(grep 'ActivityTaskManager: Displayed' $logcat_name | cut -d ':' -f 5 | tr -d ' a-z+') - done - - NATIVE_TO_MANAGED=$(convert_to_ns ${NATIVE_TO_MANAGED}) - TOTAL_INIT=$(convert_to_ns ${TOTAL_INIT}) - - RUN_NUMBERS[$((${RUN_COUNTER} - 1))]="${NATIVE_TO_MANAGED} ${TOTAL_INIT} ${DISPLAYED}" - RUN_COUNTER=$((${RUN_COUNTER} + 1)) - GLOBAL_RUN_COUNTER=$((${GLOBAL_RUN_COUNTER} + 1)) - done - - for i in $(seq 1 $((${#RUN_NUMBERS[@]}))); do - update_averages ${RUN_NUMBERS[$(($i - 1))]} - done - - NATIVE_TO_MANAGED_AVERAGE=$(echo "${NATIVE_TO_MANAGED_AVERAGE}) / ${RUNS}" | bc -l) - TOTAL_INIT_AVERAGE=$(echo "${TOTAL_INIT_AVERAGE}) / ${RUNS}" | bc -l) - DISPLAYED_AVERAGE=$(echo "${DISPLAYED_AVERAGE}) / ${RUNS}" | bc -l) - - if [ ! -f ${CSV_FILE} ]; then - echo "Xamarin.Android,Number of runs,Native-to-managed (ns),Total init time (ns),Displayed time (ms),Notes,Device,SDK version,Device architecture" > ${CSV_FILE} - fi - - if [ ! -f ${TABLE_FILE} ]; then - cat < ${TABLE_FILE} - Device name: **${DEVICE}** -Device architecture: **${ARCH}** -Number of test runs: **${RUNS}** - -| | **Native to managed** | **Runtime init** | **Displayed** | **Notes** | -|-----------------|------------------------|------------------|---------------|--------------------------------| -EOF - fi - - echo "${XA_GIT_BRANCH}/${XA_GIT_HASH},${RUNS},${NATIVE_TO_MANAGED_AVERAGE},${TOTAL_INIT_AVERAGE},${DISPLAYED_AVERAGE},${note},${DEVICE},${SDK_VER},${ARCH}" >> ${CSV_FILE} - - NATIVE_TO_MANAGED_MS=$(convert_to_ms ${NATIVE_TO_MANAGED_AVERAGE}) - TOTAL_INIT_MS=$(convert_to_ms ${TOTAL_INIT_AVERAGE}) - - echo "| **master** | XXX.XX | XXX.XX | XXX.XX | ${note} |" >> ${TABLE_FILE} - echo "| **this commit** | ${NATIVE_TO_MANAGED_MS} | ${TOTAL_INIT_MS} | ${DISPLAYED_AVERAGE} | |" >> ${TABLE_FILE} -} - -TOTAL_RUNS=$((${RUNS} * 4)) -GLOBAL_RUN_COUNTER=1 - -rm -f ${CSV_FILE} -rm -f ${TABLE_FILE} -run armeabi-v7a_preload " preload enabled; 32-bit build" "/p:AndroidEnablePreloadAssemblies=True" -run armeabi-v7a_nopreload "preload disabled; 32-bit build" "/p:AndroidEnablePreloadAssemblies=False" -run arm64-v8a_preload " preload enabled; 64-bit build" "/p:AndroidEnablePreloadAssemblies=True /p:Enable64BitBuild=True" -run arm64-v8a_nopreload "preload disabled; 64-bit build" "/p:AndroidEnablePreloadAssemblies=False /p:Enable64BitBuild=True" - -echo -echo CSV report file: ${CSV_FILE} -echo Markdown table file: ${TABLE_FILE} -echo diff --git a/tools/xabuild/xabuild.csproj b/tools/xabuild/xabuild.csproj index cfc40557a26..fcb181aaf69 100644 --- a/tools/xabuild/xabuild.csproj +++ b/tools/xabuild/xabuild.csproj @@ -43,8 +43,4 @@ PreserveNewest - - - - \ No newline at end of file From 2af8f4e6ef10c6c8cdd47aba2a2d791e7559263f Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Mon, 9 Oct 2023 16:32:15 -0400 Subject: [PATCH 2/2] Restore XABuildConfig --- build-tools/scripts/XABuildConfig.cs.in | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 build-tools/scripts/XABuildConfig.cs.in diff --git a/build-tools/scripts/XABuildConfig.cs.in b/build-tools/scripts/XABuildConfig.cs.in new file mode 100644 index 00000000000..1dc9f717dc7 --- /dev/null +++ b/build-tools/scripts/XABuildConfig.cs.in @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +namespace Xamarin.Android.Tools +{ + static class XABuildConfig + { + public const string SupportedABIs = "@XA_SUPPORTED_ABIS@"; + public const string NDKRevision = "@NDK_REVISION@"; + public const string NDKRelease = "@NDK_RELEASE@"; + public const string XamarinAndroidVersion = "@XAMARIN_ANDROID_VERSION@"; + public const string XamarinAndroidCommitHash = "@XAMARIN_ANDROID_COMMIT_HASH@"; + public const string XamarinAndroidBranch = "@XAMARIN_ANDROID_BRANCH@"; + public const int AndroidMinimumDotNetApiLevel = @ANDROID_DEFAULT_MINIMUM_DOTNET_API_LEVEL@; + public const int AndroidLatestStableApiLevel = @ANDROID_LATEST_STABLE_API_LEVEL@; + public const int AndroidLatestUnstableApiLevel = @ANDROID_LATEST_UNSTABLE_API_LEVEL@; + public const int AndroidDefaultTargetDotnetApiLevel = @ANDROID_DEFAULT_TARGET_DOTNET_API_LEVEL@; + public static readonly Version NDKVersion = new Version (@NDK_VERSION_MAJOR@, @NDK_VERSION_MINOR@, @NDK_VERSION_MICRO@); + + public static readonly Dictionary ArchAPILevels = new Dictionary (StringComparer.Ordinal) { + {"armeabi-v7a", @NDK_ARMEABI_V7_API@}, + { "arm", @NDK_ARMEABI_V7_API@}, + { "arm64-v8a", @NDK_ARM64_V8A_API@}, + { "arm64", @NDK_ARM64_V8A_API@}, + { "aarch64", @NDK_ARM64_V8A_API@}, + { "x86", @NDK_X86_API@}, + { "x86_64", @NDK_X86_64_API@}, + }; + } +}