How to call static method of a Kotlin class in gradle script?

#1

In my Android porject, I want to call static method on Kotlin class in a Gradle script. The class itself is part of a code base - it is enum class and I want to call MyEnumClass.values() on it in a gradle script.

How do I properly declare a dependency on the class, so I can call methods on it? Is it even possible?

Things I’ve tried:

    buildscript {
        dependencies {
            classpath("path-to-my-kotlin-class")
        }
    }

And this:

    buildscript {
        repositories {
            flatDir {
                dir("path-to-parent-dir-of-the-file")
            }
        }
        dependencies {
            file("MyEnumClass.kt")
        }
    }