From 52b5dfd2efbc576a3073fe335e7694f5d4d4c143 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Mon, 6 Apr 2020 23:36:17 +0200 Subject: Android Support: Exporting to Android Archive (AAR) (#10271) * added android triplets * added android support to vcpkg * added export directories to git ignore * fix libraries naming * added vckpg sources to visual studio project files * rename file location * issue with std::string fs:path copy initialization * format path on VStudio * fix checks format cannot work on fs::path * support header only libraries * support using architecture instead of triplets * added prefab support * added debug logs and prefab debug flag * added support for empty packages i.e openssl --- toolsrc/include/vcpkg/export.prefab.h | 82 +++++++++++++++++++++++++++++++++++ toolsrc/include/vcpkg/triplet.h | 5 +++ toolsrc/include/vcpkg/vcpkgpaths.h | 2 + 3 files changed, 89 insertions(+) create mode 100644 toolsrc/include/vcpkg/export.prefab.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/export.prefab.h b/toolsrc/include/vcpkg/export.prefab.h new file mode 100644 index 000000000..56a5ba371 --- /dev/null +++ b/toolsrc/include/vcpkg/export.prefab.h @@ -0,0 +1,82 @@ +#pragma once + +#include +#include +#include + + +#include + +namespace vcpkg::Export::Prefab +{ + constexpr int kFragmentSize = 3; + + struct Options + { + Optional maybe_group_id; + Optional maybe_artifact_id; + Optional maybe_version; + Optional maybe_min_sdk; + Optional maybe_target_sdk; + bool enable_maven; + bool enable_debug; + }; + struct NdkVersion + { + NdkVersion(int _major, int _minor, int _patch) : m_major{_major}, + m_minor{_minor}, + m_patch{_patch}{ + } + int major() { return this->m_major; } + int minor() { return this->m_minor; } + int patch() { return this->m_patch; } + std::string to_string(); + void to_string(std::string& out); + + private: + int m_major; + int m_minor; + int m_patch; + }; + + struct ABIMetadata + { + std::string abi; + int api; + int ndk; + std::string stl; + std::string to_string(); + }; + + struct PlatformModuleMetadata + { + std::vector export_libraries; + std::string library_name; + std::string to_json(); + }; + + struct ModuleMetadata + { + std::vector export_libraries; + std::string library_name; + PlatformModuleMetadata android; + std::string to_json(); + }; + + struct PackageMetadata + { + std::string name; + int schema; + std::vector dependencies; + std::string version; + std::string to_json(); + }; + + + + void do_export(const std::vector& export_plan, + const VcpkgPaths& paths, + const Options& prefab_options, const Triplet& triplet); + Optional find_ndk_version(const std::string &content); + Optional to_version(const std::string &version); +} diff --git a/toolsrc/include/vcpkg/triplet.h b/toolsrc/include/vcpkg/triplet.h index d836dd230..92ea10175 100644 --- a/toolsrc/include/vcpkg/triplet.h +++ b/toolsrc/include/vcpkg/triplet.h @@ -23,6 +23,11 @@ namespace vcpkg static const Triplet X64_UWP; static const Triplet ARM_UWP; static const Triplet ARM64_UWP; + + static const Triplet ARM_ANDROID; + static const Triplet ARM64_ANDROID; + static const Triplet X86_ANDROID; + static const Triplet X64_ANDROID; const std::string& canonical_name() const; const std::string& to_string() const; diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 63d19af2c..31d8374f1 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -14,6 +14,8 @@ namespace vcpkg namespace Tools { static const std::string SEVEN_ZIP = "7zip"; + static const std::string SEVEN_ZIP_ALT = "7z"; + static const std::string MAVEN = "mvn"; static const std::string CMAKE = "cmake"; static const std::string GIT = "git"; static const std::string NINJA = "ninja"; -- cgit v1.2.3