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

[DO NOT MERGE] Manual updates 20231226 androidx.health #835

Open
wants to merge 70 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
471df7a
binderator clean
moljac Dec 24, 2023
838d85f
health metadata
moljac Dec 24, 2023
d546f64
Update Metadata.xml
moljac Jan 6, 2024
8599325
connect client metadata
moljac Jan 8, 2024
ce4d7e9
services-clietn done
moljac Jan 8, 2024
9883cbd
Merge branch 'main' into mu-20231226-androidx.health
moljac Jan 8, 2024
5ea1e4d
Update build.cake
moljac Jan 9, 2024
330c264
Merge branch 'main' into mu-20231226-androidx.health
moljac Jan 9, 2024
6f5850d
simplyfied metadata
moljac Jan 9, 2024
75c7917
Metadata fixes
moljac Jan 13, 2024
89bef8c
fix for case when nuget is not installed
moljac Jan 18, 2024
c9d20c5
Merge branch 'main' into mu-20231226-androidx.health
moljac Jan 23, 2024
1237b67
Merge branch 'main' into mu-20231226-androidx.health
moljac Feb 9, 2024
04b2f3f
Merge branch 'main' into mu-20231226-androidx.health
moljac Feb 9, 2024
7409b94
renaming repackaged.jar files
moljac Feb 10, 2024
5b61225
renaming repackaged.jar
moljac Feb 10, 2024
4c23eef
Merge branch 'main' into mu-20231226-androidx.health
moljac Feb 19, 2024
2ff7128
Merge branch 'main' into mu-20231226-androidx.health
moljac Feb 21, 2024
88601c8
Update build.cake
moljac Feb 22, 2024
8268f5a
Merge branch 'mu-20231226-androidx.health' of https://github.com/xama…
moljac Feb 22, 2024
32514b3
Merge branch 'main' into mu-20231226-androidx.health
moljac Feb 25, 2024
dc4c9a6
Merge branch 'main' into mu-20231226-androidx.health
moljac Mar 2, 2024
a4e676a
Merge branch 'main' into mu-20231226-androidx.health
moljac Mar 21, 2024
d53e079
Update build.cake
moljac Mar 22, 2024
fa5c5ac
Merge branch 'main' into mu-20231226-androidx.health
moljac Apr 3, 2024
7e767c8
Merge branch 'main' into mu-20231226-androidx.health
moljac Apr 10, 2024
576de1a
Merge branch 'main' into mu-20231226-androidx.health
moljac Apr 15, 2024
677b1aa
Merge branch 'main' into mu-20231226-androidx.health
moljac Apr 29, 2024
d8ac69f
Merge branch 'main' into mu-20231226-androidx.health
moljac May 1, 2024
4478f90
Merge branch 'main' into mu-20231226-androidx.health
moljac May 2, 2024
9232491
Merge branch 'main' into mu-20231226-androidx.health
moljac May 9, 2024
9df382f
Merge branch 'main' into mu-20231226-androidx.health
moljac May 16, 2024
3b85a2f
removed androidx.health:health-connect-client (seems deprecated)
moljac May 21, 2024
31e9f69
sample fixes for health
moljac May 21, 2024
c449536
spellchecking
moljac May 21, 2024
8a6b29e
automatic files
moljac May 21, 2024
9a654b4
namespace fixes
moljac May 21, 2024
946303c
namespace that was missed
moljac May 21, 2024
1531be7
Update published-namespaces.txt
moljac May 21, 2024
18bd54c
Update published-namespaces.txt
moljac May 21, 2024
6d82d6f
Merge branch 'main' into mu-20231226-androidx.health
moljac May 21, 2024
4440532
added missing package
moljac May 29, 2024
4ffffa7
Merge branch 'main' into mu-20231226-androidx.health
moljac Jun 3, 2024
26be10d
Merge branch 'main' into mu-20231226-androidx.health
moljac Jun 7, 2024
f4c384c
Merge branch 'main' into mu-20231226-androidx.health
moljac Jun 11, 2024
7da76a7
Merge branch 'main' into mu-20231226-androidx.health
moljac Jun 12, 2024
c4e73b7
Merge branch 'main' into mu-20231226-androidx.health
moljac Jun 15, 2024
ce22b37
automatic files
moljac Jun 15, 2024
7d6ef31
apps fixes
moljac Jun 15, 2024
cc6b97f
Merge branch 'mu-20231226-androidx.health' of https://github.com/xama…
moljac Jun 15, 2024
75ea50f
Merge branch 'main' into mu-20231226-androidx.health
moljac Jun 17, 2024
6975e44
Merge branch 'main' into mu-20231226-androidx.health
moljac Jun 18, 2024
3a88df4
automatic files
moljac Jun 23, 2024
91ff402
Merge branch 'main' into mu-20231226-androidx.health
moljac Jun 30, 2024
dd6f2cb
automatic files
moljac Jul 1, 2024
eb8fe9f
bumped androidx.health.connect
Jul 4, 2024
23c7a47
Merge branch 'main' into mu-20231226-androidx.health
moljac Jul 5, 2024
dc847ba
Merge branch 'mu-20231226-androidx.health' into mu-20231226-androidx.…
moljac Jul 5, 2024
d1b0833
Merge pull request #919 from EagleDelux/mu-20231226-androidx.health
moljac Jul 5, 2024
b2d79e5
bumped androidx.health
Jul 6, 2024
249ac4a
Merge pull request #920 from EagleDelux/mu-20231226-androidx.health
moljac Jul 8, 2024
9a55008
Merge branch 'main' into mu-20231226-androidx.health
moljac Jul 8, 2024
845939b
version from main
moljac Jul 8, 2024
6a48906
automatic files
moljac Jul 8, 2024
5541588
Update artifact-list-with-versions.md
moljac Jul 8, 2024
e095fa1
Merge branch 'main' into mu-20231226-androidx.health
moljac Jul 13, 2024
17118a3
Update artifact-list-with-versions.md
moljac Jul 14, 2024
6bba0af
Merge branch 'main' into mu-20231226-androidx.health
moljac Jul 29, 2024
2a34bdc
automatic files
moljac Jul 29, 2024
2c53874
Merge branch 'main' into mu-20231226-androidx.health
moljac Jul 30, 2024
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
6 changes: 4 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,10 @@
<AndroidNamespaceReplacement Include='Pulltorefresh' Replacement='PullToRefresh' />
<AndroidNamespaceReplacement Include='OkIO' Replacement='OkIO' />
<AndroidNamespaceReplacement Include='Atomicfu' Replacement='AtomicFU' />
<AndroidNamespaceReplacement Include='Emojipicker' Replacement='EmojiPicker' />

<AndroidNamespaceReplacement Include='Datanotification' Replacement='DataNotification' />
<AndroidNamespaceReplacement Include='Foregroundstate' Replacement='ForegroundState' />
<AndroidNamespaceReplacement Include='Sdkservice' Replacement='SdkService' />
<AndroidNamespaceReplacement Include='Emojipicker' Replacement='EmojiPicker' />
<AndroidNamespaceReplacement Include='privacysandbox' Replacement='PrivacySandbox' />
<AndroidNamespaceReplacement Include='adservices' Replacement='AdServices' />
<AndroidNamespaceReplacement Include='adid' Replacement='AdId' />
Expand Down
220 changes: 166 additions & 54 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,16 @@ Task ("binderate")
}

// different lint.jar files in artifacts causing R8 errors
foreach (var file in GetFiles("./externals/**/lint.jar")) {
foreach (var file in GetFiles("./externals/**/lint.jar"))
{
Information($"Deleting: {file}");
DeleteFile(file);

foreach (var aar in GetFiles($"{file.GetDirectory()}/../*.aar")) {
foreach (var aar in GetFiles($"{file.GetDirectory()}/../*.aar"))
{
Information($"Deleting: lint.jar from {aar}");
using (var zipFile = new ICSharpCode.SharpZipLib.Zip.ZipFile(aar.ToString())) {
using (var zipFile = new ICSharpCode.SharpZipLib.Zip.ZipFile(aar.ToString()))
{
zipFile.BeginUpdate();
var entry = zipFile.GetEntry("lint.jar");
if (entry != null) {
Expand All @@ -302,11 +305,117 @@ Task ("binderate")
}
}
}

DirectoryPath dp = Context.Environment.WorkingDirectory;
Information($"WorkingDirectory: {dp}");
foreach (FilePath fp in GetFiles("./externals/**/repackaged.jar"))
{
string relative = fp.ToString().Replace(dp.ToString(), "");
relative = relative.Replace(@"/externals", "");
relative = relative.Replace(@"/libs", "");
Information($" Renaming: {relative}");
string[] parts = relative.Split(new string[]{"/"}, StringSplitOptions.RemoveEmptyEntries);
string group_id = parts[0];
string artifact_id = parts[1];
Information($" 1 : {group_id}");
Information($" 2 : {artifact_id}");

string version = artifacts_with_verions[(group_id, artifact_id)];
string name_old = "repackaged.jar";
string name_new = $"repackaged-{artifact_id.Replace(".", "-")}-{parts[1]}-{version.Replace(".", "-")}.jar";
MoveFile
(
$"externals/{group_id}/{artifact_id}/libs/{name_old}",
$"externals/{group_id}/{artifact_id}/libs/{name_new}"
);
MoveFile
(
$"externals/{group_id}/{artifact_id}.aar",
$"externals/{group_id}/{artifact_id}.original.aar"
);
Zip
(
$"externals/{group_id}/{artifact_id}/",
$"externals/{group_id}/{artifact_id}.aar"
);

// find ./externals -type f -iname "*repack*"

foreach (var aar in GetFiles($"{fp.GetDirectory()}/../*.aar"))
{
Information($"Renaming: repackaged.jar from {aar}");
/*
Cannot rename
using (var zipFile = new ICSharpCode.SharpZipLib.Zip.ZipFile(aar.ToString()))
{
zipFile.BeginUpdate();
CSharpCode.SharpZipLib.Zip.ZipEntry entry_old = zipFile.GetEntry("repackaged.jar");
CSharpCode.SharpZipLib.Zip.ZipEntry entry_new = zipFile.Clone();
if (entry != null)
{
Information($" Renaming {name_old} from {aar} to {name_new}");
zipFile.Delete(entry_old);
zipFile.Add(entry_new);
}
zipFile.CommitUpdate();
}

using
(
var archive = new System.IO.Compression.ZipArchive
(
System.IO.File.Open
(
fp.ToString(),
FileMode.Open,
FileAccess.ReadWrite
),
System.IO.Compression.ZipArchiveMode.Update
)
)
{
var entries = archive.Entries.ToArray();
foreach (var entry_old in entries)
{
if(entry_old.Name.Contains(name_old))
{
Information($" Zip updating {fp.ToString()}");
var entry_new = archive.CreateEntry(entry_old.Name.Replace(name_old, name_new));
using (var entry_old_opened = entry_old.Open())
{
using (var entry_new_opened = entry_new.Open())
{
entry_old_opened.CopyTo(entry_new_opened);
entry_old.Delete();
}
}
}
}
}
*/
}

}

// foreach (FilePath file in GetFiles("./externals/**/repackaged.jar"))
// {
// string[] parts = file.ToString().Split(new char[]{'/', '\\'}, StringSplitOptions.None);
// string aid = parts[parts.Length - 3];
// string gid = parts[parts.Length - 4].Replace(".", "-");
// string v = artifacts_with_verions[(gid, aid)];
// string file_new = file.ToString().Replace("repackaged", $"repackaged-{gid}-{aid}");
// Information($"Renaming: {file}");
// Information($" to: {file_new}");
// MoveFile(file, file_new);
// }

return;
});

string version_suffix = "";
string nuget_version_template = $"x.y.z.w{version_suffix}";
JArray binderator_json_array = null;
Dictionary<(string gid, string aid), string> artifacts_with_verions = null;

Task("binderate-config-verify")
.IsDependentOn("binderate-fix")
Expand All @@ -323,6 +432,8 @@ Task("binderate-config-verify")
}
}

artifacts_with_verions = new Dictionary<(string gid, string aid), string >();

Information("config.json verification...");
foreach(JObject jo in binderator_json_array[0]["artifacts"])
{
Expand All @@ -331,9 +442,15 @@ Task("binderate-config-verify")
{
continue;
}

string group_id = (string) jo["groupId"];
string artifact_id = (string) jo["artifactId"];
string artifact_version = (string) jo["version"];
string nuget_id = (string) jo["nugetId"];
string nuget_version = (string) jo["nugetVersion"];

Information($"Verifying : {group_id}:{artifact_id}:{artifact_version}");

string[] artifact_version_parts = artifact_version.Split(new string[]{ "-" }, StringSplitOptions.RemoveEmptyEntries);
string[] nuget_version_parts = nuget_version.Split(new string[]{ "-" }, StringSplitOptions.RemoveEmptyEntries);

Expand All @@ -351,15 +468,15 @@ Task("binderate-config-verify")
artifact_version_suffix = artifact_version_parts[1];
}

Information($"groupId = {jo["groupId"]}");
Information($"artifactId = {jo["artifactId"]}");
Information($"groupId = {group_id}");
Information($"artifactId = {artifact_id}");
Information($"artifact_version = {artifact_version}");
Information($"artifact_version_prefix = {artifact_version_prefix}");
Information($"artifact_version_suffix = {artifact_version_suffix}");
Information($"nuget_version = {nuget_version}");
Information($"nuget_version_prefix = {nuget_version_prefix}");
Information($"nuget_version_suffix = {nuget_version_suffix}");
Information($"nugetId = {jo["nugetId"]}");
Information($"nugetId = {nuget_id}");


string[] artifact_version_prefix_parts = artifact_version_prefix.Split(new string[]{ "." }, StringSplitOptions.RemoveEmptyEntries);
Expand Down Expand Up @@ -395,17 +512,19 @@ Task("binderate-config-verify")
)
{
Error("check config.json for nuget id");
Error ($" groupId = {jo["groupId"]}");
Error ($" artifactId = {jo["artifactId"]}");
Error ($" groupId = {group_id}");
Error ($" artifactId = {artifact_id}");
Error ($" artifact_version = {artifact_version}");
Error ($" nuget_version = {nuget_version}");
Error ($" nuget_version_new = {nuget_version_new}");
Error ($" nugetId = {jo["nugetId"]}");
Error ($" nugetId = {nuget_id}");

Warning($" expected : ");
Warning($" nuget_version = {nuget_version_new}");
throw new Exception("check config.json for nuget id");
}

artifacts_with_verions.Add((group_id, artifact_id), artifact_version);
}

return;
Expand Down Expand Up @@ -449,7 +568,7 @@ Task("binderate-fix")
}
}

Warning("config.json fixing missing folder strucutre ...");
Warning("config.json fixing missing folder structure ...");
foreach(JObject jo in binderator_json_array[0]["artifacts"])
{
string groupId = (string) jo["groupId"];
Expand Down Expand Up @@ -630,31 +749,26 @@ Task("libs")
.IsDependentOn("libs-native")
.Does(() =>
{
DotNetMSBuildSettings settings = new DotNetMSBuildSettings()
.SetConfiguration(CONFIGURATION)
.SetMaxCpuCount(0)
.EnableBinaryLogger($"./output/libs.{CONFIGURATION}.binlog")
.WithProperty("MigrationPackageVersion", MIGRATION_PACKAGE_VERSION)
.WithProperty("Verbosity", VERBOSITY.ToString())
.WithProperty("DesignTimeBuild", "false")
.WithProperty("AndroidSdkBuildToolsVersion", $"{AndroidSdkBuildTools}");
DotNetBuildSettings settings = new DotNetBuildSettings()
{
Configuration = CONFIGURATION,
MSBuildSettings = new DotNetMSBuildSettings()
.SetMaxCpuCount(0)
.EnableBinaryLogger($"./output/libs.{CONFIGURATION}.binlog")
.WithProperty("MigrationPackageVersion", MIGRATION_PACKAGE_VERSION)
.WithProperty("DesignTimeBuild", "false")
.WithProperty("AndroidSdkBuildToolsVersion", $"{AndroidSdkBuildTools}")
};

if (!string.IsNullOrEmpty(ANDROID_HOME))
settings.WithProperty("AndroidSdkDirectory", $"{ANDROID_HOME}");
settings.MSBuildSettings.WithProperty("AndroidSdkDirectory", $"{ANDROID_HOME}");

DotNetRestore("./generated/AndroidX.sln", new DotNetRestoreSettings
{
MSBuildSettings = settings.EnableBinaryLogger("./output/restore.binlog")
MSBuildSettings = settings.MSBuildSettings.EnableBinaryLogger("./output/restore.binlog")
});

DotNetBuild
(
"./generated/AndroidX.sln",
new DotNetBuildSettings
{
MSBuildSettings = settings
}
);
DotNetBuild("./generated/AndroidX.sln", settings);
});

Task("libs-native")
Expand All @@ -676,27 +790,23 @@ Task("nuget")
.IsDependentOn("libs")
.Does(() =>
{
var settings = new DotNetMSBuildSettings()
.SetConfiguration(CONFIGURATION)
.SetMaxCpuCount(0)
.EnableBinaryLogger($"./output/nuget.{CONFIGURATION}.binlog")
.WithProperty("MigrationPackageVersion", MIGRATION_PACKAGE_VERSION)
.WithProperty("NoBuild", "true")
.WithProperty("PackageRequireLicenseAcceptance", "true")
.WithProperty("PackageOutputPath", MakeAbsolute ((DirectoryPath)"./output/").FullPath)
.WithTarget("Pack");
DotNetBuildSettings settings = new DotNetBuildSettings()
{
Configuration = CONFIGURATION,
MSBuildSettings = new DotNetMSBuildSettings()
.SetMaxCpuCount(0)
.EnableBinaryLogger($"./output/nuget.{CONFIGURATION}.binlog")
.WithProperty("MigrationPackageVersion", MIGRATION_PACKAGE_VERSION)
.WithProperty("NoBuild", "true")
.WithProperty("PackageRequireLicenseAcceptance", "true")
.WithProperty("PackageOutputPath", MakeAbsolute ((DirectoryPath)"./output/").FullPath)
.WithTarget("Pack")
};

if (!string.IsNullOrEmpty(ANDROID_HOME))
settings.WithProperty("AndroidSdkDirectory", $"{ANDROID_HOME}");
settings.MSBuildSettings.WithProperty("AndroidSdkDirectory", $"{ANDROID_HOME}");

DotNetBuild
(
"./generated/AndroidX.sln",
new DotNetBuildSettings
{
MSBuildSettings = settings
}
);
DotNetBuild("./generated/AndroidX.sln", settings);
});

Task("samples-generate-all-targets")
Expand Down Expand Up @@ -771,14 +881,16 @@ Task("samples-only-dotnet")
EnsureDirectoryExists(packagesPath);
CleanDirectories(packagesPath);

var settings = new DotNetMSBuildSettings()
.SetConfiguration("Debug") // We don't need to run linking
.WithProperty("Verbosity", VERBOSITY.ToString())
.WithProperty("RestorePackagesPath", packagesPath)
.WithProperty("AndroidSdkBuildToolsVersion", $"{AndroidSdkBuildTools}");
DotNetBuildSettings settings = new DotNetBuildSettings()
{
Configuration = "Debug",
MSBuildSettings = new DotNetMSBuildSettings()
.WithProperty("RestorePackagesPath", packagesPath)
.WithProperty("AndroidSdkBuildToolsVersion", $"{AndroidSdkBuildTools}")
};

if (!string.IsNullOrEmpty(ANDROID_HOME))
settings.WithProperty("AndroidSdkDirectory", $"{ANDROID_HOME}");
settings.MSBuildSettings.WithProperty("AndroidSdkDirectory", $"{ANDROID_HOME}");

string[] solutions = new string[]
{
Expand All @@ -791,10 +903,10 @@ Task("samples-only-dotnet")
FilePath fp_solution = new FilePath(solution);
string filename = fp_solution.GetFilenameWithoutExtension().ToString();
Information($"=====================================================================================================");
Information($"DotNetBuild {solution} / {filename}");
Information($"DotNetBuild {solution} / {filename}");
DotNetBuild(solution, new DotNetBuildSettings
{
MSBuildSettings = settings.EnableBinaryLogger($"./output/samples-dotnet-dotnet-msbuild-{filename}.binlog")
MSBuildSettings = settings.MSBuildSettings.EnableBinaryLogger($"./output/samples-dotnet-dotnet-msbuild-{filename}.binlog")
});
}
});
Expand Down
26 changes: 26 additions & 0 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,32 @@
},
"license": "The Apache Software License, Version 2.0"
},
{
"component": {
"type": "maven",
"maven": {
"artifactId": "health-services-client",
"groupId": "androidx.health",
"version": "1.0.0-rc02",
"nuGetId": "Xamarin.AndroidX.Health.ServicesClient",
"nuGetVersion": "1.0.0-rc02"
}
},
"license": "The Apache Software License, Version 2.0"
},
{
"component": {
"type": "maven",
"maven": {
"artifactId": "connect-client",
"groupId": "androidx.health.connect",
"version": "1.0.0-alpha11",

Choose a reason for hiding this comment

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

why not use the lates version ? 1.1.0-alpha07

"nuGetId": "Xamarin.AndroidX.Health.Connect.ConnectClient",
"nuGetVersion": "1.0.0-alpha11"
}
},
"license": "The Apache Software License, Version 2.0"
},
{
"component": {
"type": "maven",
Expand Down
Loading