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 0584952 commit 84c0c6e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 40 deletions.
13 changes: 2 additions & 11 deletions examples/android/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,15 @@ kotlin_repositories()

kt_register_toolchains()

# Skylib, for build_test, so don't bother initializing the unit test infrastructure.
http_archive(
name = "bazel_skylib",
sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
urls = [
"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",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
)

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"],
)
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 84c0c6e

Please sign in to comment.