compiler-plugin / arrow.meta.quotes / Transform / NewSource

NewSource

data class NewSource<K : KtElement> : Transform<K>

A Transform that allows code generation. See below:

import arrow.meta.Meta
import arrow.meta.CliPlugin
import arrow.meta.invoke
import arrow.meta.quotes.Transform
import arrow.meta.quotes.classDeclaration

val Meta.transformNewSource: CliPlugin
 get() = "Transform New Source" {
  meta(
   classDeclaration(this, { name == "NewSource" }) {
    Transform.newSources(
     """
     package arrow
     //metadebug
     class ${name}_Generated {
      fun sayHi() = println("Hi!")
     }
     """.file("${name}_Generated")
    )
   }
  )
 }

Parameters

files - list of files to be generated

Constructors

<init> A Transform that allows code generation. See below:NewSource(files: List<File>)

Properties

files list of files to be generatedval files: List<File>

Do you like Arrow?

Arrow Org
<