You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a new Copilot > Configure Chat... > Generate Instructions menu in VS Code.
I let it run and update the file, and accepted the parts that looked useful.
The most important thing, it found various links to `.md` files that were broken!
This makes the file about 50% smaller, which may give @copilot more context window to work with.
This repository is **.NET for Android** (formerly Xamarin.Android), the open-source bindings and tooling for Android development using .NET languages like C#.
4
-
5
-
This is the main branch targeting **.NET 10**.
6
-
7
-
## Repository Overview
8
-
9
-
.NET for Android provides:
10
-
- Android SDK bindings in C# (`src/Mono.Android/`)
11
-
- MSBuild tasks for building Android apps (`src/Xamarin.Android.Build.Tasks/`)
12
-
- Native runtime components (`src/native/`)
13
-
- Build tooling and infrastructure (`build-tools/`)
-**Android API Bindings**: C# wrappers for Android Java APIs
27
-
-**MSBuild Tasks**: Build logic for .NET Android projects
28
-
-**Native Libraries**: C++ runtime components using CMake
29
-
-**Java Support Code**: Java runtime classes
30
-
-**Build Tools**: Custom tools for build process
31
-
-**Tests**: NUnit tests, integration tests, and device tests
32
-
33
-
## Build System
34
-
35
-
This repository uses:
36
-
-**MSBuild** as the primary build system with extensive `.targets` and `.props` files
37
-
-**[.NET Arcade SDK](https://github.com/dotnet/arcade)** for consistent .NET build infrastructure
38
-
-**CMake** for native C++ components
39
-
-**Gradle** for some Android-specific build tasks
40
-
41
-
Common build commands:
42
-
-`./build.sh` or `build.cmd` - Main build
43
-
-`./dotnet-local.sh` or `dotnet-local.cmd` - Use locally built .NET tools
44
-
-`make` - Various make targets for specific components
45
-
46
-
## Development Guidelines
47
-
48
-
**Always search Microsoft documentation (MS Learn) when working with .NET, Windows, or Microsoft features, APIs, or integrations.** Use the `microsoft_docs_search` tool to find the most current and authoritative information about capabilities, best practices, and implementation patterns before making changes.
49
-
50
-
## Localization Files
51
-
52
-
**DO NOT modify localization files that are automatically maintained by bots and build integrations:**
53
-
54
-
-**Never modify `*.lcl` files** in the `Localize/loc/` directory - these are managed by localization automation
55
-
-**Never modify non-English `*.resx` files** (e.g., `Resources.ja.resx`, `Resources.ko.resx`, etc.) - these are auto-generated from the main English resources
56
-
-**Only modify the main English `*.resx` files** (e.g., `Resources.resx`) when updating user-facing strings
57
-
- The localization bots will automatically update all translated versions based on changes to the main English resources
58
-
59
-
When making changes to user-facing text:
60
-
1. Only update the main English `*.resx` files
61
-
2. Let the automated systems handle all translations and localized files
62
-
3. Do not manually edit translated content as it will be overwritten
63
-
64
-
## Android Development Patterns
65
-
66
-
### API Bindings
67
-
- Android Java APIs are bound to C# in `src/Mono.Android/`
68
-
- Follow existing patterns for Android namespaces (e.g., `Android.App`, `Android.Content`)
69
-
- Use `[Register]` attributes for Java type registration
70
-
71
-
### MSBuild Integration
72
-
- Build tasks extend `Microsoft.Build.Utilities.Task` or related base classes
73
-
- Place custom MSBuild logic in `src/Xamarin.Android.Build.Tasks/Tasks/`
74
-
- Follow existing error code patterns (e.g., `XA####` for errors, `XA####` for warnings)
75
-
- Support incremental builds where possible
76
-
- Follow patterns in [`Documentation/guides/MSBuildBestPractices.md`](Documentation/guides/MSBuildBestPractices.md)
77
-
78
-
### Native Code
79
-
- C++ code uses CMake build system
80
-
- Native libraries are in `src/native/`
81
-
- Follow Android NDK patterns and conventions
82
-
- Use proper JNI patterns for Java interop
83
-
84
-
### Testing Patterns
85
-
- Unit tests go in `tests/` directory
86
-
- Device integration tests in `tests/MSBuildDeviceIntegration/`
87
-
- Use NUnit for C# tests
88
-
- Mock Android APIs appropriately for unit testing
89
-
- Follow patterns in [`Documentation/workflow/UnitTests.md`](Documentation/workflow/UnitTests.md) for comprehensive testing guidance
90
-
91
-
### Development and Debugging
92
-
- Use `MSBUILDDEBUGONSTART=2` environment variable to debug MSBuild tasks
93
-
- Follow patterns in [`Documentation/workflow/DevelopmentTips.md`](Documentation/workflow/DevelopmentTips.md)
94
-
- Use update directories for rapid testing of Debug builds on devices
95
-
- Utilize `dotnet test --filter` for running specific unit tests
96
-
- Reference [`Documentation/workflow/MSBuildBestPractices.md`](Documentation/workflow/MSBuildBestPractices.md) for MSBuild debugging techniques
3
+
**.NET for Android** (formerly Xamarin.Android) - Open-source Android development bindings for .NET languages. `main` branch targets **.NET 10**.
4
+
5
+
## Architecture
6
+
-`src/Mono.Android/` - Android SDK bindings in C#
7
+
-`src/Xamarin.Android.Build.Tasks/` - MSBuild tasks for Android apps
-**Test with local build:**`dotnet-local.sh`/`dotnet-local.cmd`
17
+
-**Run tests:**`dotnet-local.cmd test bin/TestDebug/net9.0/Xamarin.Android.Build.Tests.dll --filter Name~TestName`
18
+
-**Device tests:**`dotnet-local.cmd test bin/TestDebug/MSBuildDeviceIntegration/net9.0/MSBuildDeviceIntegration.dll`
19
+
20
+
## Critical Rules
21
+
22
+
**Only modify the main English `*.resx` files** (e.g., `Resources.resx`)
23
+
24
+
**Never modify non-English localization files:**`*.lcl` files in `Localize/loc/` or non-English `*.resx` files are auto-generated.
25
+
26
+
**Use Microsoft docs:** Search MS Learn before making .NET, Windows, or Microsoft features, APIs, or integrations. Use the `microsoft_docs_search` tool.
27
+
28
+
**MSBuild Tasks:** Extend `AndroidTask` base class, use `XA####` error codes, test in isolation.
29
+
30
+
**API Bindings:** Use `[Register]` attributes, follow `Android.*` namespace patterns.
0 commit comments