Skip to content

Commit 7f85d63

Browse files
Update licenses, bring in Bazel for github deployment
1 parent 4652e2e commit 7f85d63

File tree

16 files changed

+420
-101
lines changed

16 files changed

+420
-101
lines changed

.bazelrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
6+
try-import ./.bazel-remote-cache.rc
7+
8+
build --incompatible_strict_action_env
9+
run --incompatible_strict_action_env
10+
test --incompatible_strict_action_env

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.2.0

.gitignore

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,66 @@
1+
# Mac
12
.DS_Store
23

3-
__pycache__
4+
# Bazel
5+
bazel-*
6+
.bazel-remote-cache.rc
7+
.bazel-cache-credential.json
8+
9+
# IDE
10+
.idea/
11+
*.iml
12+
*.ipr
13+
*.iws
14+
*.geany
15+
.ijwb/
16+
17+
# VS Code
18+
.vscode/
19+
.settings/
20+
.project
21+
.classpath
422

23+
# Compiled
24+
dist/
25+
out/
26+
*.class
527
target
628

7-
# dependencies
29+
# Package
30+
*.jarg
31+
*.war
32+
*.ear
33+
34+
# Gradle
35+
.gradle/
36+
37+
# Debug
38+
dep.tree
39+
40+
# Node
841
node_modules
942
.pnp
1043
.pnp.js
1144

12-
# testing
13-
/coverage
45+
# Databases
46+
db/
47+
48+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml #
49+
hs_err_pid*
1450

15-
# production
16-
/build
51+
# Log
52+
logs/
53+
*.log
1754

18-
# misc
19-
.env.local
20-
.env.development.local
21-
.env.test.local
22-
.env.production.local
55+
# VIM swap
56+
*.swp
57+
*.swo
58+
59+
# Python cache
60+
__pycache__
2361

24-
npm-debug.log*
25-
yarn-debug.log*
26-
yarn-error.log*
62+
# AI tools
63+
.aider*
64+
.clinerules
65+
.qodo
66+
memory-bank

BUILD

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
load("@rules_pkg//:pkg.bzl", "pkg_tar")
19+
load("@typedb_bazel_distribution//common:rules.bzl", "assemble_versioned", "assemble_zip", "assemble_targz")
20+
load("@typedb_bazel_distribution//common/tgz2zip:rules.bzl", "tgz2zip")
21+
22+
load("@typedb_bazel_distribution//github:rules.bzl", "deploy_github")
23+
24+
load("//:deployment.bzl", deployment = "deployment")
25+
26+
pkg_tar(
27+
name = "typedb-examples-usecase-datasets-tar",
28+
srcs = [
29+
"//use-cases/bookstore:bookstore-dataset",
30+
"//use-cases/social-network:social-network-dataset"
31+
],
32+
)
33+
34+
assemble_targz(
35+
name = "typedb-example-usecase-datasets-targz",
36+
targets = [
37+
"typedb-examples-usecase-datasets-tar",
38+
],
39+
)
40+
41+
tgz2zip(
42+
name = "typedb-example-usecase-datasets-zip",
43+
tgz = ":typedb-example-usecase-datasets-targz",
44+
output_filename = "typedb-example-usecase-datasets"
45+
)
46+
47+
deploy_github(
48+
name = "deploy-github",
49+
release_description = "//:RELEASE_NOTES_LATEST.md",
50+
title = "TypeDB Example Datasets",
51+
title_append_version = True,
52+
organisation = deployment['github.organisation'],
53+
repository = deployment['github.repository'],
54+
draft = False,
55+
archive = ":typedb-example-usecase-datasets-zip"
56+
)

RELEASE_NOTES_LATEST.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## TypeDB Example Datasets
2+
3+
Pairs of `schema.tql` and `data.tql` files that can be used to quickly set up demo
4+
TypeDB databases.
5+
6+
These are typically toy datasets or excerpts of real-world databases.

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.5.0

WORKSPACE

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
workspace(name = "typedb-examples")
19+
20+
################################
21+
# Load @typedb_dependencies #
22+
################################
23+
24+
load("//dependencies/typedb:repositories.bzl", "typedb_dependencies")
25+
typedb_dependencies()
26+
27+
# Load //builder/python
28+
load("@typedb_dependencies//builder/python:deps.bzl", "rules_python")
29+
rules_python()
30+
load("@rules_python//python:repositories.bzl", "py_repositories")
31+
py_repositories()
32+
33+
# Load //builder/bazel for RBE
34+
load("@typedb_dependencies//builder/bazel:deps.bzl", "bazel_toolchain")
35+
bazel_toolchain()
36+
37+
# Load //builder/kotlin
38+
load("@typedb_dependencies//builder/kotlin:deps.bzl", "io_bazel_rules_kotlin")
39+
io_bazel_rules_kotlin()
40+
load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories")
41+
kotlin_repositories()
42+
load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
43+
kt_register_toolchains()
44+
45+
# Load //tool/common
46+
load("@typedb_dependencies//tool/common:deps.bzl", "typedb_dependencies_ci_pip")
47+
typedb_dependencies_ci_pip()
48+
load("@typedb_dependencies_ci_pip//:requirements.bzl", "install_deps")
49+
install_deps()
50+
51+
# Load //tool/checkstyle
52+
load("@typedb_dependencies//tool/checkstyle:deps.bzl", checkstyle_deps = "deps")
53+
checkstyle_deps()
54+
55+
# Load //tool/unuseddeps
56+
load("@typedb_dependencies//tool/unuseddeps:deps.bzl", unuseddeps_deps = "deps")
57+
unuseddeps_deps()
58+
59+
###################################
60+
# Load @typedb_bazel_distribution #
61+
###################################
62+
63+
load("@typedb_dependencies//distribution:deps.bzl", "typedb_bazel_distribution")
64+
typedb_bazel_distribution()
65+
66+
# Load //common
67+
load("@typedb_bazel_distribution//common:deps.bzl", "rules_pkg")
68+
rules_pkg()
69+
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
70+
rules_pkg_dependencies()
71+
72+
# Load //pip
73+
load("@typedb_bazel_distribution//pip:deps.bzl", "typedb_bazel_distribution_pip")
74+
typedb_bazel_distribution_pip()
75+
load("@typedb_bazel_distribution_pip//:requirements.bzl", "install_deps")
76+
install_deps()
77+
78+
# Load //github
79+
load("@typedb_bazel_distribution//github:deps.bzl", "ghr_osx_zip", "ghr_linux_tar")
80+
ghr_osx_zip()
81+
ghr_linux_tar()
82+
83+
# Load //maven
84+
load("@typedb_bazel_distribution//maven:deps.bzl", typedb_bazel_distribution_maven_artifacts = "maven_artifacts")
85+
86+
# Load @typedb_bazel_distribution_cloudsmith
87+
load("@typedb_bazel_distribution//common/uploader:deps.bzl", "typedb_bazel_distribution_uploader")
88+
typedb_bazel_distribution_uploader()
89+
load("@typedb_bazel_distribution_uploader//:requirements.bzl", install_uploader_deps = "install_deps")
90+
install_uploader_deps()
91+
92+
##############################
93+
# Generate workspace refs #
94+
##############################
95+
96+
load("@typedb_bazel_distribution//common:rules.bzl", "workspace_refs")
97+
workspace_refs(name = "typedb_examples_workspace_refs")

dependencies/typedb/BUILD

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
load("@typedb_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test")
19+
20+
checkstyle_test(
21+
name = "checkstyle",
22+
include = glob(["*"]),
23+
license_type = "mpl-header",
24+
)

dependencies/typedb/repositories.bzl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
19+
20+
def typedb_dependencies():
21+
git_repository(
22+
name = "typedb_dependencies",
23+
remote = "https://github.com/typedb/typedb-dependencies",
24+
commit = "f6e710f9857b1c30ad1764c1c41afce4e4e02981", # sync-marker: do not remove this comment, this is used for sync-dependencies by @typedb_dependencies
25+
)

deployment.bzl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
6+
deployment = {
7+
'github.organisation': 'typedb',
8+
'github.repository': 'typedb-examples'
9+
}

0 commit comments

Comments
 (0)