Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.tmp
packages/com.seaube.ecs-idl/.tmp
packages/com.seaube.ecs-idl/generators~
*.tgz
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/bazel-*
/.tmp
user.bazelrc
*.tgz
30 changes: 25 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "ecs_idl",
remote = "git@github.com:seaube/ecs-idl.git",
commit = "cb294d0d0bf4bb236fecfe4ed31dfdc1c924b350",
shallow_since = "1641759679 -0800",
commit = "e695dbbbadea47ebf3a22c806b7c282cd617206f",
shallow_since = "1641923718 -0800",
)

http_archive(
name = "boost",
strip_prefix = "boost-95b7ebcdf8d837452efedaa342858360c7fb58e4",
urls = ["https://github.com/bazelboost/boost/archive/95b7ebcdf8d837452efedaa342858360c7fb58e4.zip"],
sha256 = "13d59f4265e3d29d63d17ad6c439d2f8663baea6b8f02961d638348085aa600f",
strip_prefix = "boost-563e8e0de4eac4b48a02d296581dc2454127608e",
urls = ["https://github.com/bazelboost/boost/archive/563e8e0de4eac4b48a02d296581dc2454127608e.zip"],
sha256 = "c41441a6e9f8038ad626e9f937ddc3675ab896b6c3512eefc6840037b3816d03",
)

load("@boost//:index.bzl", "boost_http_archives")
Expand Down Expand Up @@ -58,3 +58,23 @@ http_archive(
sha256 = "62c585468054e2d8e7c2759c0d990fd339d13be988577699366fe195162d16cb",
build_file_content = _nlohmann_json_build_file,
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "ddb78717b802f8dd5d4c01c340ecdc007c8ced5c1df7db421d0df3d642ea0580",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.0/rules_nodejs-4.6.0.tar.gz"],
)

load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories")
node_repositories()

http_archive(
name = "aspect_bazel_lib",
sha256 = "534c9c61b72c257c95302d544984fd8ee63953c233292c5b6952ca5b33cd225e",
strip_prefix = "bazel-lib-0.4.2",
url = "https://github.com/aspect-build/bazel-lib/archive/v0.4.2.tar.gz",
)

load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
aspect_bazel_lib_dependencies()
26 changes: 2 additions & 24 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,36 +1,14 @@
load("@rules_7zip//:defs.bzl", "pkg_7z")
load("@bzlws//:index.bzl", "bzlws_copy")

package(default_visibility = ["//visibility:public"])

pkg_7z(
name = "com.seaube.ecs-idl",
strip_prefix = "packages/com.seaube.ecs-idl/",
extension = "zip",
srcs = glob(["com.seaube.ecs-idl/**/*"]) + [
"@ecs_idl//generator/csharp:cli",
"@ecs_idl//generator/parser_info:cli",
],
remap_paths = {
"../ecs_idl/generator/csharp/": ".tmp/",
"../ecs_idl/generator/parser_info/": ".tmp/",
},
)

filegroup(
name = "packages",
srcs = [
":com.seaube.ecs-idl",
],
)

bzlws_copy(
name = "copy_for_dev",
visibility = ["//visibility:private"],
testonly = True,
force = True,
out = "packages/com.seaube.ecs-idl/.tmp/{FILENAME}",
metafile_path = ".tmp/.copy_for_dev.yml",
out = "packages/com.seaube.ecs-idl/generators~/{FILENAME}",
metafile_path = "generators~/.copy_for_dev.yml",
srcs = [
"@ecs_idl//generator/csharp:cli",
"@ecs_idl//generator/parser_info:cli",
Expand Down
3 changes: 2 additions & 1 deletion packages/com.seaube.ecs-idl/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ crashlytics-build.properties
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*

/bazel-*
# Folder that stores codegen executables
# /generators~
27 changes: 27 additions & 0 deletions packages/com.seaube.ecs-idl/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")

copy_to_directory(
name = "generators~",
replace_prefixes = {
"generator/csharp/": "",
"generator/parser_info/": "",
},
include_external_repositories = [
"ecs_idl",
],
srcs = [
"@ecs_idl//generator/csharp:cli",
"@ecs_idl//generator/parser_info:cli",
],
)

pkg_npm(
name = "com.seaube.ecs-idl",
package_name = "com.seaube.ecs-idl",
deps = [":generators~"],
srcs = glob(["**/*"]),
)

alias(name = "pack", actual = "com.seaube.ecs-idl.pack")
alias(name = "publish", actual = "com.seaube.ecs-idl.publish")
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static void RefreshEcsIdlCodegen
)
{
string csharpCodegenExecutable = Path.GetFullPath(
"Packages/com.seaube.ecs-idl/.tmp/ecs_idl_csharp_codegen.exe"
"Packages/com.seaube.ecs-idl/generators~/ecs_idl_csharp_codegen.exe"
);

var progressId = Progress.Start(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PkgInfoJson {
public class EcsIdlImporter : ScriptedImporter {
public override void OnImportAsset(AssetImportContext ctx) {
string codegenExecutable = Path.GetFullPath(
"Packages/com.seaube.ecs-idl/.tmp/ecs_idl_parser_info_codegen.exe"
"Packages/com.seaube.ecs-idl/generators~/ecs_idl_parser_info_codegen.exe"
);

Process codegen = new Process();
Expand Down
9 changes: 8 additions & 1 deletion packages/com.seaube.ecs-idl/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
"name": "com.seaube.ecs-idl",
"version": "0.1.1",
"version": "0.1.2",
"description": "ECS IDL Integration",
"displayName": "ECS IDL Integration",
"unity": "2021.2",
"author": {
"name" : "Seaube"
},
"dependencies": {
"com.unity.editorcoroutines": "1.0.0"
},
"repository": "https://github.com/seaube/ecs-idl-unity",
"publishConfig": {
"registry":"https://npm.pkg.github.com/@seaube"
}
}