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

Move remaining GPS packages to AndroidX repository. #955

Merged
merged 1 commit into from
Sep 13, 2024
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<!-- .NET 6+ generates Resource.designer.cs files for bindings projects which we do not want -->
<AndroidGenerateResourceDesigner>false</AndroidGenerateResourceDesigner>

<!-- .NET 6+ packages support back to API-21 -->
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>

Expand Down
64 changes: 51 additions & 13 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#load "build/cake/update-config.cake"
#load "build/cake/tests.cake"
#load "build/cake/gps-parameters.cake"

using System.Text.RegularExpressions;
using System.Xml;
Expand Down Expand Up @@ -270,6 +271,7 @@ Task("javadocs")
});

Task ("binderate")
.IsDependentOn("javadocs-gps")
.IsDependentOn("binderate-config-verify")
.Does (() =>
{
Expand Down Expand Up @@ -361,15 +363,15 @@ Task("binderate-config-verify")
artifact_version_suffix = artifact_version_parts[1];
}

Information($"groupId = {jo["groupId"]}");
Information($"artifactId = {jo["artifactId"]}");
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($"groupId = {jo["groupId"]}");
//Information($"artifactId = {jo["artifactId"]}");
//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"]}");


string[] artifact_version_prefix_parts = artifact_version_prefix.Split(new string[]{ "." }, StringSplitOptions.RemoveEmptyEntries);
Expand All @@ -395,7 +397,7 @@ Task("binderate-config-verify")
nuget_version_new += $"-{nuget_version_suffix}";
}

Information($"nuget_version_new = {nuget_version_new}");
//Information($"nuget_version_new = {nuget_version_new}");

if
(
Expand Down Expand Up @@ -465,9 +467,9 @@ Task("binderate-fix")
string groupId = (string) jo["groupId"];
string artifactId = (string) jo["artifactId"];

Information($" Verifying files for :");
Information($" group : {groupId}");
Information($" artifact : {artifactId}");
//Information($" Verifying files for :");
//Information($" group : {groupId}");
//Information($" artifact : {artifactId}");

bool? dependency_only = (bool?) jo["dependencyOnly"];
if ( dependency_only == true)
Expand Down Expand Up @@ -679,6 +681,42 @@ Task("libs-native")

CopyFileToDirectory($"{root}/extensions-aar/build/outputs/aar/extensions-aar-release.aar", outputDir);
Unzip($"{outputDir}/extensions-aar-release.aar", outputDir);

root = "./source/com.google.android.play/core.extensions/";

RunGradle(root, "build");

outputDir = "./externals/com.xamarin.google.android.play.core.extensions/";
EnsureDirectoryExists(outputDir);
CleanDirectories(outputDir);

CopyFileToDirectory($"{root}/extensions-aar/build/outputs/aar/extensions-aar-release.aar", outputDir);
Unzip($"{outputDir}/extensions-aar-release.aar", outputDir);
MoveFile($"{outputDir}/classes.jar", $"{outputDir}/extensions.jar");

root = "./source/com.google.android.play/asset.delivery.extensions/";

RunGradle(root, "build");

outputDir = "./externals/com.xamarin.google.android.play.asset.delivery.extensions/";
EnsureDirectoryExists(outputDir);
CleanDirectories(outputDir);

CopyFileToDirectory($"{root}/extensions-aar/build/outputs/aar/extensions-aar-release.aar", outputDir);
Unzip($"{outputDir}/extensions-aar-release.aar", outputDir);
MoveFile($"{outputDir}/classes.jar", $"{outputDir}/extensions.jar");

root = "./source/com.google.android.play/feature.delivery.extensions/";

RunGradle(root, "build");

outputDir = "./externals/com.xamarin.google.android.play.feature.delivery.extensions/";
EnsureDirectoryExists(outputDir);
CleanDirectories(outputDir);

CopyFileToDirectory($"{root}/extensions-aar/build/outputs/aar/extensions-aar-release.aar", outputDir);
Unzip($"{outputDir}/extensions-aar-release.aar", outputDir);
MoveFile($"{outputDir}/classes.jar", $"{outputDir}/extensions.jar");
});

Task("nuget")
Expand Down
40 changes: 40 additions & 0 deletions build/cake/gps-parameters.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Contains tasks for retrieving pre-generated parameter names for some GPS packages.
// Ideally these days this could be replaced with `<JavaDocJar>` or `<AndroidSourceJar>`,
// but for now we'll just copy what was in the GPS repository.

var REF_DOCS_FILE = "./build/data/docs/play-services-firebase.zip";
var REF_METADATA_FILE = "./build/data/paramnames/play-services-firebase-metadata.xml";
var REF_PARAMNAMES_FILE = "./build/data/paramnames/play-services-firebase-paramnames.txt";

// Extracts parameter names and places them in the right spot for the GPS template
Task ("javadocs-gps")
.Does (() =>
{
EnsureDirectoryExists ("./externals/");

if (!FileExists ("./externals/docs.zip"))
CopyFile (REF_DOCS_FILE, "./externals/docs.zip");

if (!DirectoryExists ("./externals/docs"))
Unzip ("./externals/docs.zip", "./externals/docs");

if (!FileExists ("./externals/paramnames.txt"))
CopyFile (REF_PARAMNAMES_FILE, "./externals/paramnames.txt");

if (!FileExists ("./externals/paramnames.xml"))
CopyFile (REF_METADATA_FILE, "./externals/paramnames.xml");

return;

var astJar = new FilePath ("./util/JavaASTParameterNames-1.0.jar");
var sourcesJars = GetFiles ("./externals/**/*-sources.jar");

foreach (var srcJar in sourcesJars) {
var srcJarPath = MakeAbsolute (srcJar).FullPath;
var outTxtPath = srcJarPath.Replace ("-sources.jar", "-paramnames.txt");
var outXmlPath = srcJarPath.Replace ("-sources.jar", "-paramnames.xml");

StartProcess ("java", "-jar \"" + MakeAbsolute(astJar).FullPath + "\" --text \"" + srcJarPath + "\" \"" + outTxtPath + "\"");
StartProcess ("java", "-jar \"" + MakeAbsolute(astJar).FullPath + "\" --xml \"" + srcJarPath + "\" \"" + outXmlPath + "\"");
}
});
2 changes: 1 addition & 1 deletion build/ci/stage-extended-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ stages:
- template: job-extended-tests.yml
parameters:
jobName: Android
agentCount: 10
agentCount: 20
testFilter: cat = Android
testProject: $(extendedTestProject)
testAssembly: $(extendedTestAssembly)
Expand Down
Binary file added build/data/docs/play-services-firebase.zip
Binary file not shown.
Loading
Loading