Skip to content

Commit

Permalink
Fix starlark autoformatting
Browse files Browse the repository at this point in the history
Fix .bazelignore (wonder what formatted that.)
Removed merge artifact from toolchain.
  • Loading branch information
Corbin Smith committed Nov 16, 2020
1 parent e53c48b commit c729940
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 37 deletions.
6 changes: 5 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,24 @@
# limitations under the License.
workspace(name = "io_bazel_rules_kotlin")


load("//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies")

kt_download_local_dev_dependencies()

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

kotlin_repositories()

kt_register_toolchains()

# Creates toolchain configuration for remote execution with BuildKite CI
# for rbe_ubuntu1604
load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")

rbe_autoconfig(
name = "buildkite_config",
)

android_sdk_repository(name = "androidsdk")

android_ndk_repository(name = "androidndk")
2 changes: 1 addition & 1 deletion WORKSPACE.release.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# 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")
workspace(name = "io_bazel_rules_kotlin")
7 changes: 4 additions & 3 deletions examples/android/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ local_repository(
path = "../..",
)


load("@io_bazel_rules_kotlin//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies")

kt_download_local_dev_dependencies()

load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
Expand All @@ -68,14 +68,15 @@ kt_register_toolchains()

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",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "build_bazel_rules_android",
urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
strip_prefix = "rules_android-0.1.1",
urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
)
7 changes: 5 additions & 2 deletions examples/node/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ workspace(name = "kotlin_node_examples")
# Directly load the kotlin rules from the parent repo.
local_repository(
name = "io_bazel_rules_kotlin",
path = "../.."
path = "../..",
)

load("@io_bazel_rules_kotlin//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies")

kt_download_local_dev_dependencies()

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

kotlin_repositories()

kt_register_toolchains()

# Node example dependencies
Expand Down Expand Up @@ -40,4 +43,4 @@ yarn_install(
name = "node_ws",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
)
)
3 changes: 2 additions & 1 deletion examples/trivial/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local_repository(
)

load("@io_bazel_rules_kotlin//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies")

kt_download_local_dev_dependencies()

load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
Expand Down Expand Up @@ -48,6 +49,6 @@ 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",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
)
5 changes: 3 additions & 2 deletions scripts/reflow_skylark
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@

buildifier $(find . -type f \
-iname "*.bzl" -or \
-name "BUILD*"
)
-name "*.bazel" -or \
-name "WORKSPACE"
)
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,23 @@ class KotlinToolchain private constructor(
"org.jetbrains.kotlin.kapt3"
),
val jvmAbiGen: CompilerPlugin,
val skipCodeGen: CompilerPlugin,
val extensionsCompiler: CompilerPlugin = CompilerPlugin(
kotlinHome.resolveVerified(
"lib", "android-extensions-compiler.jar").absolutePath,
"org.jetbrains.kotlin.android"
)
val skipCodeGen: CompilerPlugin
) {

companion object {
private val DEFAULT_JVM_ABI_PATH = BazelRunFiles.resolveVerified(
"external", "com_github_jetbrains_kotlin", "lib", "jvm-abi-gen.jar").toPath()
"external", "com_github_jetbrains_kotlin", "lib", "jvm-abi-gen.jar"
).toPath()

private val COMPILER = BazelRunFiles.resolveVerified(
"io_bazel_rules_kotlin",
"src", "main", "kotlin", "io", "bazel", "kotlin", "compiler",
"compiler.jar").toPath()
"io_bazel_rules_kotlin",
"src", "main", "kotlin", "io", "bazel", "kotlin", "compiler",
"compiler.jar").toPath()

private val SKIP_CODE_GEN_PLUGIN = BazelRunFiles.resolveVerified(
"io_bazel_rules_kotlin",
"src", "main", "kotlin",
"skip-code-gen.jar").toPath()
"io_bazel_rules_kotlin",
"src", "main", "kotlin",
"skip-code-gen.jar").toPath()

internal val NO_ARGS = arrayOf<Any>()

Expand Down Expand Up @@ -99,7 +95,7 @@ class KotlinToolchain private constructor(
val skipCodeGenFile = SKIP_CODE_GEN_PLUGIN.verified().absoluteFile

val kotlinCompilerJar = BazelRunFiles.resolveVerified(
"external", "com_github_jetbrains_kotlin", "lib", "kotlin-compiler.jar")
"external", "com_github_jetbrains_kotlin", "lib", "kotlin-compiler.jar")

val jvmAbiGenFile = jvmAbiGenPath.verified()
return KotlinToolchain(
Expand All @@ -108,20 +104,20 @@ class KotlinToolchain private constructor(
javaHome,
listOf(
kotlinCompilerJar,
COMPILER.verified().absoluteFile,
// plugins *must* be preloaded. Not doing so causes class conflicts
// (and a NoClassDef err) in the compiler extension interfaces.
// This may cause issues in accepting user defined compiler plugins.
jvmAbiGenFile.absoluteFile,
skipCodeGenFile
COMPILER.verified().absoluteFile,
// plugins *must* be preloaded. Not doing so causes class conflicts
// (and a NoClassDef err) in the compiler extension interfaces.
// This may cause issues in accepting user defined compiler plugins.
jvmAbiGenFile.absoluteFile,
skipCodeGenFile
)
),
jvmAbiGen = CompilerPlugin(
jvmAbiGenFile.absolutePath,
"org.jetbrains.kotlin.jvm.abi"),
skipCodeGen = CompilerPlugin(
skipCodeGenFile.absolutePath,
"io.bazel.kotlin.plugin.SkipCodeGen")
),
jvmAbiGen = CompilerPlugin(
jvmAbiGenFile.absolutePath,
"org.jetbrains.kotlin.jvm.abi"),
skipCodeGen = CompilerPlugin(
skipCodeGenFile.absolutePath,
"io.bazel.kotlin.plugin.SkipCodeGen")
)
}
}
Expand Down

0 comments on commit c729940

Please sign in to comment.