0

I generally like to automatically bake-in the results of a git describe --always --dirty in any website, app, etc I am developing so that I can easily trace behaviors. Right now, I can't figure out a way to get this in a React Native app.

I am using Android, but am certainly looking for a solution to both Android and iOS.

TinyTheBrontosaurus
  • 4,010
  • 6
  • 21
  • 34

1 Answers1

0

I found a way using a mix of other existing answers:

  1. Call git-describe during the build to access from gradle
  2. Call PackageManager to access the gradle config from Java
  3. Then use a React NativeModule in Java to access from JS

Update (3 years later): Here's a minimal diff that shows how to implement in Android.

TinyTheBrontosaurus
  • 4,010
  • 6
  • 21
  • 34