1 import org.gradle.api.DefaultTask
2 import org.gradle.api.file.ConfigurableFileCollection
3 import org.gradle.api.file.DirectoryProperty
4 import org.gradle.api.file.RegularFileProperty
5 import org.gradle.api.tasks.Input
6 import org.gradle.api.tasks.InputFile
7 import org.gradle.api.tasks.InputFiles
8 import org.gradle.api.tasks.OutputDirectory
9 import org.gradle.api.tasks.TaskAction
10 import java.io.File
11 
12 abstract class StatsGeneratorTask : DefaultTask() {
13 
14     @get:InputFile
15     abstract val atomsFile: RegularFileProperty
16 
17     @get:InputFiles
18     abstract val atomsExtensions: ConfigurableFileCollection
19 
20     @get:OutputDirectory
21     abstract val outputFolder: DirectoryProperty
22 
23     @get:Input
24     abstract var javaFileName: String
25 
26     @get:Input
27     abstract var androidTop: String
28 
29     @get:Input
30     abstract var module: String
31 
32     @get:Input
33     abstract var packageName: String
34 
35     @TaskAction
taskActionnull36     fun taskAction() {
37         val generator = StatsGenerator(File(androidTop))
38         generator.process(atomsFile.get().asFile, atomsExtensions.files,
39                 module, packageName, File(outputFolder.get().asFile, javaFileName))
40     }
41 }
42