Skip to content

Commit bec1993

Browse files
Merge branch 'main' into dev/peppers/ji-1366
2 parents ec8aeed + 0147200 commit bec1993

File tree

118 files changed

+11599
-2018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+11599
-2018
lines changed

.azuredevops/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: 2
2+
3+
# Disabling dependabot on Azure DevOps as this is a mirrored repo. Updates should go through github.
4+
enable-campaigned-updates: false
5+
enable-security-updates: false

.external

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
DevDiv/android-platform-support:main@bdce1c1dc27c5a58da5cd12ae2f4113d76ddc2da
1+
DevDiv/android-platform-support:main@2ca8c22cc27b2f437275ee01e054c92847728617

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
----
2+
3+
Pull Request
4+
[title](https://github.com/xamarin/xamarin-android/blob/main/Documentation/workflow/commit-messages.md#commit-summary) and
5+
[description](https://github.com/xamarin/xamarin-android/blob/main/Documentation/workflow/commit-messages.md#commit-body)
6+
should follow the
7+
[`commit-messages.md` workflow documentation](https://github.com/xamarin/xamarin-android/blob/main/Documentation/workflow/commit-messages.md), and in particular should include:
8+
9+
- [ ] Useful description of *why the change is necessary*.
10+
- [ ] Links to issues fixed
11+
- [ ] Unit tests

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Instructions for AIs
22

3-
**.NET for Android** (formerly Xamarin.Android) - Open-source Android development bindings for .NET languages. `main` branch targets **.NET 10**.
3+
**.NET for Android** (formerly Xamarin.Android) - Open-source Android development bindings for .NET languages. `main` branch targets **.NET 11**.
44

55
## Architecture
66
- `src/Mono.Android/` - Android SDK bindings in C#

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# https://docs.github.com/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/
22
version: 2
33
updates:
4+
- package-ecosystem: "nuget"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
48
- package-ecosystem: "gradle"
59
directory: "/src/r8/"
610
schedule:

.github/workflows/copilot-setup-steps.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,62 @@ jobs:
66
copilot-setup-steps:
77
runs-on: ubuntu-latest
88
timeout-minutes: 120
9+
env:
10+
AndroidToolchainCacheDirectory: /mnt/android-archives
11+
AndroidToolchainDirectory: /mnt/android-toolchain
12+
NUGET_PACKAGES: /mnt/nuget/packages
13+
NUGET_HTTP_CACHE_PATH: /mnt/nuget/v3-cache
14+
NUGET_PLUGINS_CACHE_PATH: /mnt/nuget/plugins-cache
15+
NUGET_SCRATCH: /mnt/nuget/scratch
916

1017
steps:
18+
- name: Free up disk space
19+
run: |
20+
# Remove pre-installed Android SDK/NDK (~10GB) since we download our own specific versions
21+
sudo rm -rf /usr/local/lib/android
22+
1123
- name: Checkout repository
1224
uses: actions/checkout@v4
1325
with:
1426
submodules: recursive
27+
fetch-depth: 1
28+
29+
- name: Log disk space (after checkout)
30+
uses: ./.github/workflows/log-disk-space
31+
32+
- name: Setup build directories on secondary disk
33+
run: |
34+
echo "Setting up Android toolchain on /mnt (secondary disk with 66G+ free)"
35+
36+
# Create directories with sudo and set ownership
37+
sudo mkdir -p /mnt/android-archives
38+
sudo mkdir -p /mnt/android-toolchain
39+
sudo mkdir -p /mnt/bin
40+
sudo mkdir -p /mnt/gradle
41+
sudo mkdir -p /mnt/nuget/packages
42+
sudo mkdir -p /mnt/nuget/v3-cache
43+
sudo mkdir -p /mnt/nuget/plugins-cache
44+
sudo mkdir -p /mnt/nuget/scratch
45+
sudo chown -R $USER:$USER /mnt/android-archives /mnt/android-toolchain /mnt/bin /mnt/gradle /mnt/nuget
46+
47+
# Remove bin directory if it exists and create symlink to use the secondary disk
48+
rm -rf ./bin
49+
ln -s /mnt/bin ./bin
50+
51+
# Move Gradle cache to secondary disk to prevent "No space left on device" during Gradle operations
52+
mkdir -p /mnt/gradle
53+
ln -s /mnt/gradle $HOME/.gradle
54+
55+
echo "Build cache directories configured on /mnt (secondary disk):"
56+
echo " - Android toolchain: /mnt/android-toolchain"
57+
echo " - Build output: /mnt/bin"
58+
echo " - Gradle cache: /mnt/gradle"
59+
echo " - NuGet packages: /mnt/nuget/packages"
60+
echo " - NuGet HTTP cache: /mnt/nuget/v3-cache"
61+
echo " - NuGet plugins cache: /mnt/nuget/plugins-cache"
62+
echo " - NuGet scratch: /mnt/nuget/scratch"
63+
ls -la /mnt
64+
df -h /mnt
1565
1666
- name: Setup .NET
1767
uses: actions/setup-dotnet@v4
@@ -25,6 +75,11 @@ jobs:
2575
make jenkins PREPARE_CI=1 PREPARE_AUTOPROVISION=1 CONFIGURATION=Debug
2676
timeout-minutes: 60
2777

78+
- name: Log disk space (after android build)
79+
uses: ./.github/workflows/log-disk-space
80+
with:
81+
detailed: 'true'
82+
2883
- name: Upload logs
2984
uses: actions/upload-artifact@v4
3085
if: steps.android-build.outcome == 'failure'
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Log Disk Space
2+
description: Logs disk space usage on the runner
3+
inputs:
4+
detailed:
5+
description: 'Whether to include detailed disk analysis (true/false)'
6+
required: false
7+
default: 'false'
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Display disk space
12+
shell: bash
13+
run: |
14+
MAX_LINES=20
15+
16+
echo "=== Disk Space Usage ==="
17+
df -h
18+
echo ""
19+
echo "=== Inode Usage ==="
20+
df -i
21+
echo ""
22+
echo "=== Disk Usage Summary ==="
23+
df -h / | tail -1 | awk '{print "Used: " $3 " / " $2 " (" $5 " full)"}'
24+
echo ""
25+
echo "=== /mnt disk info ==="
26+
echo "Permissions:"
27+
ls -la / | grep mnt
28+
echo "Contents:"
29+
ls -la /mnt 2>/dev/null || echo "/mnt is empty or not accessible"
30+
echo "Disk usage:"
31+
df -h /mnt
32+
33+
# Detailed analysis if requested
34+
if [ "${{ inputs.detailed }}" = "true" ]; then
35+
echo ""
36+
echo "=== DETAILED ANALYSIS ==="
37+
echo ""
38+
echo "=== Largest directories in /home/runner ==="
39+
sudo du -h /home/runner 2>/dev/null | sort -rh | head -$MAX_LINES || true
40+
echo ""
41+
echo "=== Largest directories in /opt ==="
42+
sudo du -h /opt 2>/dev/null | sort -rh | head -$MAX_LINES || true
43+
echo ""
44+
echo "=== Workspace breakdown (top level) ==="
45+
du -h --max-depth=1 . 2>/dev/null | sort -rh || true
46+
echo ""
47+
echo "=== Workspace breakdown (2 levels deep) ==="
48+
du -h --max-depth=2 . 2>/dev/null | sort -rh | head -$MAX_LINES || true
49+
echo ""
50+
echo "=== bin directory ==="
51+
du -sh ./bin/* 2>/dev/null | sort -rh | head -$MAX_LINES || echo "No bin"
52+
echo ""
53+
echo "=== external directory ==="
54+
du -sh ./external/* 2>/dev/null | sort -rh | head -$MAX_LINES || echo "No external"
55+
echo ""
56+
echo "=== Android toolchain directories ==="
57+
du -sh /mnt/android-archives 2>/dev/null || echo "No android-archives"
58+
du -sh /mnt/android-toolchain 2>/dev/null || echo "No android-toolchain"
59+
echo ""
60+
echo "=== /mnt disk usage ==="
61+
du -h --max-depth=1 /mnt 2>/dev/null | sort -rh || true
62+
echo ""
63+
echo "=== Docker usage ==="
64+
docker system df 2>/dev/null || echo "Docker not available"
65+
echo ""
66+
echo "=== Temp directories ==="
67+
du -sh /tmp /var/tmp 2>/dev/null || true
68+
fi

Documentation/building/configuration.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
- [Build Configuration](#build-configuration)
33
- [Options suitable to use in builds for public use](#options-suitable-to-use-in-builds-for-public-use)
44
- [Options suitable for local development](#options-suitable-for-local-development)
5-
- [Native runtime (`src/monodroid`)](#native-runtime-srcmonodroid)
5+
- [Native runtime (`src/native`)](#native-runtime-srcnative)
66
- [Disable function inlining](#disable-function-inlining)
77
- [Don't strip the runtime shared libraries](#dont-strip-the-runtime-shared-libraries)
88
<!--toc:end-->
@@ -146,13 +146,13 @@ Overridable MSBuild properties include:
146146

147147
## Options suitable for local development
148148

149-
### Native runtime (`src/monodroid`)
149+
### Native runtime (`src/native`)
150150

151151
Note that in order for the native build settings to have full effect, one needs to make sure that
152152
the entire native runtime is rebuilt **and** that all `cmake` files are regenerated. This is true
153153
on the very first build, but rebuilds may require forcing the entire runtime to be rebuilt.
154154

155-
The simplest way to do it is to remove `src/monodroid/obj` and run the usual build from the
155+
The simplest way to do it is to remove `src/native/obj` and run the usual build from the
156156
repository's root directory.
157157

158158
#### Disable function inlining
@@ -164,8 +164,8 @@ location instead of the inlined function where crash actually happened. There a
164164
enable this mode of operation:
165165

166166
1. Export the `XA_NO_INLINE` environment variable before building either the entire repository
167-
or just `src/monodroid/`
168-
2. Set the MSBuild property `DoNotInlineMonodroid` to `true`, when building `src/monodroid/monodroid.csproj`
167+
or just `src/native/`
168+
2. Set the MSBuild property `DoNotInlineMonodroid` to `true`, when building `src/native/native-*.csproj`
169169

170170
Doing either will force all normally inlined functions to be strictly preserved and kept
171171
separate. The generated code will be slower, but crash stack traces should be much more precise.
@@ -178,5 +178,5 @@ stack traces rarely point to anything more than the surrounding function name (w
178178
be misleading, too). Just as for inlining, the no-strip mode can be enabled with one of two ways:
179179

180180
1. Export the `XA_NO_STRIP` environment variable before building either the entire repository
181-
or just `src/monodroid/`
182-
2. Set the MSBuild property `DoNotStripMonodroid` to `true`, when building `src/monodroid/monodroid.csproj`
181+
or just `src/native/`
182+
2. Set the MSBuild property `DoNotStripMonodroid` to `true`, when building `src/native/native-*.csproj`

Documentation/building/unix/dependencies.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ to provide install instructions to obtain the missing dependency, e.g.:
3434
## Homebrew
3535

3636
[Homebrew](https://brew.sh) must be installed and available via `$PATH` in
37-
order to provision xamarin-android.
37+
order to provision dotnet/android.
3838

3939
When building on Apple Silicon (arm64) machines, use the **arch**(1) command to
4040
allow Homebrew to be installed:
@@ -88,7 +88,7 @@ On macOS, autotools are should be used from `brew`, and may be installed via:
8888

8989
## Android NDK, SDK
9090

91-
*Note*: A xamarin-android checkout maintains *its own* Android NDK + SDK
91+
*Note*: A dotnet/android checkout maintains *its own* Android NDK + SDK
9292
to ensure consistent builds and build behavior, permitting reproducible
9393
builds and providing greater flexibility around when we need to perform
9494
Android SDK + NDK updates. The Android SDK and NDK are maintained by default
@@ -101,7 +101,7 @@ via two directories in your home directory:
101101

102102
Developers may use these directories for their own use, but *please* **DO NOT**
103103
update or alter the contents of the `$(AndroidToolchainDirectory)`, as that may
104-
prevent the xamarin-android build from working as expected.
104+
prevent the dotnet/android build from working as expected.
105105

106106
The files that will be downloaded and installed are controlled by
107107
[build-tools/android-toolchain/android-toolchain.projitems][android-toolchain.projitems]

Documentation/building/unix/instructions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ can also be used by setting the `$(MSBUILD)` make variable to `xbuild`.
88

99
1. Install the [build dependencies](dependencies.md).
1010

11-
2. Clone the xamarin-android repo:
11+
2. Clone the dotnet/android repo:
1212

13-
git clone https://github.com/xamarin/xamarin-android.git
13+
git clone https://github.com/dotnet/android.git
1414

15-
3. Navigate to the `xamarin-android` directory
15+
3. Navigate to the `android` directory
1616

1717
4. (Optional) [Configure the build](../configuration.md).
1818

@@ -77,7 +77,7 @@ Create a new project with `./dotnet-local.sh new android`:
7777
```xml
7878
<Project Sdk="Microsoft.NET.Sdk">
7979
<PropertyGroup>
80-
<TargetFramework>net6.0-android</TargetFramework>
80+
<TargetFramework>net10.0-android</TargetFramework>
8181
<OutputType>Exe</OutputType>
8282
</PropertyGroup>
8383
</Project>
@@ -115,7 +115,7 @@ Commercial installers will be created by this command if the
115115
# Running Unit Tests
116116

117117

118-
The `xamarin-android` repo contains several unit tests:
118+
The `dotnet/android` repo contains several unit tests:
119119

120120
* NUnit-based unit tests, for stand-alone assemblies and utilities.
121121

@@ -215,7 +215,7 @@ custom attribute -- may be executed instead of executing *all* test fixtures.
215215
The `RunTestApks` target accepts a `TestFixture` MSBuild property
216216
to specify the test fixture class to execute.
217217

218-
If using `Xamarin.Android.NUnitLite` for projects outside the `xamarin-android`
218+
If using `Xamarin.Android.NUnitLite` for projects outside the `dotnet/android`
219219
repository, such as NUnit tests for a custom app, the `RunTestApks` target
220220
will not exist. In such scenarios, the [`adb shell am`][adb-shell-am]
221221
`instrument` command can be used instead. It follows the format:

0 commit comments

Comments
 (0)