Skip to content

Commit

Permalink
Merge pull request #46 from cgruber/really_update_from_upstream
Browse files Browse the repository at this point in the history
Really update from upstream this time.
  • Loading branch information
cgruber authored Feb 10, 2020
2 parents 500b5f6 + c64bff7 commit c10a5b7
Show file tree
Hide file tree
Showing 72 changed files with 562 additions and 97 deletions.
24 changes: 20 additions & 4 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ validate_config: 1
bazel: 1.1.0
tasks:
ubuntu1604:
build_targets:
- "//:rules_kotlin_release"
test_targets:
- "//:all_tests"
- "//examples/dagger/..."
- "//:all_tests"
- "//examples/dagger/..."
ubuntu1804:
test_targets:
- "//:all_tests"
- "//examples/dagger/..."
- "//:all_tests"
- "//examples/dagger/..."
build_targets:
- "//:rules_kotlin_release"
rbe_ubuntu1604:
test_targets:
- "--"
Expand All @@ -30,13 +34,21 @@ tasks:
example-android:
name: "Example - Android"
platform: ubuntu1804
shell_command:
- "cd .. && bazel build //:rules_kotlin_release_release && rm -rf /tmp/rules_kotlin_release && mkdir -p /tmp/rules_kotlin_release && tar -C /tmp/rules_kotlin_release -xvf bazel-bin/rules_kotlin_release_release.tgz"
working_directory: examples/android
test_flags:
- "--override_repository=io_bazel_rules_kotlin_release=/tmp/rules_kotlin_release"
test_targets:
- //...
examples-trivial:
name: "Example - Trivial"
platform: ubuntu1804
shell_command:
- "cd .. && bazel build //:rules_kotlin_release_release && rm -rf /tmp/rules_kotlin_release && mkdir -p /tmp/rules_kotlin_release && tar -C /tmp/rules_kotlin_release -xvf bazel-bin/rules_kotlin_release_release.tgz"
working_directory: examples/trivial
test_flags:
- "--override_repository=io_bazel_rules_kotlin_release=/tmp/rules_kotlin_release"
include_json_profile:
- build
- test
Expand All @@ -45,10 +57,14 @@ tasks:
examples-nodejs:
name: Example - Node
platform: ubuntu1804
shell_command:
- "cd bazel build //:rules_kotlin_release_release && rm -rf /tmp/rules_kotlin_release && mkdir -p /tmp/rules_kotlin_release && tar -C /tmp/rules_kotlin_release -xvf bazel-bin/rules_kotlin_release_release.tgz"
working_directory: examples/node
include_json_profile:
- build
- test
test_flags:
- "--override_repository=io_bazel_rules_kotlin_release=/tmp/rules_kotlin_release"
build_targets:
- //coroutines-helloworld/...
- //express/...
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
**/.ijwb
**/.aswb
**/.vscode
trace.profile.gz
16 changes: 16 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# 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.
load("//kotlin/internal/utils:packager.bzl", "release_archive")
load("//kotlin/internal/utils:utils.bzl", "utils")

exports_files([
"scripts/noop.sh",
Expand All @@ -33,3 +35,17 @@ test_suite(
"//src/test/kotlin/io/bazel/kotlin:local_assertion_tests",
],
)

# Release target.
release_archive(
name = "rules_kotlin_release",
src_map = {
"BUILD.release.bazel": "BUILD.bazel",
"WORKSPACE.release.bazel": "WORKSPACE",
},
deps = [
"//kotlin:pkg",
"//src/main/kotlin:pkg",
"//third_party:pkg",
],
)
13 changes: 13 additions & 0 deletions BUILD.release.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2020 The Bazel 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
#
# http://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.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

| Date                   | News |
| :----------- | -------- |
| Dec 6, 2019 | Released version [1.3.0-rc4](https://github.com/bazelbuild/rules_kotlin/releases/tag/legacy-1.3.0-rc4). |
| Dec 6, 2019 | Bug fixes and tweaks (#255, #257). |
| Feb 9, 2020 | Released version [1.3.0](https://github.com/bazelbuild/rules_kotlin/releases/tag/legacy-1.3.0). (No changes from `legacy-1.3.0-rc4`) |
| Jan 15, 2019 | Released version [1.3.0-rc4](https://github.com/bazelbuild/rules_kotlin/releases/tag/legacy-1.3.0-rc4). |
| Jan 15, 2019 | Bug fixes and tweaks (#255, #257). |
| Dec 6, 2019 | Released version [1.3.0-rc3](https://github.com/bazelbuild/rules_kotlin/releases/tag/legacy-1.3.0-rc3). |
| Dec 6, 2019 | Add support for later java versions as target platforms (#236). |
| Dec 5, 2019 | Released version [1.3.0-rc2](https://github.com/bazelbuild/rules_kotlin/releases/tag/legacy-1.3.0-rc2). |
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @ahumesky @cgruber @djwhang @jin @git-str @thomaswk @timpeut
* @ahumesky @cgruber @djwhang @jin @timpeut
52 changes: 39 additions & 13 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@
# limitations under the License.
workspace(name = "io_bazel_rules_kotlin")

RULES_NODEJS_VERSION = "0.36.1"
RULES_NODEJS_SHA = "3356c6b767403392bab018ce91625f6d15ff8f11c6d772dc84bc9cada01c669a"

BAZEL_TOOLCHAINS_VERSION = "be10bee3010494721f08a0fccd7f57411a1e773e"
BAZEL_TOOLCHAINS_SHA = "5962fe677a43226c409316fcb321d668fc4b7fa97cb1f9ef45e7dc2676097b26"

SKYLIB_VERSION = "0.8.0"
SKYLIB_SHA = "2ea8a5ed2b448baf4a6855d3ce049c4c452a6470b1efd1504fdb7c1c134d220a"

PROTOBUF_GIT_COMMIT = "09745575a923640154bcf307fba8aedff47f240a" # v3.8.0, as of 2019-05-28
PROTOBUF_SHA = "76ee4ba47dec6146872b6cd051ae5bd12897ef0b1523d5aeb56d81a5a4ca885a"

BAZEL_DEPS_VERSION = "0.1.0"
BAZEL_DEPS_SHA = "05498224710808be9687f5b9a906d11dd29ad592020246d4cd1a26eeaed0735e"


local_repository(
name = "node_example",
path = "examples/node",
Expand All @@ -22,9 +38,9 @@ load("//kotlin/internal/repositories:repositories.bzl", "github_archive")

github_archive(
name = "com_google_protobuf",
commit = "09745575a923640154bcf307fba8aedff47f240a", # v3.8.0, as of 2019-05-28
commit = PROTOBUF_GIT_COMMIT,
repo = "google/protobuf",
sha256 = "76ee4ba47dec6146872b6cd051ae5bd12897ef0b1523d5aeb56d81a5a4ca885a",
sha256 = PROTOBUF_SHA,
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
Expand All @@ -35,24 +51,24 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")

http_archive(
name = "bazel_skylib",
sha256 = "2ea8a5ed2b448baf4a6855d3ce049c4c452a6470b1efd1504fdb7c1c134d220a",
strip_prefix = "bazel-skylib-0.8.0",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/0.8.0.tar.gz"],
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/%s.tar.gz" % SKYLIB_VERSION],
strip_prefix = "bazel-skylib-%s" % SKYLIB_VERSION,
sha256 = SKYLIB_SHA,
)

http_jar(
name = "bazel_deps",
sha256 = "05498224710808be9687f5b9a906d11dd29ad592020246d4cd1a26eeaed0735e",
url = "https://github.com/hsyed/bazel-deps/releases/download/v0.1.0/parseproject_deploy.jar",
sha256 = BAZEL_DEPS_SHA,
url = "https://github.com/hsyed/bazel-deps/releases/download/v%s/parseproject_deploy.jar" % BAZEL_DEPS_VERSION,
)

http_archive(
name = "bazel_toolchains",
sha256 = "5962fe677a43226c409316fcb321d668fc4b7fa97cb1f9ef45e7dc2676097b26",
strip_prefix = "bazel-toolchains-be10bee3010494721f08a0fccd7f57411a1e773e",
sha256 = BAZEL_TOOLCHAINS_SHA,
strip_prefix = "bazel-toolchains-%s" % BAZEL_TOOLCHAINS_VERSION,
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/be10bee3010494721f08a0fccd7f57411a1e773e.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/archive/be10bee3010494721f08a0fccd7f57411a1e773e.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/%s.tar.gz" % BAZEL_TOOLCHAINS_VERSION,
"https://github.com/bazelbuild/bazel-toolchains/archive/%s.tar.gz" % BAZEL_TOOLCHAINS_VERSION,
],
)

Expand All @@ -64,6 +80,11 @@ rbe_autoconfig(
name = "buildkite_config",
)

load(
"//third_party/jvm:workspace.bzl", "maven_dependencies",
)

maven_dependencies()
load("//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")

kotlin_repositories()
Expand All @@ -74,8 +95,8 @@ kt_register_toolchains()

http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "3356c6b767403392bab018ce91625f6d15ff8f11c6d772dc84bc9cada01c669a",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.36.1/rules_nodejs-0.36.1.tar.gz"],
sha256 = RULES_NODEJS_SHA,
url = "https://github.com/bazelbuild/rules_nodejs/releases/download/{0}/rules_nodejs-{0}.tar.gz".format(RULES_NODEJS_VERSION),
)

load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")
Expand Down Expand Up @@ -110,3 +131,8 @@ maven_install(
],
)

http_archive(
name = "rules_pkg",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
)
14 changes: 14 additions & 0 deletions WORKSPACE.release.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2018 The Bazel 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
#
# http://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.
workspace(name = "io_bazel_rules_kotlin")
7 changes: 7 additions & 0 deletions examples/android/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ kotlin_repositories()

kt_register_toolchains()


# Skylib, for build_test, so don't bother initializing the unit test infrastructure.
http_archive(
name = "bazel_skylib",
Expand All @@ -66,3 +67,9 @@ http_archive(
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
],
)

http_archive(
name = "rules_pkg",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
)
1 change: 1 addition & 0 deletions examples/dagger/src/coffee/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_plugin")

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

load("//kotlin:kotlin.bzl", "kt_jvm_library")
Expand Down
6 changes: 3 additions & 3 deletions examples/node/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_js_import")

# Create kt_js_imports for KotlinX's Coroutines and Atomicfu libraries.
#
# These could be imported using package.json and NPM, but they are here as an example of how to
# These could be imported using package.json and NPM, but they are here as an example of how to
# use KotlinJS libraries hosted on Maven directly.
#
# Note: It's important that the `name`s correspond to the base name of the library only (ie. not-ending with -js/_js)
kt_js_import(
name = "kotlinx-coroutines-core",
jars = [
"@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core_js"
"@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core_js",
],
visibility = ["//:__subpackages__"],
)

kt_js_import(
name = "kotlinx-atomicfu",
jars = [
"@maven//:org_jetbrains_kotlinx_atomicfu_js"
"@maven//:org_jetbrains_kotlinx_atomicfu_js",
],
visibility = ["//:__subpackages__"],
)
6 changes: 6 additions & 0 deletions examples/node/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ maven_install(
"https://repo1.maven.org/maven2",
],
)

http_archive(
name = "rules_pkg",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
)
4 changes: 2 additions & 2 deletions examples/node/coroutines-helloworld/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
kt_js_library(
name = "app",
srcs = ["Main.kt"],
visibility = ["//visibility:public"],
deps = [
"//:kotlinx-coroutines-core",
],
visibility = ["//visibility:public"],
)

nodejs_binary(
name = "coroutines-helloworld",
node_modules = "@node_ws//:node_modules",
data = [":app"],
entry_point = ":app.js",
node_modules = "@node_ws//:node_modules",
visibility = ["//visibility:public"],
)
8 changes: 4 additions & 4 deletions examples/node/express/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ kt_js_library(
name = "acme-routes",
srcs = [":Routes.kt"],
deps = [
"//express/auth:acme-auth",
"//:kotlinx-atomicfu",
"//:kotlinx-coroutines-core",
"//express/auth:acme-auth",
],
)

kt_js_library(
name ="app",
name = "app",
srcs = [":App.kt"],
deps = [
":acme-routes",
":acme-routes",
"//:kotlinx-coroutines-core",
],
)

# The binary demonstrates an express app composed of three modules. The modules can co-exist in the same directory.
nodejs_binary(
name = "express",
node_modules = "@node_ws//:node_modules",
data = [":app"],
entry_point = ":app.js",
node_modules = "@node_ws//:node_modules",
)
2 changes: 1 addition & 1 deletion examples/node/express/auth/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_js_library")
kt_js_library(
name = "acme-auth",
srcs = ["Auth.kt"],
visibility=["//visibility:public"]
visibility = ["//visibility:public"],
)
6 changes: 6 additions & 0 deletions examples/trivial/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ maven_install(
"https://repo1.maven.org/maven2",
],
)

http_archive(
name = "rules_pkg",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
)
9 changes: 9 additions & 0 deletions kotlin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@
# 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.
load("//kotlin/internal/utils:packager.bzl", "release_archive")

release_archive(
name = "pkg",
srcs = glob(["*.*"]) + ["BUILD"],
deps = [
"//kotlin/internal:pkg",
],
)
Loading

0 comments on commit c10a5b7

Please sign in to comment.