gradle / kotlin-dsl-samples

Samples builds using the Gradle Kotlin DSL
https://gradle.org/kotlin/
Other
3.71k stars 434 forks source link

The `gradle-kotlin-dsl-extensions.jar` should be reproducible #1286

Closed eskatos closed 5 years ago

eskatos commented 5 years ago

Expected Behavior

The gradle-kotlin-dsl-extensions.jar is reproducible to allow for downstream compilation tasks (when the kotlin-dsl plugin is applied) and script compilation outputs to be reused and relocatable.

Current Behavior

Observed between a Windows and a macos builds.

https://e.grdev.net/c/sprbsii6bnmjs/n5scix7scxwvy/task-inputs?toggledFileChanges=WyJ0eHFoZjNrY2FmdWFrLWZpbGUtaW5wdXQtMCIsImFzdzI1N2VtbXNtcXUtZmlsZS1pbnB1dC0wIl0#change-asw257emmsmqu-0-0

wolfs commented 5 years ago

Those are not two linux agents, this is a Windows machine and my macbook: https://e.grdev.net/c/sprbsii6bnmjs/n5scix7scxwvy/infrastructure#operating-system

eskatos commented 5 years ago

@wolfs thanks, updated the issue

wolfs commented 5 years ago

Here is another instance of this problem from our CI agents, one on Windows and one one Linux: https://e.grdev.net/c/y66cprpcpn35u/2mohev2rc3yv2/task-inputs?toggled=WzJd&toggledFileChanges=WyI2ajZlNGlhdDV3Z3JlLWZpbGUtaW5wdXQtMCJd#change-6j6e4iat5wgre-0-0

wolfs commented 5 years ago

I had a look at the jars, and it looks like line endings are the culprit. I guess we shouldn't use appendln here: https://github.com/gradle/kotlin-dsl/blob/9d4f2465571b3b8c30a3009951a85824018ca36f/subprojects/provider/src/main/kotlin/org/gradle/kotlin/dsl/codegen/ApiExtensionsGenerator.kt#L269-L293

wolfs commented 5 years ago

I guess we should get rid of all usages of appendln in the generator source code.

eskatos commented 5 years ago

Closing as done in #1288