Skip to content

Instantly share code, notes, and snippets.

@azazellj
Created May 27, 2024 20:52
Show Gist options
  • Select an option

  • Save azazellj/d127d36226df2caf216413fa140addc3 to your computer and use it in GitHub Desktop.

Select an option

Save azazellj/d127d36226df2caf216413fa140addc3 to your computer and use it in GitHub Desktop.
internal abstract class AbstractGeneratorTask<T : GeneratedType> : DefaultTask() {
@get:InputFile
abstract val dsmFile: RegularFileProperty
@get:OutputDirectory
abstract val flavorDirectory: DirectoryProperty
@get:Input
abstract val `package`: Property<String>
abstract val componentClassName: ClassName
abstract val generatedFileName: String
abstract val rootDSMKey: String
@TaskAction
fun taskAction() { ... }
private fun searchTypeTokens(
jsonObject: JSONObject,
parentKey: String,
result: MutableMap<String, T>,
) { ... }
abstract fun isTypeToken(field: Any): Boolean
abstract fun convert(field: Any): T
abstract fun writeTypeToken(key: String, type: T): CodeBlock
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment