Skip to content

Kotlin DSL support #157

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

Merged
merged 31 commits into from
Sep 5, 2019
Merged

Kotlin DSL support #157

merged 31 commits into from
Sep 5, 2019

Conversation

fwcd
Copy link
Owner

@fwcd fwcd commented Sep 3, 2019

Fixes #6.

This PR will contain experimental support for Gradle's Kotlin DSL buildscripts (build.gradle.kts). Currently, the classpath is resolved correctly, the script, however, still shows error messages as the top-level context is not recognized as a KotlinBuildScript:

grafik

See here for details about the template classes.

@fwcd fwcd added the enhancement New feature or request label Sep 3, 2019
@fwcd fwcd changed the title Kotlin DSL support WIP: Kotlin DSL support Sep 3, 2019
fwcd added 15 commits September 3, 2019 18:20
Include Gradle API, Kotlin DSL jar and generated extensions.
Also omit the base classloader when loading the Kotlin script template
classes at runtime.
Print dynamically generated Kotlin DSL accessors (e.g. the 'compile'
configuration method) when resolving the classpath of Kotlin DSL
projects. Also move the Kotlin DSL classpath resolution logic into a
separate script.
Use a separate class path for build scripts at the compiler level.
Automatically update the classpath if a Gradle buildfile changes and
query the build script classpath in CompilerClassPath.
@fwcd
Copy link
Owner Author

fwcd commented Sep 4, 2019

Kotlin DSL support now works (experimentally) with a single caveat: The DSL has to be imported explicitly.

grafik

@fwcd
Copy link
Owner Author

fwcd commented Sep 5, 2019

Implicit imports now work, thus the PR is ready for merge. #76 should be fixed too.

@fwcd fwcd changed the title WIP: Kotlin DSL support Kotlin DSL support Sep 5, 2019
fwcd added 2 commits September 5, 2019 04:37
Verify that hovers and code completion work correctly in *.gradle.kts
build files.
@fwcd fwcd merged commit 3dd14ba into master Sep 5, 2019
@fwcd fwcd deleted the kotlin-dsl branch September 5, 2019 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support code completion and valid diagnostics in Kotlin DSL buildscripts
1 participant