infinitered / solidarity-react-native

Solidarity snapshot plugin for React Native projects
MIT License
48 stars 10 forks source link

Android Version in Snapshot #4

Closed GantMan closed 6 years ago

GantMan commented 7 years ago

One tricky thing is trying to find the Android SDK etc. If android is > 25 the location of the version moves. This will make snapshotting to make the rule a little more complicated.

Some hypothetical code for testing...

    // android?
    // if > 25? cat $ANDROID_HOME/platform-tools/source.properties | grep Pkg.Revision
    //   const androidVersion = await system.run(`$ANDROID_HOME/tools/bin/sdkmanager --list | grep 'build-tools;#{ANDROID_SDK}' | tail -1 | awk '{print $3}'`)
    // else?
    //   cat $ANDROID_HOME/tools/source.properties | grep Pkg.Revision
    const androidSDKVersion = await runTrim(`$ANDROID_HOME/tools/android list sdk | grep 'SDK Tools' | tail -1 | awk '{print $6}'`)
GantMan commented 6 years ago

Parsable version available on <= 24 image

GantMan commented 6 years ago

upgrading to 25 to see what detections work well there.

GantMan commented 6 years ago

Move this logic over to envinfo.