Skip to content

Commit

Permalink
Update README with monorepo info for Android (#1476)
Browse files Browse the repository at this point in the history
* Update README with monorepo info for Android

* mention issues in RNVI < 9
  • Loading branch information
samzmann committed Jul 17, 2023
1 parent abae292 commit 6e48dbd
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,39 @@ project.ext.vectoricons = [
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle");
```

<details>
<summary>Monorepo configuration</summary>

<!-- ##### Monorepo configuration -->
<br>
If you are working in a monorepo, you'll need to point to the correct location of the `fonts.gradle` script and of the Font files, **relative to the android/app/build.gradle file**. For example if your repo uses this common structure:


```text
your-monorepo/
├─ node_modules/
│ ├─ react-native-vector-icons
├─ apps/
│ ├─ YourApp/
│ │ ├─ android/
│ │ │ ├─ app/
│ │ │ │ ├─ build.gradle
```

you will need to update the paths to:
```diff
project.ext.vectoricons = [
+ iconFontsDir: "../../../../node_modules/react-native-vector-icons/Fonts",
iconFontNames: ["WhateverFonts", "..."]
]

- apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
+ apply from: "../../../../node_modules/react-native-vector-icons/fonts.gradle
```

⚠️ There have been [reported issues](https://github.com/oblador/react-native-vector-icons/issues/1281#issuecomment-1363201537) when using RNVI < 9.0.0 in a monorepo, so make sure you are on 9+.
</details>

#### Option: Manually

- Copy the contents in the `Fonts` folder to `android/app/src/main/assets/fonts` (_note lowercase fonts folder_).
Expand Down

0 comments on commit 6e48dbd

Please sign in to comment.