Skip to content

Commit

Permalink
patch podfile to fix github runner old version macos expo/expo#25905
Browse files Browse the repository at this point in the history
  • Loading branch information
jowparks committed Mar 26, 2024
1 parent d2e0e0c commit f52fec0
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/testflight.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
npx nx cargo-ios ironfish-native-module -- --target='ios'
npx nx cargo-android ironfish-native-module
- name: Patch podfile fix expo bug
run: |
npx nx patch-podfile mobile-app
- name: prebuild
run: |
Expand Down
36 changes: 31 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions packages/ironfish-native-module/scripts/cargo-ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,7 @@ function main() {
if (!fs.existsSync(destinationPath)) {
fs.mkdirSync(destinationPath, { recursive: true });
}
try {
const output = spawnSync("find /Users/runner/work/mobile-wallet -type f", {
encoding: "utf8",
});
console.log(output);
} catch (error) {
console.error("Error occurred:", error);
}

fs.copyFileSync(rustLibPath, path.join(destinationPath, libFileName));
fs.copyFileSync(rustHeaderPath, path.join(destinationPath, headerFileName));
}
Expand Down
12 changes: 7 additions & 5 deletions packages/mobile-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"prebuild": "expo prebuild"
"prebuild": "expo prebuild",
"patch-podfile": "tsx scripts/patch-podfile.ts"
},
"dependencies": {
"@ironfish/ui": "*",
"expo": "^50.0.0",
"expo-status-bar": "~1.11.1",
"ironfish-native-module": "*",
"react": "18.2.0",
"react-native": "0.73.6",
"@ironfish/ui": "*",
"ironfish-native-module": "*"
"react-native": "0.73.6"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/react": "~18.2.45"
"@types/react": "~18.2.45",
"tsx": "^4.7.1"
},
"private": true
}
25 changes: 25 additions & 0 deletions packages/mobile-app/scripts/patch-podfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Required to fix bug (for github runner) https://github.com/expo/expo/issues/25905
import fs from 'fs';
import path from 'path';

const podfilePath = path.join(__dirname, '../ios/Podfile');

function main() {
fs.readFile(podfilePath, 'utf8', (err, data) => {
if (err) {
console.log(err);
return;
}

const result = data.replace(
/target 'mobileapp' do/g,
"use_modular_headers!\ntarget 'mobileapp' do",
);

fs.writeFile(podfilePath, result, 'utf8', (err) => {
if (err) console.log(err);
});
});
}

main();

0 comments on commit f52fec0

Please sign in to comment.