ldenisey / gradle-setversions-plugin

MIT License
0 stars 1 forks source link

setVersion failed if no build.gradle #85

Open c3p0-maif opened 2 months ago

c3p0-maif commented 2 months ago

I have just generated a fresh gradle app (gradle 8.2.1) which don't contains build.gradle file.

Details

Select type of project to generate: 1: basic 2: application 3: library 4: Gradle plugin Enter selection (default: basic) [1..4] 2 Select implementation language: 1: C++ 2: Groovy 3: Java 4: Kotlin 5: Scala 6: Swift Enter selection (default: Java) [1..6] 4 Generate multiple subprojects for application? (default: no) [yes, no] Select build script DSL: 1: Kotlin 2: Groovy Enter selection (default: Kotlin) [1..2] 1

The task failed with stacktrace :

Caused by: java.io.FileNotFoundException: /workspaces/gradle-hello-world/build.gradle (Aucun fichier ou dossier de ce nom)
        at kotlin.io.FilesKt__FileReadWriteKt.readText(FileReadWrite.kt:125)
        at kotlin.io.FilesKt__FileReadWriteKt.readText$default(FileReadWrite.kt:125)
        at org.gradle.internal.classpath.Instrumented.kotlinIoFilesKtReadTextDefault(Instrumented.java:412)
        at org.gradle.internal.classpath.declarations.KotlinFileExtensionsInterceptorsDeclaration.intercept_readText(KotlinFileExtensionsInterceptorsDeclaration.java:45)
        at com.github.ldenisey.setversions.parser.BuildFileParser.<init>(BuildFileParser.kt:9)
        at com.github.ldenisey.setversions.parser.GroovyBuildFileParser.<init>(GroovyBuildFileParser.kt:14)
        at com.github.ldenisey.setversions.task.SetVersions.updateFromBuildFile(SetVersions.kt:63)
        at com.github.ldenisey.setversions.task.SetVersions.run(SetVersions.kt:29)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
ldenisey commented 1 month ago

Thank you for your report and your PR. I have tried to reproduce but can not reproduce this error, can you detail a bit the test project structure and command line ?