

For defining the repository, I need to fetch a few parameters from $HOME/.gradle/gradle.properties. Why is that? Do I need to resort to use the “allprojects” block?Īnother related question. However, the buildSrc still wants to see the repositories defined in its own build script. So I read Declaring repositories about defining it in. How can I make it Two more questions, maybe you can help.įirst, since I use internal company nexus for repository, with authentication, etc., I want to define it in one place. It doesn’t like the “plugins” block there the “apply” statements could not find the plugin anywhere. I tried to put the “apply” inside the buildscript block, could not make it work. So the problem is, the plugin is not applied to the buildscript itself. Make sure that you’ve setup your buildscript correctly and re-import project. rialization compiler plugin is not applied to the module, so this annotation would not be processed. Mark the class as or provide the serializer explicitly.īut I do use When I hover the mouse over it, I see this: Serializer for class ‘Configuration’ is not found. The “decodeFromConfig” fails with the following error: Val envConf = codeFromConfig(typesafeConf) Val typesafeConf = .parseFile(File(“src/env.conf”)) Then I try to extract configuration like this: Then I defined my data classes and I use “ annotation on them.

I also added the dependency in “buildscript” block:Ĭlasspath(group = “com.typesafe”, name = “config”, version = “1.4.1”)Ĭlasspath(group = “”, name = “kotlinx-serialization-hocon”, version = “1.3.0”) Kotlin(“rialization”) version kotlinVersion So I added the plugin to the “plugins” block: I want to use kotlin serialization in the build script itself ().
