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

Improve Android doc (triplets, usage with cmake and prefab) #11264

Merged
merged 9 commits into from
May 13, 2020

Conversation

pthom
Copy link
Contributor

@pthom pthom commented May 9, 2020

Describe your PR

Improve Android prefab and triplet doc

What does your PR fix?

This PR can may be considered as a fix for two issues that arise because of incomplete doc

Which triplets are supported/not supported? Have you updated the CI baseline?

Not applicable, this is doc only

Does your PR follow the maintainer guide?

Yes

@atkawa7
Copy link
Contributor

atkawa7 commented May 9, 2020

@pthom @strega-nil looks good to me

@pthom
Copy link
Contributor Author

pthom commented May 9, 2020

@atkawa7 : if you have a few minutes, would you mind giving me some help on this pr: #11269

My issue is that I now can built a prefab package, but I do not know how to consume it (and thus test it). As a newbie to android development, the prefab doc was not that helpful for this.

@atkawa7
Copy link
Contributor

atkawa7 commented May 9, 2020

@pthom I forgot another option which shows examples on how to consume it. Add this option --prefab-debug

./vcpkg export --triplet arm64-android jsoncpp --prefab --prefab-maven --prefab-debug

Output

[DEBUG] Configuration properties in Android Studio
In app/build.gradle

	com.vcpkg.ndk.support:jsoncpp:1.9.2

And cmake flags

    externalNativeBuild {
                cmake {
                    arguments '-DANDROID_STL=c++_shared'
                    cppFlags "-std=c++17"
                }
            }

In gradle.properties

    android.enablePrefab=true
    android.enableParallelJsonGen=false
    android.prefabVersion=${prefab.version}

Note: prefab packages are supported on Android Studio 4+

If you have Android 3.6 you might need to install android 4.1 Preview

@atkawa7
Copy link
Contributor

atkawa7 commented May 9, 2020

@pthom checkout the following project that I created to consume the packages created

https://github.com/atkawa7/prefab-vpkg-integration-sample

@pthom pthom marked this pull request as draft May 10, 2020 11:53
pthom added 3 commits May 10, 2020 15:49
Following additional informations given by @atkawa7 at
microsoft#11264

* Link to android.md
* Update the prefab usage instructions: "vcpkg install"
    the 4 archs before exporting a prefab
* added --prefab-debug flag
* added gradle integration info
* reviewed the prefab output directory structure
  (from a dump of an actual export)
@pthom pthom changed the title Improve Android prefab and triplet doc Improve Android doc (triplets, usage with cmake and prefab) May 10, 2020
@pthom pthom marked this pull request as ready for review May 10, 2020 13:53
@pthom
Copy link
Contributor Author

pthom commented May 10, 2020

@atkawa7
Copy link
Contributor

atkawa7 commented May 10, 2020

@pthom looks good to me

@strega-nil
Copy link
Contributor

Please poke me when you think the documentation is ready to merge; I don't know anything about android, and so I'm just going to trust your judgement :)

@atkawa7
Copy link
Contributor

atkawa7 commented May 11, 2020

@strega-nil I think the documentation in its current form is good. I think @pthom addressed issues that new users might come across when consuming android archive packages. I don't know if there is still anything to be added @pthom. I am sure as more issues related to android come up we will continue to improve the docs and address concerns users might have

pthom added 2 commits May 12, 2020 13:34
….cmake

Usage:

1. Main CMakeLists:
  if (VCPKG_TARGET_ANDROID)
      include("cmake/vcpkg_android.cmake")
  endif()

2. cmake invocation:
  cmake .. -DVCPKG_TARGET_ANDROID=ON -DANDROID_ABI=armeabi-v7a
@pthom
Copy link
Contributor Author

pthom commented May 12, 2020

I added a second example

It provides a script vcpkg_android.cmake

The usage is even simpler:

  1. Main CMakeList, before calling project()
if (VCPKG_TARGET_ANDROID)
    include("cmake/vcpkg_android.cmake")
endif()
  1. cmake invocation:
cmake .. -DVCPKG_TARGET_ANDROID=ON -DANDROID_ABI=armeabi-v7a

I have successfuly tested on two vanillla installations of vcpkg under linux and MacOS.

@atkawa7 @strega-nil : if this looks good to you, the PR is ok on my side too

@strega-nil
Copy link
Contributor

Alright, awesome! Thanks everyone, and @pthom especially. Y'all make this project so good!

@strega-nil strega-nil merged commit 55be137 into microsoft:master May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eliminate bad error reporting "Value was null" android support
5 participants