Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates needed to build on net9.0-android RTM. #1021

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ extends:
name: $(windowsAgentPoolName)
image: $(windowsImage)
os: windows
runDotnetNextTest: ${{ parameters.RunDotnetNextTest }}

- template: build/ci/stage-extended-tests.yml@self
parameters:
Expand All @@ -97,5 +98,6 @@ extends:
name: $(windowsAgentPoolName)
image: $(windowsImage)
os: windows
runDotnetNextTest: ${{ parameters.RunDotnetNextTest }}

- template: build/ci/stage-sign-artifacts.yml@self
5 changes: 3 additions & 2 deletions build/ci/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ parameters:
runDotnetNextTest: false

tools: # Additional .NET global tools to install
- 'xamarin.androidbinderator.tool': '0.5.7'
- 'Cake.Tool': '4.0.0'
- 'private-api-tools': '1.0.3'

Expand All @@ -22,7 +21,9 @@ jobs:
displayName: ${{ parameters.name }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
pool: ${{ parameters.buildPool }}

workspace:
clean: all

templateContext:
sdl:
spotBugs:
Expand Down
3 changes: 3 additions & 0 deletions build/ci/job-extended-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ parameters:
testFilter: # Test category filter
testProject: # The test .csproj to build
testAssembly: # The test .dll to execute
runDotnetNextTest: false

tools: # Additional .NET global tools to install
- 'dotnet-test-slicer' : '0.1.0-alpha7'
- 'Cake.Tool': '4.0.0'

jobs:
- job: ${{ parameters.jobName }}_package_tests
Expand All @@ -23,6 +25,7 @@ jobs:
- template: setup-environment.yml
parameters:
dotnetTools: ${{ parameters.tools }}
runDotnetNextTest: ${{ parameters.runDotnetNextTest }}

- task: DownloadPipelineArtifact@2
inputs:
Expand Down
4 changes: 3 additions & 1 deletion build/ci/stage-extended-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
parameters:
stageCondition: # When to run this stage
buildPool: # VM pool information
runDotnetNextTest: false

stages:
- stage: extended_tests
Expand All @@ -20,7 +21,8 @@ stages:
testProject: $(extendedTestProject)
testAssembly: $(extendedTestAssembly)
buildPool: ${{ parameters.buildPool }}

runDotnetNextTest: ${{ parameters.runDotnetNextTest }}

# Disabled because of too many failures until MAUI updates its AndroidX packages
# - template: job-extended-tests.yml
# parameters:
Expand Down
2 changes: 2 additions & 0 deletions build/ci/stage-standard-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
parameters:
buildPool: # VM pool information
stageCondition: and(succeeded(), ne('$(skipUnitTests)', 'true')) # When to run this stage
runDotnetNextTest: false

stages:
- stage: standard_tests
Expand All @@ -20,3 +21,4 @@ stages:
testProject: $(standardTestProject)
testAssembly: $(standardTestAssembly)
buildPool: ${{ parameters.buildPool }}
runDotnetNextTest: ${{ parameters.runDotnetNextTest }}
3 changes: 2 additions & 1 deletion source/AndroidXProject.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
- CS0809: Obsolete member 'member' overrides non-obsolete member 'member'
- CS1572: XML comment has a param tag for '', but there is no parameter by that name
- XAOBS001: While this member is 'public', Google considers it internal API and reserves the right to modify or delete it in the future. Use at your own risk.
- NU1605: Detected package downgrade
-->
<NoWarn>$(NoWarn);0618;0109;0114;0628;0108;0809;1572;XAOBS001</NoWarn>
<NoWarn>$(NoWarn);0618;0109;0114;0628;0108;0809;1572;XAOBS001;NU1605</NoWarn>

@if (Model.AllowPrereleaseDependencies) {
<!-- Allow this package to have prerelease dependencies -->
Expand Down
9 changes: 9 additions & 0 deletions source/_PackageLevelCustomizations.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,12 @@
<EmbeddedJar Include="..\..\externals\com.xamarin.google.android.play.feature.delivery.extensions\extensions.jar" />
</ItemGroup>
}

@* .NET 9 changes some binding internals that breaks some of our hand bound code. This property reverts
to the old behavior. Once we are .NET 9+ we should redo our hand bound code and remove this. *@
@if (@Model.NuGetPackageId == "Xamarin.AndroidX.Media3.ExoPlayer")
{
<PropertyGroup>
<_AndroidEmitLegacyInterfaceInvokers>true</_AndroidEmitLegacyInterfaceInvokers>
</PropertyGroup>
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,12 @@
public
</attr>

<!-- Workaround generator can't detect this was implemented as an explicitly implemented interface member on a base class -->
<attr
path="/api/package[@name='androidx.paging']/class[@name='PagedList']"
name="skipInvokerMethods"
>
java/util/SequencedCollection.reversed()Ljava/util/SequencedCollection;
</attr>

</metadata>
1 change: 1 addition & 0 deletions source/androidx.work/work-runtime/Transforms/Metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<attr path="/api/package[@name='androidx.work']/class[@name='WorkRequest.Builder']/method[@name='setInputData']" name="managedReturn">AndroidX.Work.WorkRequest.Builder</attr>
<attr path="/api/package[@name='androidx.work']/class[@name='WorkRequest.Builder']/method[@name='setPeriodStartTime']" name="managedReturn">AndroidX.Work.WorkRequest.Builder</attr>
<attr path="/api/package[@name='androidx.work']/class[@name='WorkRequest.Builder']/method[@name='setScheduleRequestedAt']" name="managedReturn">AndroidX.Work.WorkRequest.Builder</attr>
<attr path="/api/package[@name='androidx.work']/class[@name='WorkRequest.Builder']/method[@name='setId']" name="managedReturn">AndroidX.Work.WorkRequest.Builder</attr>

<remove-node
path="/api/package[@name='androidx.work']/class[@name='WorkRequest.Builder']/typeParameters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,4 +343,12 @@
path="/api/package[@name='com.google.protobuf']/class[@name='LazyStringArrayList']/method[@name='addAll' and count(parameter)=2 and parameter[1][@type='int'] and parameter[2][@type='java.util.Collection&lt;? extends java.lang.String&gt;']]"
/>

<!-- Workaround generator can't detect this was implemented as an explicitly implemented interface member on a base class -->
<attr
path="/api/package[@name='com.google.protobuf']/class[@name='AbstractProtobufList']"
name="skipInvokerMethods"
>
java/util/SequencedCollection.reversed()Ljava/util/SequencedCollection;
</attr>

</metadata>
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
<remove-node path="/api/package[@name='kotlin.text']/class[@name='StringsKt___StringsKt']/method[@name='filterIndexed' and count(parameter)=2 and parameter[1][@type='java.lang.String'] and parameter[2][@type='kotlin.jvm.functions.Function2&lt;? super java.lang.Integer, ? super java.lang.Character, java.lang.Boolean&gt;']]" />
<remove-node path="/api/package[@name='kotlin.text']/class[@name='StringsKt___StringsKt']/method[@name='filterNot' and count(parameter)=2 and parameter[1][@type='java.lang.String'] and parameter[2][@type='kotlin.jvm.functions.Function1&lt;? super java.lang.Character, java.lang.Boolean&gt;']]" />
<remove-node path="/api/package[@name='kotlin.text']/class[@name='StringsKt___StringsKt']/method[@name='onEach' and count(parameter)=2 and parameter[1][@type='S'] and parameter[2][@type='kotlin.jvm.functions.Function1&lt;? super java.lang.Character, kotlin.Unit&gt;']]/typeParameters" />
<attr path="/api/package[@name='kotlin.text']/class[@name='StringsKt___StringsKt']/method[@name='onEach' and count(parameter)=2 and parameter[1][@type='S'] and parameter[2][@type='kotlin.jvm.functions.Function1&lt;? super java.lang.Character, kotlin.Unit&gt;']]" name="return">java.lang.CharSequence</attr>
<attr path="/api/package[@name='kotlin.text']/class[@name='StringsKt___StringsKt']/method[@name='onEach' and count(parameter)=2 and parameter[1][@type='S'] and parameter[2][@type='kotlin.jvm.functions.Function1&lt;? super java.lang.Character, kotlin.Unit&gt;']]/parameter[1]" name="type">java.lang.CharSequence</attr>
<remove-node path="/api/package[@name='kotlin.text']/class[@name='StringsKt___StringsKt']/method[@name='slice' and count(parameter)=2 and parameter[1][@type='java.lang.String'] and parameter[2][@type='kotlin.ranges.IntRange']]" />
<remove-node path="/api/package[@name='kotlin.text']/class[@name='StringsKt___StringsKt']/method[@name='take' and count(parameter)=2 and parameter[1][@type='java.lang.String'] and parameter[2][@type='int']]" />
Expand Down Expand Up @@ -444,4 +445,26 @@

<remove-node path="/api/package[@name='kotlin.collections.builders']/class[@name='AbstractMapBuilderEntrySet']/method[@name='contains' and count(parameter)=1 and parameter[1][@type='java.lang.Object']]" />

</metadata>
<!-- Workaround generator can't detect this was implemented as an explicitly implemented interface member on a base class -->
<attr
path="/api/package[@name='kotlin.collections']/class[@name='AbstractMutableList']"
name="skipInvokerMethods"
>
java/util/SequencedCollection.reversed()Ljava/util/SequencedCollection;
</attr>

<attr
path="/api/package[@name='kotlin.collections']/class[@name='AbstractList']"
name="skipInvokerMethods"
>
java/util/SequencedCollection.reversed()Ljava/util/SequencedCollection;
</attr>

<!-- Workaround generator doesn't know that `java.util.IList` provides a DIM for this method -->
<attr
path="/api/package[@name='kotlin.collections']/class[@name='AbstractList']"
name="skipInterfaceMethods"
>
java/util/SequencedCollection.reversed()Ljava/util/SequencedCollection;
</attr>
</metadata>
2 changes: 2 additions & 0 deletions tests/common/NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
<package pattern="Microsoft.AspNetCore.*" />
<package pattern="Microsoft.Extensions.*" />
<package pattern="Microsoft.Graphics.*" />
<package pattern="Microsoft.IO.*" />
<package pattern="Microsoft.iOS.*" />
<package pattern="Microsoft.MacCatalyst.*" />
<package pattern="Microsoft.Maui.*" />
<package pattern="Microsoft.NET.*" />
<package pattern="Microsoft.NETCore.*" />
<package pattern="Microsoft.Web.*" />
<package pattern="Microsoft.Windows.*" />
<package pattern="Microsoft.WindowsAppSDK" />
<package pattern="Microsoft.WindowsDesktop.*" />
Expand Down
Loading