Skip to content
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

Kotlin DSL unresolved references on Windows #12532

Closed
fabianishere opened this issue Mar 16, 2020 · 3 comments
Closed

Kotlin DSL unresolved references on Windows #12532

fabianishere opened this issue Mar 16, 2020 · 3 comments
Labels

Comments

@fabianishere
Copy link

Hi, I have observed an issue with Gradle (6.2 and 6.2.2) where the compilation of Kotlin files in buildSrc fail with unresolved references on Windows due to CRLF line endings. When using LF line endings instead, the compilation is successful and the build succeeds.

The error I am getting:

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :buildSrc:extractPrecompiledScriptPluginPlugins
> Task :buildSrc:generateExternalPluginSpecBuilders
> Task :buildSrc:compilePluginsBlocks
> Task :buildSrc:generatePrecompiledScriptPluginAccessors
> Task :buildSrc:configurePrecompiledScriptDependenciesResolver
> Task :buildSrc:generateScriptPluginAdapters
e: D:\a\gradle-kotlin-dsl-bug\gradle-kotlin-dsl-bug\buildSrc\src\main\kotlin\project-convention.gradle.kts: (11, 7): Unresolved reference: test

> Task :buildSrc:compileKotlin FAILED
e: D:\a\gradle-kotlin-dsl-bug\gradle-kotlin-dsl-bug\buildSrc\src\main\kotlin\project-convention.gradle.kts: (12, 5): Unresolved reference: useJUnitPlatform
e: D:\a\gradle-kotlin-dsl-bug\gradle-kotlin-dsl-bug\buildSrc\src\main\kotlin\project-convention.gradle.kts: (13, 5): Unresolved reference: reports

Expected Behavior

buildSrc should build and the build should succeed.

Current Behavior

Kotlin compilation of buildSrc fails with unresolved references on Windows when using CRLF line endings.

Steps to Reproduce

See this repository to reproduce the error: https://github.com/fabianishere/gradle-kotlin-dsl-bug
I have also configured Github Actions to build the repository on Windows and Ubuntu, which shows the error on Windows: https://github.com/fabianishere/gradle-kotlin-dsl-bug/actions/runs/56738261

@fabianishere
Copy link
Author

I currently work around this issue by forcing the *.gradle.kts files in buildSrc/src to use LF line ending in .gitattributes:

# Gradle does not buils when this file uses CRLF
buildSrc/src/main/kotlin/project-convention.gradle.kts  text eol=lf

@bamboo
Copy link
Member

bamboo commented Mar 16, 2020

Hi @fabianishere,

The issue has been fixed in Gradle 6.3-rc-1.

@fabianishere
Copy link
Author

@bamboo Ah I was looking for it but could not find it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants