Skip to content

Commit 2c7ebb2

Browse files
committed
Flatten directory structure
Convert the cargo workspace from virtual manifest to explicit by making dungeoncrawl as the main module
1 parent 05f606d commit 2c7ebb2

56 files changed

Lines changed: 38 additions & 56 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,20 @@ jobs:
3737
uses: actions-rust-lang/setup-rust-toolchain@v1
3838
with:
3939
target: "wasm32-unknown-unknown, aarch64-linux-android, armv7-linux-androideabi, i686-linux-android, x86_64-linux-android"
40-
cache-workspaces: "./rustlib/rust_workspace"
40+
cache-workspaces: "."
4141
rustflags: ""
4242

4343
- name: Install cargo-ndk
4444
run: cargo install cargo-ndk
4545

4646
- name: Build WASM
47-
working-directory: ./rustlib/rust_workspace
4847
run: ./wasm_build.sh --profile web-release
4948

5049
- name: Upload WASM Artifacts
5150
uses: actions/upload-pages-artifact@v3
5251
with:
5352
# Upload dist folder
54-
path: './rustlib/rust_workspace/dist'
53+
path: './dist'
5554

5655
- name: NDK cache
5756
id: cache-ndk

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ google-services.json
111111

112112
# Generated by Cargo
113113
# will have compiled files and executables
114-
rustlib/rust_workspace/target/
114+
target/
115115

116116
# These are backup files generated by rustfmt
117117
**/*.rs.bk

rustlib/rust_workspace/dungeoncrawl/Cargo.toml renamed to Cargo.toml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ crate-type = ["lib", "cdylib"]
99

1010
[dependencies]
1111
fastrand = "2.3.0"
12-
input_lib = { version = "0.1.0", path = "../input_lib" }
12+
input_lib = { version = "0.1.0", path = "input_lib" }
1313
macroquad = { version = "=0.4.13", features = ["backtrace"] }
1414
getrandom = { version = "*", features = ["js"] }
1515
bevy_ecs = { version = "0.16.0", features = ["configurable_error_handler"] }
@@ -23,19 +23,23 @@ fnv = "1.0.7"
2323
serde = { version = "1.0.219", features = ["derive"] }
2424
ron = "0.10.1"
2525

26-
# [package.metadata.android]
27-
# build_targets = [ "aarch64-linux-android" ]
28-
# package_name = "dev.spectorstudios.dungeoncrawl"
29-
# label = "Dungeon Crawl"
30-
# assets = "assets"
31-
# res = "android_res"
32-
# icon = "@mipmap/ic_launcher"
33-
# version_code = 2
34-
# version_name = "0.0.2"
26+
[workspace]
27+
resolver = "3"
28+
members = [ "macroquad_ex_ui", "input_lib"]
3529

36-
# [package.metadata.android.application_attributes]
37-
# "android:hardwareAccelerated" = "true"
38-
# "android:appCategory" = "game"
30+
[profile.dev]
31+
opt-level = 0
3932

40-
# [package.metadata.android.activity_attributes]
41-
# "android:exported" = "true"
33+
[profile.dev.package."*"]
34+
opt-level = 1
35+
36+
[profile.release]
37+
strip = "debuginfo"
38+
codegen-units = 1
39+
lto = "thin"
40+
41+
[profile.web-release]
42+
inherits = "release"
43+
opt-level = "s"
44+
strip = true
45+
panic = 'unwind'

app/build.gradle.kts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ android {
4747
}
4848

4949
if (storePath != null && storePassword != null && keyAlias != null && keyPassword != null) {
50-
println("✅ Using custom debug signing config")
50+
println("✅ Using custom signing config")
5151
storeFile = file(storePath)
5252
this.storePassword = storePassword
5353
this.keyAlias = keyAlias
@@ -78,13 +78,13 @@ android {
7878

7979
sourceSets {
8080
getByName("main") {
81-
assets.srcDirs(project(":rustlib").layout.buildDirectory.dir("assets").get().asFile)
81+
assets.srcDirs(project(":rust-android-build").layout.buildDirectory.dir("assets").get().asFile)
8282
}
8383
getByName("debug") {
84-
jniLibs.srcDirs(project(":rustlib").layout.buildDirectory.dir("debug/jniLibs").get().asFile)
84+
jniLibs.srcDirs(project(":rust-android-build").layout.buildDirectory.dir("debug/jniLibs").get().asFile)
8585
}
8686
getByName("release") {
87-
jniLibs.srcDirs(project(":rustlib").layout.buildDirectory.dir("release/jniLibs").get().asFile)
87+
jniLibs.srcDirs(project(":rust-android-build").layout.buildDirectory.dir("release/jniLibs").get().asFile)
8888
}
8989
}
9090
}
@@ -99,16 +99,16 @@ afterEvaluate {
9999
"explodeAssetSourceRelease"
100100
).forEach {taskName ->
101101
tasks.named(taskName).configure {
102-
dependsOn(":rustlib:copyAssets")
102+
dependsOn(":rust-android-build:copyAssets")
103103
}
104104
}
105105

106106
tasks.named("mergeDebugJniLibFolders").configure {
107-
dependsOn(":rustlib:buildRustLibsDebug")
107+
dependsOn(":rust-android-build:buildRustLibsDebug")
108108
}
109109

110110
tasks.named("mergeReleaseJniLibFolders").configure {
111-
dependsOn(":rustlib:buildRustLibsRelease")
111+
dependsOn(":rust-android-build:buildRustLibsRelease")
112112
}
113113
}
114114

rustlib/rust_workspace/dungeoncrawl/assets/entities.png renamed to assets/entities.png

File renamed without changes.

rustlib/rust_workspace/dungeoncrawl/assets/font.ttf renamed to assets/font.ttf

File renamed without changes.

rustlib/rust_workspace/dungeoncrawl/assets/map_forest.png renamed to assets/map_forest.png

File renamed without changes.

rustlib/rust_workspace/dungeoncrawl/assets/map_fortress.png renamed to assets/map_fortress.png

File renamed without changes.

rustlib/rust_workspace/dungeoncrawl/assets/template.ron renamed to assets/template.ron

File renamed without changes.

0 commit comments

Comments
 (0)