| import org.gradle.api.tasks.TaskAction |
| 6 | import java.io.File |
| 7 |
| 8 | abstract class TestGeneratorTask : DefaultTask() { |
| 9 | /* |
| 10 | @get:InputDirectory |
| 11 | var rootDir: File = File("") |
| 12 |
| 13 | @get:InputDirectory |
| 14 | var resourcesDir: File = File("") |
| 15 | */ |
| 16 | @TaskAction |
| 17 | fun read() { |
| 18 | val jsonFile = project.file("src/main/resources/1.json") |
| 19 |
| 20 | if (!jsonFile.exists()) { |
| 21 | println("⚠️ File not found: ${jsonFile.absolutePath}") |
| 22 | return |
| 23 | } |
| 24 |
| 25 | val content = jsonFile.readText() |
| 26 | println("📄 Reading: ${jsonFile.absolutePath}") |
| 27 | println("📦 Content:\n$content") |
| 28 | } |
| 29 | } |