npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

expo-gradle-ext-vars

v0.1.2

Published

Expo plugin to append custom vars to the root android/build.gradle

Downloads

6,517

Readme

expo-gradle-ext-vars

By Transistor Software, creators of React Native Background Geolocation


A simple Expo Config Plugin for appending Android ext vars to the android/build.gradle. ext vars are a common Android method for configuring project-wide, global configuration properties which can be shared by other plugins in order to avoid dependency conflicts.

A common usage of ext vars is to align Google / AndroidX dependency version across different plugins using the same dependencies. For example:

dependencies {
    implementation "androidx.appcompat:appcompat:${rootProject.ext.appCompatVersion}"
    implementation "com.google.android.gms:play-services-location:${rootProject.ext.playServicesLocationVersion}"
}

Example Result: android/build.gradle

import org.apache.tools.ant.taskdefs.condition.Os

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
+       // @generated begin expo-gradle-ext-vars - expo prebuild (DO NOT MODIFY) sync-8c85b9ad3863726565f7eff0645ac3f5c56ce733
+       googlePlayServicesLocationVersion = "20.0.0"
+       appCompatVersion = "1.4.2"
+       // @generated end expo-gradle-ext-vars

        buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'
        minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')
        compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '31')
        targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31')
        if (findProperty('android.kotlinVersion')) {
            kotlinVersion = findProperty('android.kotlinVersion')
        }
        frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'

        if (System.properties['os.arch'] == 'aarch64') {
            // For M1 Users we need to use the NDK 24 which added support for aarch64
            ndkVersion = '24.0.8215888'
        } else {
            // Otherwise we default to the side-by-side NDK version from AGP.
            ndkVersion = '21.4.7075529'
        }
    }
 }

Installation

npx expo install expo-gradle-ext-vars

Usage

Add the following block to your Expo app's app.json.

:warning: The variables below are only an example. You should only provide variables as prescribed by some other plugin you're installing.

{
  "expo": {
    "plugins": [
      [
        "expo-gradle-ext-vars", {
          "googlePlayServicesLocationVersion": "20.0.0",
          "appCompatVersion": "1.4.2"
        }
      ]
    ]
 }

After adding the plugin, run:

npx expo prebuild