-
Notifications
You must be signed in to change notification settings - Fork 87
Rework in Kotlin #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework in Kotlin #123
Changes from all commits
45dd729
b668cc8
e59794e
8e6b4cc
44260cd
eaaf028
3fdd2ba
c085e84
3609182
4653365
c9f9c16
f609b03
ffd6315
68672fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| run -c opt --show_loading_progress=false --show_progress=false --ui_event_filters='ERROR' | ||
| run:verbose -c dbg --show_loading_progress=true --show_progress=true --ui_event_filters='INFO,ERROR,DEBUG' | ||
| # https://github.com/mockito/mockito/issues/1879 | ||
| test --sandbox_tmpfs_path=/tmp |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,9 @@ | ||
| alias( | ||
| name = "bazel-diff", | ||
| actual = "//src/main/java/com/bazel_diff:bazel-diff" | ||
| ) | ||
| #alias( | ||
| # name = "bazel-diff", | ||
| # actual = "//bazel-diff", | ||
| #) | ||
| # | ||
| #alias( | ||
| # name = "tests", | ||
| # actual = "//bazel-diff:tests", | ||
| #) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,14 @@ | |
| load("@rules_jvm_external//:specs.bzl", "maven") | ||
|
|
||
| BAZEL_DIFF_MAVEN_ARTIFACTS = [ | ||
| maven.artifact("junit", "junit", "4.13", testonly = True), | ||
| maven.artifact("org.mockito", "mockito-core", "3.5.15", testonly = True), | ||
| maven.artifact("junit", "junit", "4.13"), | ||
| maven.artifact("org.mockito.kotlin", "mockito-kotlin", "4.0.0", testonly = True), | ||
| maven.artifact("com.willowtreeapps.assertk", "assertk-jvm", "0.25", testonly = True), | ||
| maven.artifact("io.insert-koin", "koin-test-junit4", "3.1.6", testonly = True), | ||
| "info.picocli:picocli:jar:4.3.2", | ||
| "com.google.code.gson:gson:jar:2.8.6", | ||
| "com.google.guava:guava:29.0-jre", | ||
| "org.apache.commons:commons-pool2:2.11.1", | ||
|
Comment on lines
10
to
13
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we go through these and upgrade them as well?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, will raise another PR then
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "io.insert-koin:koin-core-jvm:3.1.6", | ||
| "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2", | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_proto_library") | ||
| load("@rules_proto//proto:defs.bzl", "proto_library") | ||
| load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary", "kt_jvm_library", "kt_jvm_test") | ||
| load("@rules_jvm_external//:defs.bzl", "artifact") | ||
|
|
||
| config_setting( | ||
| name = "enable_debug", | ||
| values = { | ||
| "compilation_mode": "dbg", | ||
| }, | ||
| ) | ||
|
|
||
| java_binary( | ||
| name = "bazel-diff", | ||
| jvm_flags = select({ | ||
| ":enable_debug": ["-DDEBUG=true"], | ||
| "//conditions:default": [], | ||
| }), | ||
| main_class = "com.bazel_diff.Main", | ||
| visibility = ["//visibility:public"], | ||
| runtime_deps = [":cli-lib"], | ||
| ) | ||
|
|
||
| kt_jvm_library( | ||
| name = "cli-lib", | ||
| srcs = glob(["src/main/kotlin/**/*.kt"]), | ||
| deps = [ | ||
| ":build_java_proto", | ||
| "@bazel_diff_maven//:com_google_code_gson_gson", | ||
| "@bazel_diff_maven//:com_google_guava_guava", | ||
| "@bazel_diff_maven//:info_picocli_picocli", | ||
| "@bazel_diff_maven//:io_insert_koin_koin_core_jvm", | ||
| "@bazel_diff_maven//:org_apache_commons_commons_pool2", | ||
| "@bazel_diff_maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm", | ||
| "@com_google_protobuf//:protobuf_java", | ||
| ], | ||
| ) | ||
|
|
||
| java_proto_library( | ||
| name = "build_java_proto", | ||
| deps = [":build_proto"], | ||
| ) | ||
|
|
||
| proto_library( | ||
| name = "build_proto", | ||
| srcs = [":build_proto_gen"], | ||
| ) | ||
|
|
||
| genrule( | ||
| name = "build_proto_gen", | ||
| srcs = ["@bazel_tools//src/main/protobuf:build.proto"], | ||
| outs = ["build.proto"], | ||
| cmd = "cp $< $@", | ||
| ) | ||
|
|
||
| kt_jvm_test( | ||
| name = "BuildGraphHasherTest", | ||
| test_class = "com.bazel_diff.hash.BuildGraphHasherTest", | ||
| runtime_deps = [":cli-test-lib"], | ||
| ) | ||
|
|
||
| kt_jvm_test( | ||
| name = "CalculateImpactedTargetsInteractorTest", | ||
| test_class = "com.bazel_diff.interactor.CalculateImpactedTargetsInteractorTest", | ||
| runtime_deps = [":cli-test-lib"], | ||
| ) | ||
|
|
||
| kt_jvm_test( | ||
| name = "NormalisingPathConverterTest", | ||
| test_class = "com.bazel_diff.cli.converter.NormalisingPathConverterTest", | ||
| runtime_deps = [":cli-test-lib"], | ||
| ) | ||
|
|
||
| kt_jvm_test( | ||
| name = "OptionsConverterTest", | ||
| test_class = "com.bazel_diff.cli.converter.OptionsConverterTest", | ||
| runtime_deps = [":cli-test-lib"], | ||
| ) | ||
|
|
||
| kt_jvm_test( | ||
| name = "DeserialiseHashesInteractorTest", | ||
| test_class = "com.bazel_diff.interactor.DeserialiseHashesInteractorTest", | ||
| runtime_deps = [":cli-test-lib"], | ||
| ) | ||
|
|
||
| kt_jvm_test( | ||
| name = "E2ETest", | ||
| test_class = "com.bazel_diff.e2e.E2ETest", | ||
| runtime_deps = [":cli-test-lib"], | ||
| ) | ||
|
|
||
| kt_jvm_library( | ||
| name = "cli-test-lib", | ||
| testonly = True, | ||
| srcs = glob(["src/test/kotlin/**/*.kt"]), | ||
| resources = glob(["src/test/resources/**/*"]), | ||
| deps = [ | ||
| ":cli-lib", | ||
| "@bazel_diff_maven//:com_willowtreeapps_assertk_assertk_jvm", | ||
| "@bazel_diff_maven//:io_insert_koin_koin_test_junit4", | ||
| "@bazel_diff_maven//:io_insert_koin_koin_test_jvm", | ||
| "@bazel_diff_maven//:junit_junit", | ||
| "@bazel_diff_maven//:org_mockito_kotlin_mockito_kotlin", | ||
| ], | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package com.bazel_diff | ||
|
|
||
| import com.bazel_diff.cli.BazelDiff | ||
| import picocli.CommandLine | ||
| import kotlin.system.exitProcess | ||
|
|
||
| class Main { | ||
| companion object { | ||
| @JvmStatic | ||
| fun main(args: Array<String>) { | ||
| val exitCode = CommandLine(BazelDiff()).execute(*args) | ||
| exitProcess(exitCode) | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to delete, I do not use these aliases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, will create another PR tomorrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#127