Skip to content

Conversation

@moljac
Copy link
Contributor

@moljac moljac commented Aug 11, 2023

Does this change any of the generated binding API's?

yes. New bindings +

Describe your contribution

Updated packages + new dependencies:

  • androidx.browser:browser - 1.5.0 -> 1.6.0
  • androidx.compose.animation:animation - 1.4.3 -> 1.5.0
  • androidx.compose.animation:animation-android - -> 1.5.0
  • androidx.compose.animation:animation-core - 1.4.3 -> 1.5.0
  • androidx.compose.animation:animation-core-android - -> 1.5.0
  • androidx.compose.animation:animation-graphics - 1.4.3 -> 1.5.0
  • androidx.compose.animation:animation-graphics-android - -> 1.5.0
  • androidx.compose.foundation:foundation - 1.4.3 -> 1.5.0
  • androidx.compose.foundation:foundation-android - -> 1.5.0
  • androidx.compose.foundation:foundation-layout - 1.4.3 -> 1.5.0
  • androidx.compose.foundation:foundation-layout-android - -> 1.5.0
  • androidx.compose.material:material - 1.4.3 -> 1.5.0
  • androidx.compose.material:material-android - -> 1.5.0
  • androidx.compose.material:material-icons-core - 1.4.3 -> 1.5.0
  • androidx.compose.material:material-icons-core-android - -> 1.5.0
  • androidx.compose.material:material-icons-extended - 1.4.3 -> 1.5.0
  • androidx.compose.material:material-icons-extended-android - -> 1.5.0
  • androidx.compose.material:material-ripple - 1.4.3 -> 1.5.0
  • androidx.compose.material:material-ripple-android - -> 1.5.0
  • androidx.compose.runtime:runtime - 1.4.3 -> 1.5.0
  • androidx.compose.runtime:runtime-android - -> 1.5.0
  • androidx.compose.runtime:runtime-livedata - 1.4.3 -> 1.5.0
  • androidx.compose.runtime:runtime-rxjava2 - 1.4.3 -> 1.5.0
  • androidx.compose.runtime:runtime-rxjava3 - 1.4.3 -> 1.5.0
  • androidx.compose.runtime:runtime-saveable - 1.4.3 -> 1.5.0
  • androidx.compose.runtime:runtime-saveable-android - -> 1.5.0
  • androidx.compose.ui:ui - 1.4.3 -> 1.5.0
  • androidx.compose.ui:ui-android - -> 1.5.0
  • androidx.compose.ui:ui-geometry - 1.4.3 -> 1.5.0
  • androidx.compose.ui:ui-geometry-android - -> 1.5.0
  • androidx.compose.ui:ui-graphics - 1.4.3 -> 1.5.0
  • androidx.compose.ui:ui-graphics-android - -> 1.5.0
  • androidx.compose.ui:ui-text - 1.4.3 -> 1.5.0
  • androidx.compose.ui:ui-text-android - -> 1.5.0
  • androidx.compose.ui:ui-tooling - 1.4.3 -> 1.5.0
  • androidx.compose.ui:ui-tooling-android - -> 1.5.0
  • androidx.compose.ui:ui-tooling-data - 1.4.3 -> 1.5.0
  • androidx.compose.ui:ui-tooling-data-android - -> 1.5.0
  • androidx.compose.ui:ui-tooling-preview - 1.4.3 -> 1.5.0
  • androidx.compose.ui:ui-tooling-preview-android - -> 1.5.0
  • androidx.compose.ui:ui-unit - 1.4.3 -> 1.5.0
  • androidx.compose.ui:ui-unit-android - -> 1.5.0
  • androidx.compose.ui:ui-util - 1.4.3 -> 1.5.0
  • androidx.compose.ui:ui-util-android - -> 1.5.0
  • androidx.compose.ui:ui-viewbinding - 1.4.3 -> 1.5.0
  • androidx.emoji2:emoji2 - 1.3.0 -> 1.4.0
  • androidx.emoji2:emoji2-viewshelper - 1.3.0 -> 1.4.0
  • androidx.navigation:navigation-common - 2.6.0 -> 2.7.0
  • androidx.navigation:navigation-common-ktx - 2.6.0 -> 2.7.0
  • androidx.navigation:navigation-compose - 2.6.0 -> 2.7.0
  • androidx.navigation:navigation-fragment - 2.6.0 -> 2.7.0
  • androidx.navigation:navigation-fragment-ktx - 2.6.0 -> 2.7.0
  • androidx.navigation:navigation-runtime - 2.6.0 -> 2.7.0
  • androidx.navigation:navigation-runtime-ktx - 2.6.0 -> 2.7.0
  • androidx.navigation:navigation-ui - 2.6.0 -> 2.7.0
  • androidx.navigation:navigation-ui-ktx - 2.6.0 -> 2.7.0
  • androidx.preference:preference-ktx - 1.2.0 -> 1.2.1
  • androidx.wear:wear - 1.2.0 -> 1.3.0
  • androidx.wear.compose:compose-foundation - 1.1.2 -> 1.2.0
  • androidx.wear.compose:compose-material - 1.1.2 -> 1.2.0
  • androidx.wear.compose:compose-material-core - -> 1.2.0
  • androidx.wear.compose:compose-navigation - 1.1.2 -> 1.2.0
  • androidx.wear.protolayout:protolayout - -> 1.0.0
  • androidx.wear.protolayout:protolayout-expression - -> 1.0.0
  • androidx.wear.protolayout:protolayout-expression-pipeline - -> 1.0.0
  • androidx.wear.protolayout:protolayout-proto - -> 1.0.0

@moljac moljac marked this pull request as draft August 11, 2023 07:31
@moljac moljac marked this pull request as ready for review August 22, 2023 09:06
@moljac moljac requested a review from jpobst August 22, 2023 09:06
Copy link
Contributor

@jpobst jpobst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, we had decided that we would not provide C# bindings for Compose, only the Java packages needed at runtime. This was so that people wouldn't expect to be able to use them to create Compose layouts (which is only supported in Kotlin).

This PR appears to add C# bindings for several of the new Compose packages, should we strip out the bindings and only do Java packages like the others?

"version": "1.0.0",
"nugetVersion": "1.0.0",
"nugetId": "Xamarin.AndroidX.ProtoLayout.Expression",
"excludedRuntimeDependencies": "org.jetbrains.kotlin.kotlin-stdlib",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why exclude kotlin-stdlib? We bind that package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think copypasta.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it was not copypasta without that line binderator crashes:

Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'input')
   at System.Text.RegularExpressions.ThrowHelper.ThrowArgumentNullException(ExceptionArgument arg)
   at MavenNet.MavenVersionRange.Satisfies(String version)
   at MavenNet.Models.Dependency.Satisfies(String version)
   at AndroidBinderator.Engine.<>c__DisplayClass7_0.<BuildProjectModels>b__0(MavenArtifactConfig ma) in C:\a\_work\1\s\util\Xamarin.AndroidBinderator\Xamarin.AndroidBinderator\Engine.cs:line 333
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found)
   at AndroidBinderator.Engine.BuildProjectModels(BindingConfig config, Dictionary`2 mavenProjects) in C:\a\_work\1\s\util\Xamarin.AndroidBinderator\Xamarin.AndroidBinderator\Engine.cs:line 330
   at AndroidBinderator.Engine.ProcessConfig(BindingConfig config) in C:\a\_work\1\s\util\Xamarin.AndroidBinderator\Xamarin.AndroidBinderator\Engine.cs:line 75
   at AndroidBinderator.Engine.BinderateAsync(BindingConfig config) in C:\a\_work\1\s\util\Xamarin.AndroidBinderator\Xamarin.AndroidBinderator\Engine.cs:line 46
   at Xamarin.AndroidBinderator.Tool.Program.Main(String[] args) in C:\a\_work\1\s\util\Xamarin.AndroidBinderator\Xamarin.AndroidBinderator.Tool\Program.cs:line 67
   at Xamarin.AndroidBinderator.Tool.Program.<Main>(String[] args)

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>androidx.wear.protolayout</groupId>
  <artifactId>protolayout-expression</artifactId>
  <version>1.0.0</version>
  <packaging>aar</packaging>
  <name>ProtoLayout Expression</name>
  <description>Create dynamic expressions (for late evaluation by a remote evaluator).</description>
  <url>https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0</url>
  <inceptionYear>2022</inceptionYear>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>The Android Open Source Project</name>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:https://android.googlesource.com/platform/frameworks/support</connection>
    <url>https://cs.android.com/androidx/platform/frameworks/support</url>
  </scm>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>androidx.wear.protolayout</groupId>
        <artifactId>protolayout</artifactId>
        <version>1.0.0</version>
      </dependency>
      <dependency>
        <groupId>androidx.wear.protolayout</groupId>
        <artifactId>protolayout-expression-pipeline</artifactId>
        <version>1.0.0</version>
      </dependency>
      <dependency>
        <groupId>androidx.wear.protolayout</groupId>
        <artifactId>protolayout-material</artifactId>
        <version>1.0.0</version>
      </dependency>
      <dependency>
        <groupId>androidx.wear.protolayout</groupId>
        <artifactId>protolayout-proto</artifactId>
        <version>1.0.0</version>
      </dependency>
      <dependency>
        <groupId>androidx.wear.protolayout</groupId>
        <artifactId>protolayout-renderer</artifactId>
        <version>1.0.0</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>androidx.annotation</groupId>
      <artifactId>annotation</artifactId>
      <version>1.2.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>androidx.annotation</groupId>
      <artifactId>annotation-experimental</artifactId>
      <version>1.3.0</version>
      <scope>runtime</scope>
      <type>aar</type>
    </dependency>
    <dependency>
      <groupId>androidx.collection</groupId>
      <artifactId>collection</artifactId>
      <version>1.2.0</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>androidx.wear.protolayout</groupId>
      <artifactId>protolayout-proto</artifactId>
      <version>[1.0.0]</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib</artifactId>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
</project>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And there is also Wear. missing!!!!!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try adding:

"extraDependencies": "org.jetbrains.kotlin.kotlin-stdlib"

Which should add the dependency to the package using the version we specify in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extraDependencies crashes too.

AndroidX.Compose.Material.Icons.Sharp
AndroidX.Compose.Material.Icons.TwoTone
AndroidX.Compose.Material.Internal
AndroidX.Compose.Material.Pullrefresh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following compound words need capitalization fixes:
PullRefresh
HapticFeedback
CoreShims
DataSource
ViewInterop
MaterialCore
ProtoLayout

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good spot. I opened file, but did not finish it.

@moljac
Copy link
Contributor Author

moljac commented Aug 22, 2023

Previously, we had decided that we would not provide C# bindings for Compose, only the Java packages needed at runtime. This was so that people wouldn't expect to be able to use them to create Compose layouts (which is only supported in Kotlin).

I remember. I skipped those because they did not require metadata and I did not check generated MCWs.

This PR appears to add C# bindings for several of the new Compose packages, should we strip out the bindings and only do Java packages like the others?

For now I will remove MCWs, but in the future I'd like to surface those APIs, but to write docs that it is not usable from C#, hoping we come up with something in the future.

@moljac moljac requested a review from jpobst August 24, 2023 10:57
jpobst
jpobst previously approved these changes Aug 24, 2023
config.json Outdated
"artifactId": "ui-android",
"version": "1.5.0",
"nugetVersion": "1.5.0",
"nugetId": "Xamarin.AndroidX.Compose.UIAndroid",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI.Android

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

"version": "1.0.0",
"nugetVersion": "1.0.0",
"nugetId": "Xamarin.AndroidX.ProtoLayout.Expression",
"excludedRuntimeDependencies": "org.jetbrains.kotlin.kotlin-stdlib",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try adding:

"extraDependencies": "org.jetbrains.kotlin.kotlin-stdlib"

Which should add the dependency to the package using the version we specify in this file.


// Metadata.xml XPath class reference: path="/api/package[@name='androidx.compose.foundation.layout']/class[@name='PaddingValues.Absolute']"
// [global::Android.Runtime.Register ("androidx/compose/foundation/layout/PaddingValues$Absolute", DoNotGenerateAcw=true)]
public sealed partial class PaddingValuesAbsolute //: global::Java.Lang.Object, global::AndroidX.Compose.Foundation.Layout.IPaddingValues
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove or comment this out, as there are no C# bindings in this package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

"artifactId": "animation-graphics-android",
"version": "1.5.0",
"nugetVersion": "1.5.0",
"nugetId": "Xamarin.AndroidX.Compose.Animation.Graphics.Android",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is missing:

<remove-node path="/api/package" />

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were several Metadata files missing, so these were not included in projects and thus no transformation happened and MCWs were created.

I have added metadata and now it should be OK.

jpobst

This comment was marked as resolved.

@jpobst jpobst self-requested a review August 24, 2023 14:40
@jpobst jpobst dismissed their stale review August 24, 2023 14:40

Accidentally hit Approve instead of Comment

@moljac moljac requested a review from jpobst September 7, 2023 16:45
@moljac moljac merged commit 47baae8 into main Sep 10, 2023
@moljac moljac deleted the create-pull-request/patch-1691733771 branch September 10, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants