Skip to content

Commit 73bf2c2

Browse files
committed
First Pass at using Resource Designer assembly [WIP]
Context dotnet#6310 Ignore Java.Interop-Tests IntermediateDir Try StrongNaming. Based on code in https://github.com/brutaldev/StrongNameSigner/blob/master/src/Brutal.Dev.StrongNameSigner/SigningHelper.cs Use ICSharpCode.Decompiler to read Resource Designer Assembly Fix breakage Fix error with Aapt2 R.txt Use latest Xamarin.Forms for dotnet tests Disable StrongNaming for now Removed unused code and logging Remove StrongNaming support Revert "Remove StrongNaming support" This reverts commit 7f90638f1788adfa37c4ec4ab3fed9fc48569cb5. Use a cstom snk for the designer strong name Update apkdesc Change to Microsoft.Android.Resource.Designer new test Move CryptoConvert to src-ThirdParty Add StrongNameSigner code and TPN Fix missing file Fix another build error Fix a test Update and Fix the UnitTest update docs Switch to _Microsoft.Android.Resource.Designer.dll update apkdesc update apkdesc
1 parent 0ee174c commit 73bf2c2

File tree

70 files changed

+2640
-327
lines changed

Some content is hidden

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

70 files changed

+2640
-327
lines changed

Documentation/guides/building-apps/build-properties.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,32 @@ To suppress the default AOT profiles, set the property to `false`.
13511351

13521352
Added in Xamarin.Android 10.1.
13531353

1354+
## AndroidUseDesignerAssembly
1355+
1356+
A bool property which controls if the build system will generate an
1357+
`_Microsoft.Android.Resource.Designer.dll` as apposed to a `Resource.Designer.cs` file. The benefits of this are smaller applications and
1358+
faster startup time.
1359+
1360+
The default value is `true`.
1361+
1362+
This setting is not backward compatible with Classic Xamarin.Android.
1363+
So as a Nuget Author it is recommended that you ship three versions of
1364+
the assembly if you want to maintain backward compatibility.
1365+
One for MonoAndroid one for net6.0-android and
1366+
one for net8.0-android. You can do this by using [Xamarin.Legacy.Sdk](https://www.nuget.org/packages/Xamarin.Legacy.Sdk).
1367+
1368+
```
1369+
<TargetFrameworks>monoandroid90;net6.0-android;net8.0-android</TargetFrameworks>
1370+
```
1371+
1372+
Alternatively turn this setting off until such time as both Classic and
1373+
net7.0-android have been deprecated.
1374+
1375+
.NET Projects which choose to turn this setting off will not be able to
1376+
consume references which do use it.
1377+
1378+
Added in .NET 8. Unsupported in Classic Xamarin.Android.
1379+
13541380
## AndroidUseInterpreter
13551381

13561382
A boolean property that causes the `.apk` to contain the mono

build-tools/installers/create-installers.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@
303303
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.CSharp.targets" ExcludeFromAndroidNETSdk="true" />
304304
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.D8.targets" />
305305
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Designer.targets" />
306+
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Resource.Designer.targets" />
306307
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.DesignTime.targets" />
307308
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.EmbeddedResource.targets" />
308309
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.FSharp.targets" ExcludeFromAndroidNETSdk="true" />
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
5+
namespace Xamarin.Android.Prepare
6+
{
7+
[TPN]
8+
class StrongNameSigner_TPN : ThirdPartyNotice
9+
{
10+
static readonly Uri url = new Uri ("https://github.com/brutaldev/StrongNameSigner/");
11+
12+
public override string LicenseFile => string.Empty;
13+
public override string Name => "brutaldev/StrongNameSigner";
14+
public override Uri SourceUrl => url;
15+
public override string LicenseText => @"
16+
Copyright (c) Werner van Deventer ([email protected]). All rights reserved.
17+
18+
Licensed under the Apache License, Version 2.0 (the 'License'); you
19+
may not use this file except in compliance with the License. You may
20+
obtain a copy of the License at
21+
22+
http://www.apache.org/licenses/LICENSE-2.0
23+
24+
Unless required by applicable law or agreed to in writing, software
25+
distributed under the License is distributed on an 'AS IS' BASIS,
26+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
27+
implied. See the License for the specific language governing permissions
28+
and limitations under the License.
29+
";
30+
31+
public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps;
32+
}
33+
}

0 commit comments

Comments
 (0)