Skip to content

Add androidx.health.connect bindings to support HealthConnect Records IRecord interface #1208

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

Draft
wants to merge 6 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
39 changes: 39 additions & 0 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1756,6 +1756,45 @@
},
"license": "The Apache Software License, Version 2.0"
},
{
"component": {
"type": "maven",
"maven": {
"artifactId": "connect-client",
"groupId": "androidx.health.connect",
"version": "1.1.0-rc02",
"nuGetId": "Xamarin.AndroidX.Health.Connect.ConnectClient",
"nuGetVersion": "1.1.0.1-rc02"
}
},
"license": "The Apache Software License, Version 2.0"
},
{
"component": {
"type": "maven",
"maven": {
"artifactId": "connect-client-external-protobuf",
"groupId": "androidx.health.connect",
"version": "1.1.0-rc02",
"nuGetId": "Xamarin.AndroidX.Health.Connect.ConnectClientExternalProtobuf",
"nuGetVersion": "1.1.0.1-rc02"
}
},
"license": "The Apache Software License, Version 2.0"
},
{
"component": {
"type": "maven",
"maven": {
"artifactId": "connect-client-proto",
"groupId": "androidx.health.connect",
"version": "1.1.0-rc02",
"nuGetId": "Xamarin.AndroidX.Health.Connect.ConnectClientProto",
"nuGetVersion": "1.1.0.1-rc02"
}
},
"license": "The Apache Software License, Version 2.0"
},
{
"component": {
"type": "maven",
Expand Down
21 changes: 21 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,27 @@
"nugetVersion": "1.1.0.2",
"nugetId": "Xamarin.AndroidX.GridLayout"
},
{
"groupId": "androidx.health.connect",
"artifactId": "connect-client",
"version": "1.1.0-rc02",
"nugetVersion": "1.1.0.1-rc02",
"nugetId": "Xamarin.AndroidX.Health.Connect.ConnectClient"
},
{
"groupId": "androidx.health.connect",
"artifactId": "connect-client-external-protobuf",
"version": "1.1.0-rc02",
"nugetVersion": "1.1.0.1-rc02",
"nugetId": "Xamarin.AndroidX.Health.Connect.ConnectClientExternalProtobuf"
Copy link
Member

Choose a reason for hiding this comment

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

This one has many errors, can we <remove-node/> all the C# code? Such as:

I don't think we should try to fix the 700+ errors for this 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.

Added Transforms.xml file to remove all C# code from the external protobuf package as requested. The transform uses <remove-node path="/api/package" /> to exclude all generated APIs, following the same pattern as the Google Guava package.

},
{
"groupId": "androidx.health.connect",
"artifactId": "connect-client-proto",
"version": "1.1.0-rc02",
"nugetVersion": "1.1.0.1-rc02",
"nugetId": "Xamarin.AndroidX.Health.Connect.ConnectClientProto"
},
Copy link
Member

Choose a reason for hiding this comment

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

You would need to also run:

dotnet cake utilities.cake -t=generate-component-governance
dotnet cake utilities.cake -t=generate-namespace-file
dotnet cake utilities.cake -t=list-artifacts

And commit the changes from those files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Completed all three utility commands as requested:

  • dotnet cake utilities.cake -t=generate-component-governance - Updated cgmanifest.json
  • dotnet cake utilities.cake -t=generate-namespace-file - Updated published-namespaces.txt
  • dotnet cake utilities.cake -t=list-artifacts - Updated artifact list files

All changes committed in 605bcb5.

Copy link
Member

Choose a reason for hiding this comment

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

There must be an additional package that's missing:

D:\a\_work\1\s\generated\androidx.health.connect.connect-client\androidx.health.connect.connect-client.csproj : error NU1101: Unable to find package Xamarin.AndroidX.Health.Connect.ConnectClientExternalProtobuf. No packages exist with this id in source(s): C:\ToolCache\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org [D:\a\_work\1\s\generated\AndroidX.sln]
D:\a\_work\1\s\generated\androidx.health.connect.connect-client-proto\androidx.health.connect.connect-client-proto.csproj : error NU1101: Unable to find package Xamarin.AndroidX.Health.Connect.ConnectClientExternalProtobuf. No packages exist with this id in source(s): C:\ToolCache\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org [D:\a\_work\1\s\generated\AndroidX.sln]

If you're able to fix this, run the cake targets again: generate-component-governance, generate-namespace-file.

If you're not able to fix, tell me the errors and what you think.

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 the missing package issue. The problem was that androidx.health.connect:connect-client-external-protobuf was marked as dependencyOnly: true in config.json, preventing the binderator from generating a standalone binding project for it. However, the connect-client-proto project needed to reference it as a PackageReference.

Removed the dependencyOnly flag, regenerated projects with binderator, and ran all three utility commands as requested. The external protobuf package should now be available for other projects to reference. Committed in 953a688.

{
"groupId": "androidx.heifwriter",
"artifactId": "heifwriter",
Expand Down
1,037 changes: 520 additions & 517 deletions docs/artifact-list-with-versions.md

Large diffs are not rendered by default.

1,037 changes: 520 additions & 517 deletions docs/artifact-list.md

Large diffs are not rendered by default.

Loading