Piotr Krzemiński
04/04/2024, 7:31 AMPiotr Krzemiński
04/04/2024, 7:31 AMcom.lemonappdev.konsist.core.exception.KoInternalException: Failed to parse Kotlin file: /Users/piotr/repos/github-workflows-kt/buildSrc/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_76a779107637b25b34866585d88a55c4/Accessorsdfahp28yse49o5zwao0rw07vs.kt
at app//com.lemonappdev.konsist.core.util.KotlinFileParser.getKtFile(KotlinFileParser.kt:49)
at app//com.lemonappdev.konsist.core.util.KotlinFileParser.getKoFile(KotlinFileParser.kt:54)
at app//com.lemonappdev.konsist.core.ext.FileExtKt.toKoFile(FileExt.kt:12)
at app//com.lemonappdev.konsist.core.provider.util.KoFileDeclarationProvider$parseKotlinFile$2$1.invokeSuspend(KoFileDeclarationProvider.kt:80)
at app//kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at app//kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at app//kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
at app//kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at app//kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
at app//kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
at app//kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
at app//kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
Suppressed: com.lemonappdev.konsist.core.exception.KoInternalException: Failed to parse Kotlin file: /Users/piotr/repos/github-workflows-kt/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/ClassNaming.kt
... 12 more
Caused by: java.lang.ClassCastException: class org.jetbrains.kotlin.idea.KotlinFileType cannot be cast to class org.jetbrains.kotlin.com.intellij.openapi.fileTypes.FileType (org.jetbrains.kotlin.idea.KotlinFileType and org.jetbrains.kotlin.com.intellij.openapi.fileTypes.FileType are in unnamed module of loader 'app')
at com.lemonappdev.konsist.core.util.KotlinFileParser.getKtFile(KotlinFileParser.kt:45)
... 11 more
Suppressed: com.lemonappdev.konsist.core.exception.KoInternalException: Failed to parse Kotlin file: /Users/piotr/repos/github-workflows-kt/buildSrc/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_76a779107637b25b34866585d88a55c4/Accessorsb13nju9doius8kxwhlptqirtr.kt
... 12 more
it goes on, but some of the parts are repeatedPiotr Krzemiński
04/04/2024, 7:33 AMigor.wojda
04/16/2024, 9:56 PMPiotr Krzemiński
04/17/2024, 5:35 AMSuppressed: com.lemonappdev.konsist.core.exception.KoInternalException: Failed to parse Kotlin file: /Users/piotr/repos/github-workflows-kt/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/ClassNaming.kt
, it's this file: https://github.com/typesafegithub/github-workflows-kt/blob/main/action-binding-gen[…]thub/workflows/actionbindinggenerator/generation/ClassNaming.ktPiotr Krzemiński
04/17/2024, 5:59 AMmain
), and this time (see the Gradle build scan) the problematic files are:
• lots of failures on Gradle-generated Kotlin DSL accessors, like: Failed to parse Kotlin file: /home/runner/work/github-workflows-kt/github-workflows-kt/buildSrc/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_76a779107637b25b34866585d88a55c4/Accessors46nwrg1rs44ofdqpi7vyy3pfc.kt
• issues with the code actually in the repo:
◦ Failed to parse Kotlin file: /home/runner/work/github-workflows-kt/github-workflows-kt/maven-binding-builder/src/main/kotlin/io/github/typesafegithub/workflows/mavenbinding/JarBuilding.kt
◦ Failed to parse Kotlin file: /home/runner/work/github-workflows-kt/github-workflows-kt/automation/code-generator/src/main/kotlin/io/github/typesafegithub/workflows/dsl/expressions/GenerateEventPayloads.kt
◦ Failed to parse Kotlin file: /home/runner/work/github-workflows-kt/github-workflows-kt/automation/code-generator/src/test/kotlin/io/github/typesafegithub/workflows/codegenerator/AddDeprecationInfoTest.kt
◦ Failed to parse Kotlin file: /home/runner/work/github-workflows-kt/github-workflows-kt/maven-binding-builder/src/main/kotlin/io/github/typesafegithub/workflows/mavenbinding/VersionArtifactsBuilding.kt
◦ there's morePiotr Krzemiński
04/17/2024, 6:00 AMCaused by: java.lang.ClassCastException: class org.jetbrains.kotlin.idea.KotlinFileType cannot be cast to class <http://org.jetbrains.kotlin.com|org.jetbrains.kotlin.com>.intellij.openapi.fileTypes.FileType (org.jetbrains.kotlin.idea.KotlinFileType and <http://org.jetbrains.kotlin.com|org.jetbrains.kotlin.com>.intellij.openapi.fileTypes.FileType are in unnamed module of loader 'app')
Piotr Krzemiński
04/17/2024, 6:01 AMPiotr Krzemiński
04/17/2024, 6:17 AM/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <http://www.apache.org/licenses/LICENSE-2.0>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress(
"unused",
"nothing_to_inline",
"useless_cast",
"unchecked_cast",
"extension_shadowed_by_member",
"redundant_projection",
"RemoveRedundantBackticks",
"ObjectPropertyName",
"deprecation"
)
@file:org.gradle.api.Generated
/* ktlint-disable */
package gradle.kotlin.dsl.accessors._76a779107637b25b34866585d88a55c4
import org.gradle.api.Action
import org.gradle.api.Incubating
import org.gradle.api.NamedDomainObjectProvider
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ConfigurablePublishArtifact
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.DependencyConstraint
import org.gradle.api.artifacts.ExternalModuleDependency
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.PublishArtifact
import org.gradle.api.artifacts.dsl.ArtifactHandler
import org.gradle.api.artifacts.dsl.DependencyConstraintHandler
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.api.provider.Provider
import org.gradle.api.provider.ProviderConvertible
import org.gradle.api.tasks.TaskContainer
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.*
import org.gradle.kotlin.dsl.accessors.runtime.*
/**
* Retrieves the [ext][org.gradle.api.plugins.ExtraPropertiesExtension] extension.
*/
internal
val org.gradle.api.artifacts.VersionCatalogsExtension.`ext`: org.gradle.api.plugins.ExtraPropertiesExtension get() =
(this as org.gradle.api.plugins.ExtensionAware).extensions.getByName("ext") as org.gradle.api.plugins.ExtraPropertiesExtension
/**
* Configures the [ext][org.gradle.api.plugins.ExtraPropertiesExtension] extension.
*/
internal
fun org.gradle.api.artifacts.VersionCatalogsExtension.`ext`(configure: Action<org.gradle.api.plugins.ExtraPropertiesExtension>): Unit =
(this as org.gradle.api.plugins.ExtensionAware).extensions.configure("ext", configure)
Piotr Krzemiński
04/17/2024, 6:24 AMPiotr Krzemiński
04/17/2024, 6:30 AMPiotr Krzemiński
04/17/2024, 6:36 AMLightVirtualFile
https://github.com/JetBrains/intellij-community/blob/ca977bb49429f31956cb37a3844fb[…]m/core-api/src/com/intellij/testFramework/LightVirtualFile.java, but I think it has been bundled with the Kotlin compiler in a way that the Java package is changed. This version of the file doesn't contain any overload of the constructor that accepts KotlinFileType
(what Konsist is trying to use)Piotr Krzemiński
04/17/2024, 6:38 AMKotlinFileType
inherits from LanguageFileType
inherit from FileType
Piotr Krzemiński
04/17/2024, 6:40 AMigor.wojda
04/25/2024, 2:58 PMPiotr Krzemiński
04/25/2024, 2:59 PM