Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnojima committed Mar 15, 2019
1 parent 734fc06 commit c6edc03
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions shared/desktop/yarn-helper/index.js
Expand Up @@ -30,11 +30,59 @@ const commands = {
// storybook uses react-docgen which really cr*ps itself with flow
// I couldn't find a good way to override this effectively (yarn resolutions didn't work) so we're just killing it with fire
makeShims()
fixLottie()
},
help: '',
},
}

function fixLottie() {
// hardcode a fix for lotties busted build for now TODO remove this when its updated
const replacement = `
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

apply plugin: 'com.android.library'
apply from: 'gradle-maven-push.gradle'

android {
compileSdkVersion safeExtGet('compileSdkVersion', 26)
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')
publishNonDefault true

defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 26)
}

lintOptions {
disable 'InvalidPackage'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}

dependencies {
compileOnly "com.facebook.react:react-native:+"
implementation 'com.airbnb.android:lottie:2.5.5'
// KB:
api("com.android.support:appcompat-v7:28.0.0")
}
`
const root = path.resolve(__dirname, '..', '..', 'node_modules', 'lottie-react-native', 'src', 'android')
try {
fs.mkdirSync(root)
} catch (_) {}

try {
fs.writeFileSync(path.join(root, 'build.gradle'), replacement)
} catch (_) {}
}

function makeShims() {
const root = path.resolve(__dirname, '..', '..', 'node_modules', 'babel-plugin-react-docgen')

Expand Down

0 comments on commit c6edc03

Please sign in to comment.