-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update documentation and docker (#123)
* Add mdBook * Add documentation * Add CI to build and publish book * Alter CI
- Loading branch information
Showing
37 changed files
with
358 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Build and Deploy Documentation | ||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- 'docs/**.md' | ||
permissions: | ||
contents: write | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install and Build | ||
run: | | ||
cargo install mdbook | ||
cd docs/ | ||
mdbook build -d book | ||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: docs/book |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[book] | ||
title = "crossbow" | ||
description = "Official Crossbow documentation" | ||
authors = ["DodoRare Team <[email protected]>"] | ||
language = "en" | ||
|
||
[rust] | ||
edition = "2021" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Summary | ||
|
||
[Introduction](introduction.md) | ||
|
||
# Getting Started | ||
|
||
- [Installation](install/README.md) | ||
- [Android on Windows](install/android-windows.md) | ||
- [Android on Linux](install/android-linux.md) | ||
- [Android on macOS](install/android-macos.md) | ||
- [Android with Docker](install/docker.md) | ||
- [iOS on macOS](install/ios-macos.md) | ||
|
||
# Components | ||
|
||
- [Crossbundle](crossbundle/README.md) | ||
- [Install Command](crossbundle/command-install.md) | ||
- [Build Command](crossbundle/command-build.md) | ||
- [Run Command](crossbundle/command-run.md) | ||
|
||
- [Crossbow](crossbow/README.md) | ||
- [Configuration](crossbow/configuration.md) | ||
- [Permissions](crossbow/permissions.md) | ||
- [Android Plugins](crossbow/android-plugins.md) | ||
|
||
# Tutorials | ||
|
||
- [Examples](tutorials/README.md) | ||
- [Hello World](tutorials/hello-world.md) | ||
- [Fastlane](tutorials/fastlane.md) | ||
- [Subxt with Bevy](tutorials/subxt-with-bevy.md) | ||
|
||
# Other | ||
|
||
- [Contributing](contributing/README.md) | ||
- [Contribute Code](contributing/contribute-code.md) | ||
- [Contribute Docs](contributing/contribute-docs.md) | ||
- [Testing Guide](contributing/testing-guide.md) | ||
- [Contributors](contributing/contributors.md) | ||
- [Roadmap](roadmap.md) | ||
- [Special Thanks](special-thanks.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Contributing | ||
|
||
If you want to help us build an awesome Cross-Platform future for Rust Games, please reach out! We need all the help we can get: | ||
|
||
- If you are a software developer and you want to help out, check out the [Contributing Code](contribute-code.md) section. | ||
- If you are good at writing or teaching, consider [Contributing to our Docs](contribute-docs.md). | ||
|
||
Also, read [testing guide](testing-guide.md) to run tests in `crossbow`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# How to Contribute Code | ||
|
||
Would you like to contribute code to Crossbow? Here's how! | ||
|
||
1. Fork the [dodorare/crossbow](https://github.com/dodorare/crossbow) repository on GitHub, you'll need to create a GitHub account if you don't have one already.* | ||
2. Make your changes in a local clone of your fork. | ||
3. For a higher chance of CI passing the first time, consider run these commands from the root of your local clone: | ||
1. `cargo fmt --all -- --check` (remove --check to let the command fix found problems) | ||
2. `cargo clippy --all-targets --all-features -- -D warnings -A clippy::unnecessary-unwrap -A clippy::too-many-arguments` | ||
3. `cargo test --all-targets --workspace` | ||
4. Push your changes to your fork and open a Pull Request. | ||
5. Respond to any CI failures or review feedback. | ||
<!-- 6. Remember to follow Crossbow's Code of Conduct, and thanks for contributing! --> | ||
|
||
> The same steps apply for any other repository in the organization that you would like to contribute to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# How to Contribute Docs | ||
|
||
## Crossbow Documentation | ||
|
||
If you want to contribute to this documentation, please see the [Contributing](contributing/docs.md) section. | ||
|
||
1. Fork the [dodorare/crossbow](https://github.com/dodorare/crossbow) repository on GitHub, you'll need to create a GitHub account if you don't have one already.* | ||
2. Install [mdBook](https://rust-lang.github.io/mdBook/guide/installation.html). | ||
3. In the "docs/" directory, run `mdbook serve --open` and make your changes in a local clone of your fork. | ||
4. Push your changes to your fork and open a [Pull Request](https://github.com/dodorare/crossbow/compare). | ||
5. Respond to any CI failures or review feedback. | ||
|
||
<!-- Remember to follow Crossbow's Code of Conduct, and thanks for contributing! --> | ||
|
||
That's all, big thanks for contributing! | ||
|
||
> The same steps apply for any other repository in the organization that you would like to contribute to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Contributors | ||
|
||
Here is a list of the contributors who have helped improving `Crossbow`. Big shout-out to them! | ||
|
||
- David ([enfipy](https://github.com/enfipy)) - Project Lead | ||
- Daniil ([Heezay](https://github.com/Heezay)) | ||
- Oleksii ([olvyko](https://github.com/olvyko)) | ||
- Adil ([Adoka3710](https://github.com/Adoka3710)) | ||
- Rodrigo ([rodrigocam](https://github.com/rodrigocam)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Testing guide | ||
|
||
## How to run tests in crossbow | ||
|
||
In `crossbow`, we have unit tests, integration tests, and examples. To run tests, you will need to set up an **Android** and **Apple** environment (you can find more information in [installation category](../install/README.md)). | ||
|
||
If you want to run tests for our `crossbundle` crate, you can make it by the following steps: download this repository, proceed to the `crossbundle/tools` directory, and run `cargo test`. It will run all tests for the `crossbundle-tools` crate that is primarily used by `crossbundle`. | ||
|
||
## In case of issues | ||
|
||
Feel free to open [Github Issues](https://github.com/dodorare/crossbow/issues/new/choose) - we will be happy to fix or review them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Overview | ||
|
||
In this category, you will learn how to use the `crossbow` crate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Crossbow permissions | ||
|
||
To request permissions with Crossbow you will need to add `crossbow` dependency to your Cargo.toml file. Then invoke request_permission function. This function checks the permission status in the application and will request permission if it's not granted yet: | ||
|
||
```rust | ||
use crossbow::Permission; | ||
let res = Permission::Camera.request_async().await?; | ||
match res { | ||
Permission::Unknown => println!("Permission is in an unknown state"), | ||
Permission::Denied => println!("Denied by user"), | ||
Permission::Disabled => println!("Feature is disabled on device."), | ||
Permission::Granted => println!("Granted by user."), | ||
Permission::Restricted => println!("Restricted (only iOS)."), | ||
} | ||
``` | ||
|
||
Also, remember to set permissions in through `Cargo.toml` or `Info.plist`/`AndroidManifest.xml` files. List of required permissions for Cross-Platform Permission you can find in `Permission` enum. | ||
|
||
See usage [example](https://github.com/dodorare/crossbow/blob/main/examples/macroquad-permissions/src/main.rs). | ||
|
||
Also, it's possible to request more permissions with this API: | ||
|
||
``` | ||
#[cfg(target_os = "android")] | ||
crossbow::android::permission::*; | ||
let res = request_permission(&AndroidPermission::ReadCalendar).await?; | ||
// or this for iOS: | ||
#[cfg(target_os = "ios")] | ||
crossbow::ios::permission::*; | ||
let res = request_permission(&IosPermission::CaptureDevice(MediaType::Audio)).await; | ||
``` | ||
|
||
## Maybe useful | ||
|
||
Useful commands to debug permission status in Android application using [adb](https://developer.android.com/studio/command-line/adb): | ||
|
||
```sh | ||
adb shell pm reset-permissions | ||
adb shell pm list permission-groups | ||
adb shell pm list permissions | ||
|
||
adb shell pm grant <app package> <permission name> | ||
adb shell pm revoke <app package> <permission name> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Overview | ||
|
||
In this category, you will learn how to use the `crossbundle` tool. |
Oops, something went wrong.