Skip to content

Conversation

@dellis1972
Copy link
Contributor

Commit fd96998 added support for reading and parsing R.txt
files. This commit adds support for generating the file as
part of the _UpdateAndroidResgen target.

The idea is that if the R.txt file is present we should use
that for our design time build Resource.Designer.cs.

@dellis1972 dellis1972 added Area: xamarin-android Build Issues building the xamarin-android repo *itself*. do-not-merge PR should not be merged. labels Dec 11, 2017
@jonathanpeppers
Copy link
Member

@jonpryor

Just a thought, could IncrementalClean potentially delete R.txt with this PR as-is? If so, I can fix this tomorrow (and maybe add one test).

@dellis1972
Copy link
Contributor Author

dellis1972 commented Dec 11, 2017 via email

@jonathanpeppers
Copy link
Member

jonathanpeppers commented Dec 12, 2017 via email

@jonathanpeppers
Copy link
Member

build

dellis1972 and others added 5 commits January 2, 2018 11:05
Commit fd96998 added support for reading and parsing R.txt
files. This commit adds support for generating the file as
part of the `_UpdateAndroidResgen` target.

The idea is that if the R.txt file is present we should use
that for our design time build Resource.Designer.cs.
Added `R.txt` to the `FileWrites` `<ItemGroup />`.

Updated the `DesignTimeBuild` test:
- Checks for the existance of `R.txt` after a `Build`
- Refactor to keep `IntermediateOutputPath` in a variable
- Use `FileAssert.Exists` instead of `Assert.IsTrue(File.Exists())`
@dellis1972 dellis1972 removed the do-not-merge PR should not be merged. label Jan 2, 2018
@jonpryor jonpryor merged commit 855583c into dotnet:master Jan 2, 2018
jonpryor pushed a commit that referenced this pull request Dec 9, 2020
Context: #5331

Changes: xamarin/monodroid@0eef889...27736a7

  * xamarin/monodroid@27736a7ff: [tools/msbuild] Fix App Bundle deployment (#1142)
  * xamarin/monodroid@f38dbc7ab: [tools/msbuild] use @(_AndroidMSBuildAllProjects) (#1140)
  * xamarin/monodroid@cfa21d57b: [tools/msbuild] Fix some issues with FastDev (#1139)
  * xamarin/monodroid@3ba648386: [tools/msbuild] Add missing parameter to BuildAppBundle. (#1138)
  * xamarin/monodroid@5bb29971b: [tools/msbuild] Add Multi User Support for Debugging. (#1135)
  * xamarin/monodroid@156abf47c: [tools/msbuild] default $(_AndroidAllowDeltaInstall) to false (#1137)
  * xamarin/monodroid@fbc961218: [build] Pass EnableCompression to BuildApk (#1094)

Add support for running multi-user unit tests on device.  It makes
use of various adb commands to create test users and remove them.

Create a guest user with name `{name}`:

	adb shell pm create-user --guest {name}

Remove a guest user with the specified user id `{userId}`:

	adb shell pm remove-user --guest {userId}

Note that user creation takes a "name", while deletion takes an id.
To obtain the mapping, use:

	$ adb shell pm list users
	Users:
		UserInfo{0:Owner:c13} running
		UserInfo{10:guest1:414}

The userId is the number *between* the `{` and the `:` and user name.
The userId for `Owner` is 0, while the userId for `guest1` is 10.

We can then use a `Regex` to pull out the required `userId` for a
specific user.

To switch a device to use user `{userId}`:

	adb shell am switch-user {userId}

Emulators seem to create the main user with the name "Owner", so that
should be the default name we use for the main user.  In the unit
tests if we cannot find a user named "Owner" when looking for "Owner"
we will default to a `userId` of `0`.  User ID 0 always means the
default user.  This is to handle the case where we are testing locally
on devices where the main user is not called "Owner".
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Area: xamarin-android Build Issues building the xamarin-android repo *itself*.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants