Skip to content

Commit

Permalink
chore(test-app): fix Android build (#10)
Browse files Browse the repository at this point in the history
CI is broken on Android since today, applying a quick workaround to keep CI green while the react-native team figures it out.

See:
- facebook/react-native#21910
- facebook/react-native#21907
  • Loading branch information
fathyb committed Oct 23, 2018
1 parent 7535510 commit 365827f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/test-app/android-workaround.js
@@ -0,0 +1,20 @@
#!/usr/bin/env node

// As of today (Oct 23) react-native is broken on Android
// We're fixing this by patching the repository order in the main gradle file of the Android project
// See:
// - https://github.com/facebook/react-native/pull/21910
// - https://github.com/facebook/react-native/issues/21907#issuecomment-432319128

const fs = require('fs')
const path = require('path')

const gradlePath = path.resolve(__dirname, 'project/android/build.gradle')

fs.writeFileSync(
gradlePath,
fs
.readFileSync(gradlePath, 'utf-8')
.replace(/google\(\)/g, '')
.replace(/jcenter\(\)/g, 'google()\njcenter()')
)
2 changes: 2 additions & 0 deletions packages/test-app/generate.sh
Expand Up @@ -32,3 +32,5 @@ analytics
.setup('$SEGMENT_WRITE_TOKEN')
.then(() => console.log('Analytics ready'))
EOF

../android-workaround.js

0 comments on commit 365827f

Please sign in to comment.