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

FR: Add more helper API relate to config files patching into this package #690

Open
Thaina opened this issue Jun 15, 2024 · 1 comment
Open

Comments

@Thaina
Copy link

Thaina commented Jun 15, 2024

Feature proposal

  • EDM4U Component: Android Resolver, iOS Resolver

Since this package is very widely used for everyone developing in android and ios. Dependencies.xml mechanic is very amazing. So I think it would be more beneficial if this package also have mechanism to do patching to Info.plist and AndroidManifest.xml also various res/values/ xml files

Specifically things that related to adding and verifying key/value, query if the key and value already existed. Handling of android namespace (using System.Xml directly is very difficult at this). And generating required values of 3rd party packages for android and ios, which always required for package like google signin and firebase

It wouldn't need to be xml declarative pattern, I wish we would just have some C# editor API we can use to write our own IPostprocessBuildWithReport

Such as

using EDM4U.Helper.Android;

//// IPostGenerateGradleAndroidProject.OnPostGenerateGradleAndroidProject

var xmlElement = AndroidManifestHelper.GetOrCreateMetaDataWithAndroidName("com.google.android.gms.games.APP_ID");
// get meta-data in manifest/application that has attribute android:name=com.google.android.gms.games.APP_ID

xmlElement.SetAndroidValue(appId); // Extension method to set android:value=XXXXXXXX
using EDM4U.Helper.iOS;

//// IPostprocessBuildWithReport.OnPostprocessBuild

var info = new PlistDocument();
info.ReadFromFile(plistPath);

var plistArrayCFBUT = info.root.GetOrCreateArray("CFBundleURLTypes"); // extension method in PListHelper
if(!plistArrayCFBUT.values.Any( /* any dict with CFBundleURLTypes contain reversedClientID */ ))
{
	var dict = plistArrayCFBUT.AddDict();
	dict.SetString("CFBundleTypeRole","Editor");
	dict.GetOrCreateArray("CFBundleURLSchemes").AddString(reversedClientID);
}

Actually I have seen similar feature exist in firebase core. I think it would be better if it was moved into this repo so that it can be utilized by almost all of google dependent package

@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@Thaina Thaina changed the title [FR] Add more helper API relate to config files patching into this package FR: Add more helper API relate to config files patching into this package Jun 15, 2024
@argzdev argzdev removed the new to be triaged label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants