Skip to content

Commit

Permalink
Create single Permission API inside Cargo.toml metadata (#121)
Browse files Browse the repository at this point in the history
* Bump android manifest version and replace Cargo.toml metadata

* [errors] Alter commands, refactor

* Alter assets folders

* Alter build targets

* Alter docs, add Android and iOS strategies, fix test

* Fix iOS icons bug, alter icons and splash screen, fix iOS Info.plist build, fix other issues

* Fix cargo metadata test

* Refacto android command

* Fix macroquad permissions, refactor errors, remove redundant code

* Fix warnings in AdMob plugin and PermissionsUtil (#129)

* Fix warning

* Fix warning

* Fix warning

* Merg and fix warning

* Add comments what to replace

* Fix warning permissions util

* Add cross-platform permission API in Metadata

* Fix CI build

* Bump versions

* Bump version of apple-bundle

* Small doc fix

* Reorganize tools structure (#132)

* Reorganize tools structure

* Downgrade bundletool version

* Fix import

Co-authored-by: David Ackerman <enfipy@gmail.com>

* Alter description and move rustfmt

* Fix fmt

* Remove log command and add log flag

* Fixes #130, fixes some warnings in AdMob and Crossbow Android

* Closes #102, alter folders in crossbundle-tools, alter features

* Add icon tmp solution

* Remove icons to fix CI

* Update some documentation

Co-authored-by: zupaazmul <78680636+Adoka3710@users.noreply.github.com>
Co-authored-by: Daniil Anikin <81761954+Heezay@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 4, 2022
1 parent 632c5bf commit 144b275
Show file tree
Hide file tree
Showing 222 changed files with 1,929 additions and 1,822 deletions.
Binary file removed .github/assets/splash.png
Binary file not shown.
21 changes: 10 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
cd examples/macroquad-3d
export ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME
crossbundle build android --apk --quad --release
crossbundle build android -s=native-apk --release
apple-build-macos:
name: Build Apple example on macOS latest
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Build Apple app
run: |
cd examples/macroquad-3d
crossbundle build apple --release --target=aarch64-apple-ios --quad
crossbundle build ios --release --target=aarch64-apple-ios
test-crossbundle-new:
name: Generate and Build from template on macOS latest
Expand All @@ -66,7 +66,7 @@ jobs:
- name: Build Apple app
run: |
cd ~/example/
crossbundle build android --apk --release --quad
crossbundle build android -s=native-apk --release
build-example-in-docker:
name: Build Crossbundle Example from Docker
Expand All @@ -77,7 +77,7 @@ jobs:
run: docker build -t tmp -f .github/docker/crossbundle.Dockerfile .
- name: Build Crossbundle Example
run: |
docker run --rm -v "$(pwd)/:/src" -w /src/examples/macroquad-permissions tmp build android --quad --release
docker run --rm -v "$(pwd)/:/src" -w /src/examples/macroquad-permissions tmp build android --release
clean:
name: Check code format
Expand All @@ -91,14 +91,13 @@ jobs:
components: rustfmt, clippy
override: true
- name: Check the format
run: cargo +nightly fmt --all -- --check
run: |
cd crossbundle/cli/
cargo +nightly fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::unnecessary-unwrap -A clippy::too-many-arguments
# Blocked by https://github.com/rust-lang/rust/issues/99261
# - name: Run clippy on crossbundle
# run: |
# cd crossbundle/cli
# cargo clippy --all-targets --all-features -- -D warnings -A clippy::unnecessary-unwrap -A clippy::too-many-arguments
run: |
cd crossbundle/cli/
cargo clippy --all-targets --all-features -- -D warnings -A clippy::unnecessary-unwrap -A clippy::too-many-arguments
- name: Check for deadlinks
run: |
cargo install cargo-deadlinks
Expand Down
15 changes: 10 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "crossbow"
version = "0.1.7"
version = "0.1.8"
edition = "2021"
authors = ["DodoRare Team <support@dodorare.com>"]
description = "Cross-Platform Rust Toolkit for Games 🏹"
description = "Cross-Platform build tools and toolkit for games"
repository = "https://github.com/dodorare/crossbow"
license = "Apache-2.0"
keywords = ["build", "android", "ios", "tools"]
Expand All @@ -14,13 +14,17 @@ exclude = [".github/**/*"]
thiserror = "1.0"
displaydoc = "0.2"
anyhow = "1.0"
serde = { version = "1.0", features = ["derive"] }

android-manifest = { version = "0.1.9", optional = true }
apple-bundle = { version = "0.1.4", optional = true }

[target.'cfg(target_os = "android")'.dependencies]
crossbow-android = { path = "platform/android", version = "0.1.7", optional = true }
ndk-glue = "0.6.2"
ndk-glue = "0.7.0"
crossbow-android = { path = "platform/android", version = "0.1.8", optional = true }

[target.'cfg(target_os = "ios")'.dependencies]
crossbow-ios = { path = "platform/ios", version = "0.1.7", optional = true }
crossbow-ios = { path = "platform/ios", version = "0.1.8", optional = true }

[patch.crates-io]
winit = { git = "https://github.com/rust-windowing/winit", rev = "f93f2c158bf527ed56ab2b6f5272214f0c1d9f7d" }
Expand All @@ -31,6 +35,7 @@ miniquad = { git = "https://github.com/not-fl3/miniquad", rev = "d67ffe6950cf73d
default = ["android", "ios"]
android = ["crossbow-android"]
ios = ["crossbow-ios"]
update-manifest = ["apple-bundle", "android-manifest"]

[workspace]
members = [
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [![Crossbow Splash Image](.github/assets/splash.png)](https://github.com/dodorare/crossbow)
# [![Crossbow Splash Image](assets/splash.png)](https://github.com/dodorare/crossbow)

[![CI Info](https://github.com/dodorare/crossbow/workflows/CI/badge.svg)](https://github.com/dodorare/crossbow/actions)
[![Crate Info](https://img.shields.io/crates/v/crossbow.svg)](https://crates.io/crates/crossbow)
Expand All @@ -16,16 +16,17 @@ The `crossbow` project aims to provide a complete toolkit for cross-platform gam

> There are already [cargo-apk](https://github.com/rust-windowing/android-ndk-rs/tree/master/cargo-apk), [cargo-mobile](https://github.com/BrainiumLLC/cargo-mobile), [cargo-xcode](https://gitlab.com/kornelski/cargo-xcode), etc. - why do I need another packaging tool?
Project `crossbow` is not only a packaging tool for **Android** and iOS - it's a toolkit. With `crossbundle-tools` you can customize and create new commands; with `crossbundle` you can create native **.apk/.aab** without any *Java* or setup *Gradle* project with fancy **Crossbow Android plugins** (**iOS** in near future); with `crossbow-android` you can write your own Android plugins in *Java/Kotlin*.
Project `crossbow` is not only a packaging tool for **Android** and **iOS** - it's cross-platform build tools and toolkit for Rust! With `crossbundle` you can create native **.apk/.aab** without any *Java* or setup *Gradle* project with fancy **Crossbow Android plugins** (**iOS** in near future); with `crossbundle-tools` you can customize and create new commands; with `crossbow-android` you can write your own Android plugins in *Java/Kotlin*.

A lot of functionality was inspired by [Godot](https://github.com/godotengine/godot), [Xamarin](https://dotnet.microsoft.com/en-us/apps/xamarin), and [cargo-apk](https://github.com/rust-windowing/android-ndk-rs/tree/master/cargo-apk).

## Design Goals

* **Customizable**: Create new commands with available tools.
* **Simple**: Easy to start but flexible for strong devs.
* **Simple**: Easy to install and start hacking but also pretty flexible for strong devs.
* **Capable**: It's possible to build plain **.apk/.aab** or **.app/.ipa**; or with help of *Gradle/XCode*.
* **Rust**: Don't leave your *Rust* code - **everything** can be configured from `Cargo.toml`.
* **Plugins**: Godot-like plugins for **Android** (and **iOS** in future) with *Rust* wrapper!

## 📚 Documentation

Expand Down Expand Up @@ -64,7 +65,7 @@ Helper crates:

Also, this project initially funded by [Web3 Foundation Grants Program](https://github.com/w3f/Grants-Program/blob/master/applications/crossbow.md). Big shout-out to them!

<img src=".github/assets/w3f_grants_badge.svg" alt="W3F Grants Badge" width="400px" />
<img src="assets/w3f_grants_badge.svg" alt="W3F Grants Badge" width="400px" />

## 📑 License

Expand Down
File renamed without changes.
File renamed without changes.
Binary file added assets/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions assets/res/android/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_adaptive_back"/>
<foreground android:drawable="@mipmap/ic_launcher_adaptive_fore"/>
</adaptive-icon>
Binary file added assets/res/android/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/res/android/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/res/android/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/res/android/mipmap-xxhdpi/ic_launcher.png
Binary file added assets/res/android/mipmap-xxxhdpi/ic_launcher.png
Binary file added assets/res/apple/icon.png
File renamed without changes.
Binary file added assets/splash.png
File renamed without changes
21 changes: 11 additions & 10 deletions crossbundle/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "crossbundle"
version = "0.1.7"
version = "0.1.8"
edition = "2021"
authors = ["DodoRare Team <support@dodorare.com>"]
description = "Build and publish apps for Android/iOS"
Expand All @@ -18,9 +18,10 @@ name = "crossbundle"
path = "src/main.rs"

[dependencies]
crossbundle-tools = { path = "../tools", version = "0.1.7" }
android-tools = "0.2.9"
clap = { version = "3.2.8", features = ["derive"] }
crossbow = { path = "../../", version = "0.1.8", default-features = false, features = ["update-manifest"] }
crossbundle-tools = { path = "../tools", version = "0.1.8", default-features = false }
android-tools = { version = "0.2.10", optional = true }
clap = { version = "3.2", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }

anyhow = "1.0"
Expand All @@ -31,16 +32,16 @@ pretty_env_logger = "0.4"
log = "0.4"

fs_extra = "1.2"
dirs = "4.0.0"
dirs = "4.0"
dunce = "1.0"
ureq = { version = "2.4.0", features = ["tls"] }
ureq = { version = "2.5", features = ["tls"] }
cargo = "0.63.1"
cargo-util = "0.2.0"

[dev-dependencies]
tempfile = "3.2"
tempfile = "3.3"

[features]
default = ["android", "ios"]
android = []
ios = []
default = ["android", "apple"]
android = ["crossbow/android", "crossbundle-tools/android", "android-tools"]
apple = ["crossbow/ios", "crossbundle-tools/apple"]
Loading

0 comments on commit 144b275

Please sign in to comment.