engine: flatten out src/

master
q3k 2021-07-11 00:46:57 +00:00
parent 982f5e23db
commit 832218c6a5
34 changed files with 65 additions and 65 deletions

View File

@ -13,38 +13,38 @@ rust_library(
"-Zborrowck=mir",
],
srcs = [
"src/lib.rs",
"lib.rs",
"src/globals.rs",
"src/input.rs",
"src/scripting.rs",
"globals.rs",
"input.rs",
"scripting.rs",
"src/physics/mod.rs",
"src/physics/color.rs",
"physics/mod.rs",
"physics/color.rs",
"src/render/mod.rs",
"src/render/light.rs",
"src/render/material.rs",
"src/render/mesh.rs",
"src/render/renderable.rs",
"src/render/resource.rs",
"render/mod.rs",
"render/light.rs",
"render/material.rs",
"render/mesh.rs",
"render/renderable.rs",
"render/resource.rs",
"src/render/vulkan/mod.rs",
"src/render/vulkan/data.rs",
"src/render/vulkan/material.rs",
"src/render/vulkan/pipeline.rs",
"src/render/vulkan/pipeline_forward.rs",
"src/render/vulkan/qfi.rs",
"src/render/vulkan/shaders.rs",
"src/render/vulkan/surface_binding.rs",
"src/render/vulkan/swapchain_binding.rs",
"src/render/vulkan/worker.rs",
"render/vulkan/mod.rs",
"render/vulkan/data.rs",
"render/vulkan/material.rs",
"render/vulkan/pipeline.rs",
"render/vulkan/pipeline_forward.rs",
"render/vulkan/qfi.rs",
"render/vulkan/shaders.rs",
"render/vulkan/surface_binding.rs",
"render/vulkan/swapchain_binding.rs",
"render/vulkan/worker.rs",
"src/util/mod.rs",
"src/util/counter.rs",
"src/util/file.rs",
"src/util/profiler.rs",
"src/util/resourcemap.rs",
"util/mod.rs",
"util/counter.rs",
"util/file.rs",
"util/profiler.rs",
"util/resourcemap.rs",
],
deps = [
"//lib/ecs",

View File

@ -33,7 +33,7 @@ pub struct Omni {
impl Omni {
/// Make a test light. This has... a color. It's kinda yellow. And something close to 650
/// lumens of luminous power.
// TODO(q3k): implement [Kry85] (eq. 68) somewhere in //engine/src/physics for generation
// TODO(q3k): implement [Kry85] (eq. 68) somewhere in //engine/physics for generation
// of nice lights colours from color temperature.
//
// [Kry85]

View File

@ -70,7 +70,7 @@ impl std::io::Seek for Resource {
}
/// ReleaseFiles is a file/resource accessible for abrasion releases build via
/// //engine/release.
/// //tools/release.
struct ReleaseFiles {
}

View File

@ -1,5 +1,5 @@
load("@rules_rust//rust:rust.bzl", "rust_binary")
load("//engine/release:defs.bzl", "abrasion_release")
load("//tools/release:defs.bzl", "abrasion_release")
rust_binary(
name = "hsvr",

View File

@ -4,9 +4,9 @@ go_binary(
name = "pack",
srcs = ["pack.go"],
deps = [
"//engine/release/proto:manifest_go_proto",
"//tools/release/proto:manifest_go_proto",
"@org_golang_google_protobuf//encoding/prototext",
"@org_golang_google_protobuf//proto",
],
visibility = ["//visibility:public"],
)
)

View File

@ -9,7 +9,7 @@ def _abrasion_release_impl(ctx):
runfiles = [rf for rf in runfiles if not rf.path.endswith(".rs")]
runfiles = [rf for rf in runfiles if not rf.path == main.path]
# Proprietary little manifest format, for //engine/release/pack.go to use.
# Proprietary little manifest format, for //tools/release/pack.go to use.
runfile_manifest = ctx.actions.declare_file(ctx.attr.name + "-manifest.text.pb")
ctx.actions.write(runfile_manifest, proto.encode_text(struct(file = [
struct(short_path=rf.short_path, path=rf.path)
@ -45,7 +45,7 @@ abrasion_release = rule(
"_pack": attr.label(
executable = True,
cfg = "exec",
default = Label("//engine/release:pack"),
default = Label("//tools/release:pack"),
),
}
)
)

View File

@ -5,42 +5,42 @@ import (
"crypto/sha256"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"io/ioutil"
"sort"
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/proto"
pb "abrasion/engine/release/proto"
pb "abrasion/tools/release/proto"
)
var (
flagManifest string
flagExe string
flagZip string
flagExe string
flagZip string
)
func packFile(w *zip.Writer, file *pb.File) error {
fo, err := w.Create(file.ShortPath)
if err != nil {
return fmt.Errorf("Create: %w", err)
}
// TODO(q3k): maybe don't read this into memory...
data, err := ioutil.ReadFile(file.Path)
if err != nil {
return fmt.Errorf("Open: %w", err)
}
h := sha256.Sum256(data)
file.Sha256 = h[:]
_, err = fo.Write(data)
if err != nil {
return fmt.Errorf("Write: %w", err)
}
// We don't need this in the release manifest.
file.Path = ""
return nil
fo, err := w.Create(file.ShortPath)
if err != nil {
return fmt.Errorf("Create: %w", err)
}
// TODO(q3k): maybe don't read this into memory...
data, err := ioutil.ReadFile(file.Path)
if err != nil {
return fmt.Errorf("Open: %w", err)
}
h := sha256.Sum256(data)
file.Sha256 = h[:]
_, err = fo.Write(data)
if err != nil {
return fmt.Errorf("Write: %w", err)
}
// We don't need this in the release manifest.
file.Path = ""
return nil
}
func main() {
@ -81,7 +81,7 @@ func main() {
// Pack engine
engine := pb.File{
ShortPath: "abrasion.exe",
Path: flagExe,
Path: flagExe,
}
if err := packFile(w, &engine); err != nil {
log.Fatalf("Failed to pack engine: %v", err)
@ -99,4 +99,4 @@ func main() {
if _, err := mo.Write(manifestBytes); err != nil {
log.Fatalf("Failed to write manifest: %v", err)
}
}
}

View File

@ -8,7 +8,7 @@ proto_library(
go_proto_library(
name = "manifest_go_proto",
importpath = "abrasion/engine/release/proto",
importpath = "abrasion/tools/release/proto",
protos = [":manifest_proto"],
visibility = ["//engine/release:__pkg__"],
)
visibility = ["//tools/release:__pkg__"],
)

View File

@ -1,6 +1,6 @@
syntax = "proto3";
package abrasion.engine.release.proto;
option go_package = "abrasion/engine/release/proto";
package abrasion.tools.release.proto;
option go_package = "abrasion/tools/release/proto";
message File {
string short_path = 1;
@ -15,4 +15,4 @@ message Manifest {
message ReleaseInfo {
string target = 1;
}
}