mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
Android Builder was modernized to the latest Google stacks. It is compatible with latest build tools version (33) and android (13). The following PR covers: - Migration from deprecated DX to D8 - Migrate from deprecated jarsigner to apksigner - Android Builder works now for both POSIX and Windows - There is no possibility to lunch SDK and AVD managers, the tools that we spawned previously are deprecated. We will need to write our own wrappers for console tools if we want to support that. - Android Builder now parsers AndroidManifest.xml file and informs Android NDK project about minAndroidSdk version from this file. This helps to avoid warnings in the build process.
49 lines
947 B
C++
49 lines
947 B
C++
#include "Android.h"
|
|
|
|
#define METHOD_NAME "AndroidManifest::" << UPP_FUNCTION_NAME << "(): "
|
|
|
|
namespace Upp {
|
|
|
|
AndroidManifest::AndroidManifest(const String& path)
|
|
: path(path)
|
|
{
|
|
}
|
|
|
|
AndroidManifest::~AndroidManifest()
|
|
{
|
|
}
|
|
|
|
bool AndroidManifest::Parse()
|
|
{
|
|
String xml = LoadFile(path);
|
|
if (xml.IsVoid()) {
|
|
Loge() << METHOD_NAME << "Failed to load manifest file \"" + path + "\".";
|
|
return false;
|
|
}
|
|
|
|
try {
|
|
XmlParser p(xml);
|
|
while(!p.IsTag()) {
|
|
p.Skip();
|
|
}
|
|
p.PassTag("manifest");
|
|
while (!p.End()) {
|
|
if(p.TagE("uses-sdk")) {
|
|
uses_sdk.Create();
|
|
|
|
uses_sdk->minSdkVersion = p.Int("android:minSdkVersion");
|
|
uses_sdk->targetSdkVersion = p.Int("android:targetSdkVersion");
|
|
uses_sdk->maxSdkVersion = p.Int("android:maxSdkVersion");
|
|
}
|
|
|
|
p.Skip();
|
|
}
|
|
} catch(const XmlError& e) {
|
|
Loge() << METHOD_NAME << "Failed to parse manifest file with error \"" + e + "\".";
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
}
|