Skip to content

Commit

Permalink
Kotlin 1.4 (#363)
Browse files Browse the repository at this point in the history
* Kotlin 1.4

* Reverted non-Kotlin library upgrades

* Removed duplicates
  • Loading branch information
fkorotkov authored Nov 4, 2020
1 parent 9d3ea04 commit 730d9ef
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 24 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "define_kt_toolchain")

define_kt_toolchain(
name = "kotlin_toolchain",
api_version = KOTLIN_LANGUAGE_LEVEL, # "1.1", "1.2", or "1.3"
jvm_target = JAVA_LANGUAGE_LEVEL, # "1.6", "1.8", "9", "10", "11", or "12",
language_version = KOTLIN_LANGUAGE_LEVEL, # "1.1", "1.2", or "1.3"
api_version = KOTLIN_LANGUAGE_LEVEL, # "1.1", "1.2", "1.3", or "1.4"
jvm_target = JAVA_LANGUAGE_LEVEL, # "1.6", "1.8", "9", "10", "11", "12", or "13",
language_version = KOTLIN_LANGUAGE_LEVEL, # "1.1", "1.2", "1.3", or "1.4"
)
```

Expand All @@ -137,7 +137,7 @@ register_toolchains("//:kotlin_toolchain")

## Custom `kotlinc` distribution (and version)

To choose a different `kotlinc` distribution (only 1.3 variants supported), do the following
To choose a different `kotlinc` distribution (1.3 and 1.4 variants supported), do the following
in your `WORKSPACE` file (or import from a `.bzl` file:

```python
Expand Down
2 changes: 1 addition & 1 deletion kotlin/internal/jvm/jvm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ git_repository(
commit = "<COMMIT_HASH>",
)
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
kotlin_repositories(kotlin_release_version = "1.2.21")
kotlin_repositories(kotlin_release_version = "1.4.0")
kt_register_toolchains()
```
Expand Down
4 changes: 2 additions & 2 deletions kotlin/internal/repositories/nomaven_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ BAZEL_JAVA_LAUNCHER_VERSION = "0.28.1"

KOTLIN_CURRENT_COMPILER_RELEASE = {
"urls": [
"https://github.com/JetBrains/kotlin/releases/download/v1.3.50/kotlin-compiler-1.3.50.zip",
"https://github.com/JetBrains/kotlin/releases/download/v1.4.0/kotlin-compiler-1.4.0.zip",
],
"sha256": "69424091a6b7f52d93eed8bba2ace921b02b113dbb71388d704f8180a6bdc6ec",
"sha256": "590391d13b3c65ba52cba470f56efd5b14e2b1f5b9459f63aa12eb38ef52f161",
}

def kotlin_repositories(compiler_release = KOTLIN_CURRENT_COMPILER_RELEASE):
Expand Down
4 changes: 2 additions & 2 deletions kotlin/internal/repositories/release_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ BAZEL_JAVA_LAUNCHER_VERSION = "0.28.1"

KOTLIN_CURRENT_COMPILER_RELEASE = {
"urls": [
"https://github.com/JetBrains/kotlin/releases/download/v1.3.50/kotlin-compiler-1.3.50.zip",
"https://github.com/JetBrains/kotlin/releases/download/v1.4.0/kotlin-compiler-1.4.0.zip",
],
"sha256": "69424091a6b7f52d93eed8bba2ace921b02b113dbb71388d704f8180a6bdc6ec",
"sha256": "590391d13b3c65ba52cba470f56efd5b14e2b1f5b9459f63aa12eb38ef52f161",
}

def kotlin_repositories(compiler_release = KOTLIN_CURRENT_COMPILER_RELEASE):
Expand Down
18 changes: 9 additions & 9 deletions kotlin/internal/repositories/setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ def kt_configure():
name = "kotlin_rules_maven",
fetch_sources = True,
artifacts = [
"org.jetbrains.kotlinx:atomicfu-js:0.13.1",
"org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.3.2",
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1",
"org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.14.0",
"com.google.code.findbugs:jsr305:3.0.2",
"junit:junit:4.13-beta-3",
"com.google.protobuf:protobuf-java:3.6.0",
Expand All @@ -43,12 +39,16 @@ def kt_configure():
"javax.annotation:javax.annotation-api:1.3.2",
"javax.inject:javax.inject:1",
"org.pantsbuild:jarjar:1.7.2",
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.6",
"org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.6",
"org.jetbrains.kotlinx:kotlinx-coroutines-debug:1.3.6",
"org.jetbrains.kotlinx:atomicfu-js:0.14.0",
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9",
"org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.3.9",
"org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.9",
"org.jetbrains.kotlinx:kotlinx-coroutines-debug:1.3.9",
"org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.14.0",
],
repositories = [
"https://maven-central.storage.googleapis.com/repos/central/data/",
"https://jcenter.bintray.com/",
"https://repo1.maven.org/maven2",
],
)
Expand All @@ -59,13 +59,13 @@ def kt_configure():
http_java_proto_file(
name = "deps",
sha256 = "b861dbce04177df9e4b7204876b2f27e18f40eb6d20b3dffefecdd2baf3cfe92",
urls = ["https://raw.githubusercontent.com/bazelbuild/bazel/2.0.0/src/main/protobuf/deps.proto"],
urls = ["https://raw.githubusercontent.com/bazelbuild/bazel/3.4.1/src/main/protobuf/deps.proto"],
)

http_java_proto_file(
name = "worker_protocol",
sha256 = "1157c93666f98cfcfcc9f7b073b8dac5bbd50e18f5ab981e93c71e03ed08f304",
urls = ["https://raw.githubusercontent.com/bazelbuild/bazel/2.0.0/src/main/protobuf/worker_protocol.proto"],
urls = ["https://raw.githubusercontent.com/bazelbuild/bazel/3.4.1/src/main/protobuf/worker_protocol.proto"],
)

stardoc_repositories()
11 changes: 7 additions & 4 deletions kotlin/internal/toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ load("@io_bazel_rules_kotlin//kotlin:toolchains.bzl", "define_kt_toolchain")
define_kt_toolchain(
name= "custom_toolchain",
api_version = "1.1",
language_version = "1.1",
api_version = "1.4",
language_version = "1.4",
)
```
and then register it in the `WORKSPACE`:
Expand Down Expand Up @@ -92,20 +92,22 @@ _kt_toolchain = rule(
),
"language_version": attr.string(
doc = "this is the -language_version flag [see](https://kotlinlang.org/docs/reference/compatibility.html)",
default = "1.3",
default = "1.4",
values = [
"1.1",
"1.2",
"1.3",
"1.4",
],
),
"api_version": attr.string(
doc = "this is the -api_version flag [see](https://kotlinlang.org/docs/reference/compatibility.html).",
default = "1.3",
default = "1.4",
values = [
"1.1",
"1.2",
"1.3",
"1.4",
],
),
"debug": attr.string_list(
Expand Down Expand Up @@ -146,6 +148,7 @@ _kt_toolchain = rule(
"10",
"11",
"12",
"13",
],
),
"js_target": attr.string(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ public final void resetForNext() {
KotlinToolchainInfo.newBuilder()
.setCommon(
KotlinToolchainInfo.Common.newBuilder()
.setApiVersion("1.2")
.setApiVersion("1.4")
.setCoroutines("enabled")
.setLanguageVersion("1.2"))
.setLanguageVersion("1.4"))
.setJvm(KotlinToolchainInfo.Jvm.newBuilder().setJvmTarget("1.8")));
try {
this.instanceRoot = Files.createTempDirectory(BAZEL_TEST_DIR, label);
Expand Down

0 comments on commit 730d9ef

Please sign in to comment.