You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: move gnoboard in example/js/expo and simplify the root Makefile (#178)
Gnoboard uses Expo in its dependencies, so we decided to move it in the
`example/js/expo` folder.
The Makefile in the root directory had some rules that compiled the
`node_modules` and the `xcworkspace` for Gnoboard, so I removed them to
be consistent (that was the only example app that had rules in the root
Makefile).
---------
Signed-off-by: D4ryl00 <[email protected]>
Copy file name to clipboardexpand all lines: README.md
+54-120
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,29 @@ These API calls are a programming language-independent wrapper on top of the cor
9
9
10
10
Watch [this Gno Native Kit tutorial](https://www.youtube.com/watch?v=N1HLyQDHGQ0) to easily get started on building and bringing your (d)apps to mobile and desktop.
11
11
12
-
## Build instructions
12
+
## Expo module
13
13
14
-
### Install prerequisites for macOS 13
14
+
To use Gno Native Kit, we advise you to use the Expo module in your Expo React-Native project. Please read the [README](expo/README.md) in the `expo` folder.
15
15
16
-
(If you are on Ubuntu, see the next section to install prerequisites.)
16
+
In the `expo/example` folder, you can find a minimal app using the Expo module.
17
+
18
+
Other examples are available in the `example/js/expo` folder.
19
+
20
+
## Bare React-Native project
21
+
22
+
If you are interested in using Gno Native Kit in a bare React-Native project, please check the `hello` example app in the `example/js/react-native/hello` folder.
23
+
24
+
## Prerequisites for building Gno Native Kit or example apps
25
+
26
+
### Install requirements for macOS 13 and macOS 14
27
+
28
+
(If you are on Ubuntu, see the next section to install requirements.)
17
29
18
30
Install Xcode. To install the Command Line Developer Tools, in a terminal enter:
19
31
20
-
xcode-select --install
32
+
```sh
33
+
xcode-select --install
34
+
```
21
35
22
36
After the Developer Tools are installed, we need to make sure it is updated. In
23
37
System Preferences, click Software Update and update it if needed.
@@ -26,50 +40,69 @@ To install asdf using brew, follow instructions at https://asdf-vm.com . In shor
26
40
first install brew following the instructions at https://brew.sh . Then, in
Start a new terminal to get the changes to the environment.
78
+
Start a new terminal to get the changes to the environment.
56
79
57
-
(optional) To install Android Studio, download the latest
80
+
To install Android Studio, download the latest
58
81
android-studio-{version}-linux.tar.gz from
59
82
https://developer.android.com/studio . (Tested with Jellyfish 2023.3.1 .)
60
83
In a terminal, enter the following with the correct {version}:
61
84
62
-
sudo tar -C /usr/local -xzf android-studio-{version}-linux.tar.gz
85
+
```sh
86
+
sudo tar -C /usr/local -xzf android-studio-{version}-linux.tar.gz
87
+
```
63
88
64
89
To launch Android Studio, in a terminal enter:
65
90
66
-
/usr/local/android-studio/bin/studio.sh &
91
+
```sh
92
+
/usr/local/android-studio/bin/studio.sh &
93
+
```
94
+
95
+
### Install the tools with asdf (only need to do once)
96
+
97
+
```sh
98
+
make asdf.install_tools
99
+
```
67
100
68
-
### Get a copy of the repo
101
+
On macOS, if you get an error like "https://github.com/CocoaPods/CLAide.git (at master@97b765e) is not yet checked out" then reinstall cocoapods like this:
69
102
70
-
```console
71
-
git clone https://github.com/gnolang/gnonative
72
-
cd gnonative
103
+
```sh
104
+
asdf uninstall cocoapods
105
+
make asdf.install_tools
73
106
```
74
107
75
108
### Build for Android
@@ -82,102 +115,3 @@ cd gnonative
82
115
- In the "SDK Tools" tab, click "Show Package Details". Expand
83
116
"NDK (Side by side)" and check "23.1.7779620".
84
117
- Click OK to install and close the SDK Manager.
85
-
86
-
#### Install the tools with asdf (only need to do once)
87
-
88
-
(If not building for iOS, edit the file `.tool-versions` and remove the unneeded lines for `ruby` and `cocoapods`.)
89
-
90
-
```console
91
-
make asdf.install_tools
92
-
```
93
-
94
-
#### Build the Go code as a library
95
-
96
-
```console
97
-
make build.android
98
-
```
99
-
100
-
#### Start metro
101
-
102
-
```console
103
-
cd examples/js/react-native/gnoboard
104
-
npm start
105
-
```
106
-
107
-
#### Connect your Android phone/emulator and bind its port to metro
108
-
109
-
You can either connect an Android phone via USB cable, or launch an emulator device from Android Studio.
110
-
111
-
##### Real device
112
-
113
-
Connect your device and bind the port to metro:
114
-
115
-
```console
116
-
cd examples/js/react-native/gnoboard
117
-
make android.reverse_tcp
118
-
```
119
-
120
-
##### Emulator device
121
-
122
-
You can either run Android Studio and open the Android project in `examples/js/react-native/gnoboard/android`.
123
-
If you prefer the CLI option:
124
-
125
-
```console
126
-
android-studio ./android
127
-
```
128
-
129
-
Once done, bind the port to metro:
130
-
131
-
```console
132
-
make android.reverse_tcp
133
-
```
134
-
135
-
#### Build with Android Studio
136
-
137
-
Open Android Studio and open the current Android project if it's not already done.
138
-
Select the right device in the device list. Open the `Run` menu, and select `Run app`.
139
-
See more: https://developer.android.com/studio/run#basic-build-run
140
-
141
-
### Build for iOS
142
-
143
-
#### Install the tools with asdf (only need to do once)
144
-
145
-
```console
146
-
make asdf.install_tools
147
-
```
148
-
149
-
If you get an error like "https://github.com/CocoaPods/CLAide.git (at master@97b765e) is not yet checked out" then reinstall cocoapods like this:
150
-
151
-
```console
152
-
asdf uninstall cocoapods
153
-
make asdf.install_tools
154
-
```
155
-
156
-
#### Build the Go code as a library
157
-
158
-
```console
159
-
make build.ios
160
-
```
161
-
162
-
#### Start metro
163
-
164
-
```console
165
-
cd examples/js/react-native/gnoboard
166
-
npm start
167
-
```
168
-
169
-
#### Open Xcode and connect your iOS device
170
-
171
-
Open Xcode and open the GnoBoard Xcode workspace: `examples/js/react-native/gnoboard/ios/gnoboard.xcworkspace`
172
-
You can either connect an iOS phone via USB cable, or launch an emulator device from Xcode.
173
-
See more: https://developer.apple.com/documentation/xcode/running-your-app-in-simulator-or-on-a-device
174
-
175
-
#### Select a developer certificate
176
-
177
-
In Xcode, double click on gnoboard project on the left pane, go to the `Signing & Capabilities` pane.
178
-
In the `Signing` section, select your `team` certificate.
179
-
180
-
#### Build with Xcode
181
-
182
-
Select the right device in the device list. Open the `Product` menu, and select `Run`.
183
-
See more: https://developer.apple.com/documentation/xcode/building-and-running-an-app
0 commit comments