Skip to content

Commit

Permalink
rules_pkl@0.1.0 (#1921)
Browse files Browse the repository at this point in the history
This is the initial release of `rules_pkl`, which are rules to make
using [Pkl](https://pkl-lang.org) a pleasure with Bazel.
  • Loading branch information
shs96c committed May 3, 2024
1 parent be9b509 commit 0e57fd0
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 0 deletions.
144 changes: 144 additions & 0 deletions modules/rules_pkl/0.1.0/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"Bazel dependencies"

module(
name = "rules_pkl",
version = "0.1.0",
compatibility_level = 1,
)

bazel_dep(
name = "bazel_skylib",
version = "1.5.0",
)
bazel_dep(
name = "rules_jvm_external",
version = "5.3",
)
bazel_dep(name = "aspect_bazel_lib", version = "2.5.3")

pkl = use_extension("//pkl:extensions.bzl", "pkl")
use_repo(
pkl,
"pkl-cli-linux-aarch64",
"pkl-cli-linux-amd64",
"pkl-cli-macos-aarch64",
"pkl-cli-macos-amd64",
)

register_toolchains(
"@rules_pkl//pkl:pkl_toolchain_macos_aarch64",
"@rules_pkl//pkl:pkl_toolchain_macos_amd64",
"@rules_pkl//pkl:pkl_toolchain_linux_aarch64",
"@rules_pkl//pkl:pkl_toolchain_linux_amd64",
)

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
name = "rules_pkl_deps",
artifacts = [
"org.pkl-lang:pkl-cli-java:0.25.3",
"org.pkl-lang:pkl-doc:0.25.3",
"org.pkl-lang:pkl-tools:0.25.3",
"com.google.code.gson:gson:2.10.1",
],
lock_file = "//pkl/private:pkl_deps_install.json",
repositories = [
"https://repo1.maven.org/maven2/",
],
)
use_repo(
maven,
"rules_pkl_deps",
"unpinned_rules_pkl_deps",
)

bazel_dep(
name = "bazel_skylib_gazelle_plugin",
version = "1.4.1",
dev_dependency = True,
)
bazel_dep(
name = "buildifier_prebuilt",
version = "6.1.0",
dev_dependency = True,
)
bazel_dep(
name = "gazelle",
version = "0.35.0",
dev_dependency = True,
repo_name = "bazel_gazelle",
)

bazel_dep(
name = "platforms",
version = "0.0.8",
)

bazel_dep(
name = "rules_python",
version = "0.27.0",
dev_dependency = True,
)
bazel_dep(
name = "stardoc",
version = "0.6.2",
dev_dependency = True,
)

python = use_extension(
"@rules_python//python/extensions:python.bzl",
"python",
dev_dependency = True,
)
python.toolchain(
configure_coverage_tool = True,
ignore_root_user_error = True,
python_version = "3.11",
)

pip = use_extension(
"@rules_python//python/extensions:pip.bzl",
"pip",
dev_dependency = True,
)
pip.parse(
hub_name = "pip",
python_version = "3.11",
requirements_lock = "//tests:requirements_lock.txt",
)
use_repo(
pip,
"pip",
)

bazel_dep(
name = "rules_bazel_integration_test",
version = "0.23.0",
dev_dependency = True,
)

bazel_binaries = use_extension(
"@rules_bazel_integration_test//:extensions.bzl",
"bazel_binaries",
dev_dependency = True,
)
bazel_binaries.download(version = "7.0.2")
use_repo(
bazel_binaries,
"bazel_binaries",
"bazel_binaries_bazelisk",
"build_bazel_bazel_7_0_2",
)
Empty file.
34 changes: 34 additions & 0 deletions modules/rules_pkl/0.1.0/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
bazel:
- 7.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@rules_pkl//pkl/...'
bcr_test_module:
module_path: tests/integration_tests/example_workspaces/simple
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
bazel:
- 7.x
tasks:
run_test_module:
name: Run test module
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- //...
test_targets:
- //...
9 changes: 9 additions & 0 deletions modules/rules_pkl/0.1.0/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"url": "https://github.com/apple/rules_pkl/releases/download/v0.1.0/rules_pkl-0.1.0.tar.gz",
"integrity": "sha256-YM/XEtDT1pSBvoIbjeoOZ4PjyQdwW9aHyBclUU+ccv4=",
"strip_prefix": "rules_pkl-0.1.0",
"patches": {
"update-version.patch": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="
},
"patch_strip": 1
}
16 changes: 16 additions & 0 deletions modules/rules_pkl/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"homepage": "https://github.com/apple/rules_pkl",
"maintainers": [
{
"email": "pkl-oss@group.apple.com",
"name": "The Pkl Project"
}
],
"repository": [
"github:apple/rules_pkl"
],
"versions": [
"0.1.0"
],
"yanked_versions": {}
}

0 comments on commit 0e57fd0

Please sign in to comment.