Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

adding nativeBundle plugin #161

Merged
merged 6 commits into from
Dec 1, 2019
Merged

adding nativeBundle plugin #161

merged 6 commits into from
Dec 1, 2019

Conversation

marandaneto
Copy link
Contributor

@marandaneto marandaneto commented Nov 22, 2019

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

adding 3rd plugin that copies headers and extracts fat aar.

one will need to:

Apply the plugin in the App:

apply plugin: 'com.ydq.android.gradle.native-aar.import'

Reference the extracted binaries in their CMakeLists.txt:

include (${ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK})
target_link_libraries(myapp ${ANDROID_GRADLE_NATIVE_MODULES})

Include the header in their c files:

#include <sentry.h>

💡 Motivation and Context

it's not possible to include sentry.h from native code at the moment, that will make it possible.

💚 How did you test it?

deploying to maven local and including sentry.h and capturing an issue.

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • All tests passing

🔮 Next steps

create a sample of how to include the 3rd plugin and include the headers

build.gradle.kts Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Nov 22, 2019

Codecov Report

Merging #161 into master will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #161      +/-   ##
============================================
+ Coverage     57.73%   57.77%   +0.03%     
- Complexity      526      527       +1     
============================================
  Files            72       72              
  Lines          2522     2522              
  Branches        223      223              
============================================
+ Hits           1456     1457       +1     
  Misses          958      958              
+ Partials        108      107       -1
Impacted Files Coverage Δ Complexity Δ
...c/main/java/io/sentry/core/DirectoryProcessor.java 74.07% <0%> (+3.7%) 7% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9b9098...c32dfa3. Read the comment docs.

@marandaneto marandaneto changed the title WIP - ndk integration adding 3rd plugin that copy headers and extract fat aar Nov 29, 2019
@marandaneto marandaneto changed the title adding 3rd plugin that copy headers and extract fat aar adding 3rd plugin that copies headers and extracts fat aar Nov 29, 2019
@marandaneto marandaneto changed the title adding 3rd plugin that copies headers and extracts fat aar adding nativeBundle plugin Nov 29, 2019
@marandaneto marandaneto marked this pull request as ready for review November 29, 2019 12:22
Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@bruno-garcia
Copy link
Member

@marandaneto can we try on the sample? to consume the bits?

@marandaneto
Copy link
Contributor Author

@marandaneto can we try on the sample? to consume the bits?

the sample won't work because it's referencing the project directly and not a maven dependency.
this will only work with "maven dependencies", that's why it exists.

for this sample, as they are under the same project, we would need to reference the project in the CMakeLists.txt manually as we do on sentry-android-ndk/sentry-native.
we basically need to copy the behavior, using a relative path.
See: howardpang/androidNativeBundle#1

@bruno-garcia
Copy link
Member

is it possible to run a maven install on local maven on build, and on the sample consume from maven local (as opposed to a reference to a project?)

@marandaneto
Copy link
Contributor Author

is it possible to run a maven install on local maven on build, and on the sample consume from maven local (as opposed to a reference to a project?)

yes, I thought to do that, but then we lose debugging.
The tooling is shit :(

@marandaneto marandaneto merged commit 9b5f748 into master Dec 1, 2019
@marandaneto marandaneto deleted the feat/ndk_link branch December 1, 2019 13:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants