How to use class from another script

Is it possible to share class/enum with some static values from one Gradle script into another Gradle script?

For example would like to have one Gradle script with some commons methods, which are stored inside class of build script.
And I would like to use those methods by importing that script into another script.

I tried with:

buildscript {
  apply from: "commonScript.gradle"

Is there some other way, or this is not possible to do with script?
At the moment I’m trying to avoid to create plugin or use buildSrc, because current scripts are small. But will be nice to share some commons.

IMHO You shouldn’t be afraid to write a plug-in, even for small basic things.
That’s the cleanest thing to do.
I’m sure you will be tempted to share more things through it in the future. You’ll be glad to have it then.

Hi, I’m not afraid to write plugin :slight_smile:
At the moment we want to use it as a script. In near future I’m planing to convert those scripts to plugins.