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

[Xamarin.Android.Build.Tasks] deprecate <GetAdditionalResourcesFromAssemblies/> #3654

Merged
merged 1 commit into from
Sep 20, 2019

Conversation

jonathanpeppers
Copy link
Member

The <GetAdditionalResourcesFromAssemblies/> MSBuild task is the
precursor to Xamarin.Build.Download. It is only used by very old
versions of the Xamarin support library components.

We want to deprecate its behavior in an effort to remove complexity
and improve build performance. We have to scan each assembly for these
assembly-level attributes.

I added a new XA0121 warning if a library is encountered during a
build that uses these attributes:

  • IncludeAndroidResourcesFromAttribute
  • NativeLibraryReferenceAttribute
  • JavaLibraryReferenceAttribute

I added [Obsolete] on these as well.

…semblies/>

The `<GetAdditionalResourcesFromAssemblies/>` MSBuild task is the
precursor to Xamarin.Build.Download. It is only used by very old
versions of the Xamarin support library components.

We want to deprecate its behavior in an effort to remove complexity
and improve build performance. We have to scan each assembly for these
assembly-level attributes.

I added a new `XA0121` warning if a library is encountered during a
build that uses these attributes:

* `IncludeAndroidResourcesFromAttribute`
* `NativeLibraryReferenceAttribute`
* `JavaLibraryReferenceAttribute`

I added `[Obsolete]` on these as well.
@jonpryor jonpryor merged commit 4aa4eae into dotnet:master Sep 20, 2019
jonpryor pushed a commit that referenced this pull request Sep 20, 2019
…semblies/> (#3654)

The `<GetAdditionalResourcesFromAssemblies/>` MSBuild task is the
precursor to the [Xamarin.Build.Download NuGet package][0].
It is only used by very old versions of the Xamarin support library
components.

We want to deprecate its behavior in an effort to remove complexity
and improve build performance.  We have to scan each assembly for
these assembly-level attributes.

I added a new `XA0121` warning if a library is encountered during a
build that uses these attributes:

  * `IncludeAndroidResourcesFromAttribute`
  * `NativeLibraryReferenceAttribute`
  * `JavaLibraryReferenceAttribute`

I added `[Obsolete]` on these attributes as well.

[0]: https://www.nuget.org/packages/Xamarin.Build.Download/
@jonathanpeppers jonathanpeppers deleted the deprecate-getadditional branch September 20, 2019 20:18
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Nov 1, 2019
Context: dotnet#3654
Context: https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.1#xa0121-deprecation-warning-for-old-xamarinandroidsupport-library-versions

In VS 16.4 / Xamarin.Android 10.1, we deprecated
`<GetAdditionalResourcesFromAssemblies/>`.

This PR removes the behavior completely for 16.5, since it uses SHA1.
We aim to remove all SHA1 and MD5 usage for 16.5.

NuGet packages I've seen that no longer work:

* Android Support Libraries, 25.x and older
* Google Play Services older than 44.x

I have still been able to use an old Xamarin.Forms (2.3.4) in
combination with newer support libraries.

~~ XA0121 is now an error ~~

We give a build error now in `<FilterAssemblies/>` if we encounter the
unsupported attributes. This target runs very early in the build, so
we have to do it at this point.

~~ JcwGen-Tests ~~

These tests were using these attributes such as:

    [assembly: Android.IncludeAndroidResourcesFromAttribute ("./",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Java.Interop.JavaLibraryReference ("classes.jar",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Android.NativeLibraryReference ("arm64-v8a/libsimple.so",
        SourceUrl="file:///NativeLib.zip", Version="native-lib-1")]

Instead, I switched to use `@(LibraryProjectZip)` for the `.aar` file
and `@(EmbeddedNativeLibrary)` for the `.so` files.

~~ Designer Tests ~~

The designer tests build the MyDriving app:

https://github.com/Azure-Samples/MyDriving

Which uses old NuGet packages that now fail, and is now in read-only
mode on Github. I suspect we may just need to remove that test?

    error XA0121: Assembly 'Xamarin.Android.Support.CustomTabs' is using
        '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported.
        Use a newer version of this NuGet package or notify the library author.
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Nov 1, 2019
Context: dotnet#3654
Context: https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.1#xa0121-deprecation-warning-for-old-xamarinandroidsupport-library-versions

In VS 16.4 / Xamarin.Android 10.1, we deprecated
`<GetAdditionalResourcesFromAssemblies/>`.

This PR removes the behavior completely for 16.5, since it uses SHA1.
We aim to remove all SHA1 and MD5 usage for 16.5.

NuGet packages I've seen that no longer work:

* Android Support Libraries, 25.x and older
* Google Play Services older than 44.x

I have still been able to use an old Xamarin.Forms (2.3.4) in
combination with newer support libraries.

~~ XA0121 is now an error ~~

We give a build error now in `<FilterAssemblies/>` if we encounter the
unsupported attributes. This target runs very early in the build, so
we have to do it at this point.

~~ JcwGen-Tests ~~

These tests were using these attributes such as:

    [assembly: Android.IncludeAndroidResourcesFromAttribute ("./",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Java.Interop.JavaLibraryReference ("classes.jar",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Android.NativeLibraryReference ("arm64-v8a/libsimple.so",
        SourceUrl="file:///NativeLib.zip", Version="native-lib-1")]

Instead, I switched to use `@(LibraryProjectZip)` for the `.aar` file
and `@(EmbeddedNativeLibrary)` for the `.so` files.

~~ Designer Tests ~~

The designer tests build the MyDriving app:

https://github.com/Azure-Samples/MyDriving

Which uses old NuGet packages that now fail, and is now in read-only
mode on Github. I suspect we may just need to remove that test?

    error XA0121: Assembly 'Xamarin.Android.Support.CustomTabs' is using
        '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported.
        Use a newer version of this NuGet package or notify the library author.
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Nov 7, 2019
Context: dotnet#3654
Context: https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.1#xa0121-deprecation-warning-for-old-xamarinandroidsupport-library-versions

In VS 16.4 / Xamarin.Android 10.1, we deprecated
`<GetAdditionalResourcesFromAssemblies/>`.

This PR removes the behavior completely for 16.5, since it uses SHA1.
We aim to remove all SHA1 and MD5 usage for 16.5.

NuGet packages I've seen that no longer work:

* Android Support Libraries, 25.x and older
* Google Play Services older than 44.x

I have still been able to use an old Xamarin.Forms (2.3.4) in
combination with newer support libraries.

~~ XA0121 is now an error ~~

We give a build error now in `<FilterAssemblies/>` if we encounter the
unsupported attributes. This target runs very early in the build, so
we have to do it at this point.

~~ JcwGen-Tests ~~

These tests were using these attributes such as:

    [assembly: Android.IncludeAndroidResourcesFromAttribute ("./",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Java.Interop.JavaLibraryReference ("classes.jar",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Android.NativeLibraryReference ("arm64-v8a/libsimple.so",
        SourceUrl="file:///NativeLib.zip", Version="native-lib-1")]

Instead, I switched to use `@(LibraryProjectZip)` for the `.aar` file
and `@(EmbeddedNativeLibrary)` for the `.so` files.

~~ Designer Tests ~~

The designer tests build the MyDriving app:

https://github.com/Azure-Samples/MyDriving

Which uses old NuGet packages that now fail, and is now in read-only
mode on Github. I suspect we may just need to remove that test?

    error XA0121: Assembly 'Xamarin.Android.Support.CustomTabs' is using
        '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported.
        Use a newer version of this NuGet package or notify the library author.
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Nov 7, 2019
Context: dotnet#3654
Context: https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.1#xa0121-deprecation-warning-for-old-xamarinandroidsupport-library-versions

In VS 16.4 / Xamarin.Android 10.1, we deprecated
`<GetAdditionalResourcesFromAssemblies/>`.

This PR removes the behavior completely for 16.5, since it uses SHA1.
We aim to remove all SHA1 and MD5 usage for 16.5.

NuGet packages I've seen that no longer work:

* Android Support Libraries, 25.x and older
* Google Play Services older than 44.x

I have still been able to use an old Xamarin.Forms (2.3.4) in
combination with newer support libraries.

~~ XA0121 is now an error ~~

We give a build error now in `<FilterAssemblies/>` if we encounter the
unsupported attributes. This target runs very early in the build, so
we have to do it at this point.

~~ JcwGen-Tests ~~

These tests were using these attributes such as:

    [assembly: Android.IncludeAndroidResourcesFromAttribute ("./",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Java.Interop.JavaLibraryReference ("classes.jar",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Android.NativeLibraryReference ("arm64-v8a/libsimple.so",
        SourceUrl="file:///NativeLib.zip", Version="native-lib-1")]

Instead, I switched to use `@(LibraryProjectZip)` for the `.aar` file
and `@(EmbeddedNativeLibrary)` for the `.so` files.

~~ Designer Tests ~~

The designer tests build the MyDriving app:

https://github.com/Azure-Samples/MyDriving

Which uses old NuGet packages that now fail, and is now in read-only
mode on Github. I suspect we may just need to remove that test?

    error XA0121: Assembly 'Xamarin.Android.Support.CustomTabs' is using
        '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported.
        Use a newer version of this NuGet package or notify the library author.
dellis1972 pushed a commit that referenced this pull request Nov 11, 2019
…3857)

Context: #3654
Context: https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.1#xa0121-deprecation-warning-for-old-xamarinandroidsupport-library-versions

In VS 16.4 / Xamarin.Android 10.1, we deprecated
`<GetAdditionalResourcesFromAssemblies/>`.

This PR removes the behavior completely for 16.5, since it uses SHA1.
We aim to remove all SHA1 and MD5 usage for 16.5.

NuGet packages I've seen that no longer work:

* Android Support Libraries, 25.x and older
* Google Play Services older than 44.x

I have still been able to use an old Xamarin.Forms (2.3.4) in
combination with newer support libraries.

~~ XA0121 is now an error ~~

We give a build error now in `<FilterAssemblies/>` if we encounter the
unsupported attributes. This target runs very early in the build, so
we have to do it at this point.

~~ JcwGen-Tests ~~

These tests were using these attributes such as:

    [assembly: Android.IncludeAndroidResourcesFromAttribute ("./",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Java.Interop.JavaLibraryReference ("classes.jar",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Android.NativeLibraryReference ("arm64-v8a/libsimple.so",
        SourceUrl="file:///NativeLib.zip", Version="native-lib-1")]

Instead, I switched to use `@(LibraryProjectZip)` for the `.aar` file
and `@(EmbeddedNativeLibrary)` for the `.so` files.

~~ Designer Tests ~~

The designer tests build the MyDriving app:

https://github.com/Azure-Samples/MyDriving

Which uses old NuGet packages that now fail, and is now in read-only
mode on Github. I suspect we may just need to remove that test?

    error XA0121: Assembly 'Xamarin.Android.Support.CustomTabs' is using
        '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported.
        Use a newer version of this NuGet package or notify the library author.
jonpryor pushed a commit that referenced this pull request Nov 20, 2019
…3857)

Context: #3654
Context: https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.1#xa0121-deprecation-warning-for-old-xamarinandroidsupport-library-versions

In VS 16.4 / Xamarin.Android 10.1, we deprecated
`<GetAdditionalResourcesFromAssemblies/>`.

This PR removes the behavior completely for 16.5, since it uses SHA1.
We aim to remove all SHA1 and MD5 usage for 16.5.

NuGet packages I've seen that no longer work:

* Android Support Libraries, 25.x and older
* Google Play Services older than 44.x

I have still been able to use an old Xamarin.Forms (2.3.4) in
combination with newer support libraries.

~~ XA0121 is now an error ~~

We give a build error now in `<FilterAssemblies/>` if we encounter the
unsupported attributes. This target runs very early in the build, so
we have to do it at this point.

~~ JcwGen-Tests ~~

These tests were using these attributes such as:

    [assembly: Android.IncludeAndroidResourcesFromAttribute ("./",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Java.Interop.JavaLibraryReference ("classes.jar",
        SourceUrl="file:///JavaLib.zip")]
    [assembly: Android.NativeLibraryReference ("arm64-v8a/libsimple.so",
        SourceUrl="file:///NativeLib.zip", Version="native-lib-1")]

Instead, I switched to use `@(LibraryProjectZip)` for the `.aar` file
and `@(EmbeddedNativeLibrary)` for the `.so` files.

~~ Designer Tests ~~

The designer tests build the MyDriving app:

https://github.com/Azure-Samples/MyDriving

Which uses old NuGet packages that now fail, and is now in read-only
mode on Github. I suspect we may just need to remove that test?

    error XA0121: Assembly 'Xamarin.Android.Support.CustomTabs' is using
        '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported.
        Use a newer version of this NuGet package or notify the library author.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants