srctree

Johan parent fa681630 36d76780 ff1bdbf9
Merge pull request #336 from johnor/pre-commit

Pre commit
filename was Deleted added: 45, removed: 17, total 28
@@ -0,0 +1,12 @@
---
name: pre-commit
 
on: [push, pull_request]
 
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
 
filename was Deleted added: 45, removed: 17, total 28
@@ -0,0 +1,7 @@
---
repos:
- repo: https://github.com/keith/pre-commit-buildifier
rev: 4.2.0
hooks:
- id: buildifier
- id: buildifier-lint
 
WORKSPACE added: 45, removed: 17, total 28
@@ -11,8 +11,8 @@ git_repository(
 
new_git_repository(
name = "fmtlib",
remote = "https://github.com/fmtlib/fmt",
build_file = "@nes//third_party:fmtlib.BUILD",
commit = "d141cdbeb0fb422a3fb7173b285fd38e0d1772dc",
build_file = "@nes//third_party:BUILD.fmtlib",
remote = "https://github.com/fmtlib/fmt",
shallow_since = "1625267673 -0700",
)
 
core/BUILD.bazel added: 45, removed: 17, total 28
@@ -22,8 +22,8 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
":core",
"@gtest",
"@fmtlib",
"@gtest",
],
)
 
 
core/defs.bzl added: 45, removed: 17, total 28
@@ -1,18 +1,28 @@
"""
Bazel helpers.
"""
 
# From: https://github.com/bazelbuild/bazel/issues/2670
def private_include_copts(includes):
""" Sets up copts to allow including this project as a third party dependency.
 
From: https://github.com/bazelbuild/bazel/issues/2670
 
Args:
includes: headers to include
Returns:
Patched copts
"""
copts = []
prefix = ''
prefix = ""
 
# convert "@" to "external/" unless in the main workspace
repo_name = native.repository_name()
package_name = native.package_name()
if repo_name != '@':
prefix = 'external/{}/'.format(repo_name[1:])
if repo_name != "@":
prefix = "external/{}/".format(repo_name[1:])
 
for inc in includes:
copts.append("-I{}{}/{}".format(prefix, package_name, inc))
copts.append("-I$(GENDIR)/{}{}/{}".format(prefix, package_name, inc))
 
return copts
 
 
disassembler/BUILD.bazel added: 45, removed: 17, total 28
@@ -28,4 +28,3 @@ cc_test(
"@gtest",
],
)
 
 
nestest/BUILD.bazel added: 45, removed: 17, total 28
@@ -3,8 +3,8 @@ cc_binary(
srcs = ["src/main.cpp"],
deps = [
"//core",
"//nes",
"//disassembler",
"//nes",
"@fmtlib",
],
)
 
filename was Deleted added: 45, removed: 17, total 28