Defining a class within a app definition

I am unable to save an app file with a custom class definition in it, with the error

Importing [AWSSRP] is not allowed Expression [MethodCallExpression] is not allowed: org.codehaus.groovy.runtime.InvokerHelper.runScript(Script1, args) at line number -1

class AWSSRP {

def version() {"1.0.0"}
def appVersion() { return version() }
def appName() { return "Schlage Wifi Locks Support" }

    name: "${appName()}",
    namespace: "schwark",
    author: "Schwark Satyavolu",
    description: "This adds support for Schlage Wifi Locks",
    category: "Convenience",
    iconUrl: "",
    iconX2Url: "",
    singleInstance: true,
    importUrl: ""

Can I not put functionality into a class defined in this file? Is there another way to do this?

For anyone else looking for the answer to this question - you cannot. You have to unroll your class into the app or driver..

Correct. I would suggest reading the Developer Overview if you have not already, specifically the "Development Environment" section, which notes this issue (among others you may need to know if you are not used to the sandbox).