aspect-build/aspect-cli

[FR]: 'configure' command generates Kotlin rules

Closed this issue · 5 comments

What is the current behavior?

Users have to write BUILD files by hand containing kt_jvm_library and other Kotlin rules

Describe the feature

Thanks for starting this!

Note that I get parse errors for relatively basic Kotlin files when using aspect configure:

xxx/ch/nexiot/gh/commander/api/commands/FirmwareVersion.kt parse error(s):
     8: 	val versionString get() = "$major.$minor.$patch"

Context:

package ch.nexiot.gh.commander.api.commands

class FirmwareVersion(
        val major: Int,
        val minor: Int,
        val patch: Int,
) {
        val versionString get() = "$major.$minor.$patch"
}

.bazeliskrc

BAZELISK_BASE_URL=https://github.com/aspect-build/aspect-cli/releases/download
USE_BAZEL_VERSION=aspect/5.5.4

.bazelversion 6.3.0

.aspect/cli/config.yaml

configure:
  languages:
    javascript: false
    go: false
    kotlin: true
    protobuf: true

@kolloch despite that scary "parse error", we've seen that the BUILD files are actually updated in the desired way. Did aspect configure make BUILD file edits in your case?

Did aspect configure make BUILD file edits in your case?

Possible, I don't remember. I should try again.

I think you do not resolve dependencies yet?

My dabbling with this was mostly whether it makes sense to integrate my work with that. I solid parser does not make a big difference, since it will still not allow this solution to be perfect in detecting dependencies. But for now, it doesn't seem solid. Maybe that's easy to change! That would be awesome.

For now, it would be easier for me to continue with a solution that I understand.

FYI @kolloch #501 has the feature adding maven support, basically just supporting the existing rules_jvm gazelle maven config within kotlin. Once that PR is merged let me know if you get a chance to check it out.

The MVP for this is done, we can open more issues for more changes