[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
- understand the Kotlin grammar and generate BUILD files with
srcs
and first-partydeps
- study https://github.com/bazel-contrib/rules_jvm/tree/main/java/gazelle#gazelle-java-extension and mimic their method for determining
deps
on third-party maven packages - Add test cases for various use cases
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.
The MVP for this is done, we can open more issues for more changes