okbuck icon indicating copy to clipboard operation
okbuck copied to clipboard

Can't set JVM-target in okbuck which need to run on jvm 1.8.

Open FightJames opened this issue 5 years ago • 1 comments

At buck documentation. Need to set jvm-target at BUCK file. But can't modify BUCK file when using okbuck. okbuck version : 0.51.2 https://buck.build/rule/kotlin_library.html image

Here is error message.

error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option

BUCK file generated by okbuck.

okbuck_kotlin_android_module(
    name = "src_debug",
    srcs = glob([
        "src/main/java/**/*.java",
        "src/main/java/**/*.kt",
    ]),
    source = "8",
    target = "8",
    provided_deps = [
        "//.okbuck/workspace/d8:rt-stub.jar",
    ],
    extra_kotlinc_arguments = [
        "-P",
        ".......",
        "-jvm-target",
        "1.6",
        "-no-reflect",
        "-no-stdlib",
    ],
    kotlinc_plugins = [
        "//.okbuck/workspace/kotlin_home:android-extensions-compiler.jar",
    ],
....

I had tried extraBuckOpts and dived to okbuck source code. There is no kotlin_library rule for it.

FightJames avatar Nov 04 '20 06:11 FightJames

I have the same problem。

ronnie-o-sullivan avatar Dec 09 '21 07:12 ronnie-o-sullivan