Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 365827f

Browse files
authored
chore(test-app): fix Android build (segmentio#10)
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
1 parent 7535510 commit 365827f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env node
2+
3+
// As of today (Oct 23) react-native is broken on Android
4+
// We're fixing this by patching the repository order in the main gradle file of the Android project
5+
// See:
6+
// - https://github.com/facebook/react-native/pull/21910
7+
// - https://github.com/facebook/react-native/issues/21907#issuecomment-432319128
8+
9+
const fs = require('fs')
10+
const path = require('path')
11+
12+
const gradlePath = path.resolve(__dirname, 'project/android/build.gradle')
13+
14+
fs.writeFileSync(
15+
gradlePath,
16+
fs
17+
.readFileSync(gradlePath, 'utf-8')
18+
.replace(/google\(\)/g, '')
19+
.replace(/jcenter\(\)/g, 'google()\njcenter()')
20+
)

packages/test-app/generate.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ analytics
3232
.setup('$SEGMENT_WRITE_TOKEN')
3333
.then(() => console.log('Analytics ready'))
3434
EOF
35+
36+
../android-workaround.js

0 commit comments

Comments
 (0)