Rohan Maity
09/18/2024, 9:05 AMbuildSrc/build.gradle.kts dependencies
And this is how I created the convention plugin class
import dev.shreyaspatil.composeCompilerMetricsGenerator.plugin.ComposeCompilerReportExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
class ComposeCompilerReportConventionPlugin: Plugin<Project> {
override fun apply(target: Project) {
target.apply {
plugin("dev.shreyaspatil.compose-compiler-report-generator")
}
}
fun Project.configureComposeCompilerReport(
reportName: String,
includeStableInfo: Boolean = false,
includeAllClassesInfo: Boolean = false,
includeOnlyUnstableInfo: Boolean = true,
) {
extensions.configure<ComposeCompilerReportExtension> {
enableMetrics.set(true)
enableReport.set(true)
name.set(reportName)
includeStableComposables.set(includeStableInfo)
includeStableClasses.set(includeStableInfo)
includeClasses.set(includeAllClassesInfo)
showOnlyUnstableComposables.set(includeOnlyUnstableInfo)
}
}
}
But when I try to sync I get the error
An exception occurred applying plugin request [id: 'com.motive.composecompilerreport']
> Failed to apply plugin 'com.motive.composecompilerreport'.
> Plugin with id 'dev.shreyaspatil.compose-compiler-report-generator' not found.
FYI, I have also regiseterd the plugin as well
gradlePlugin {
plugins {
register("composeCompilerReport") {
id = "com.example.composecompilerreport"
implementationClass = "ComposeCompilerReportConventionPlugin"
}
}
}Martin
09/18/2024, 9:55 AMFYI, I have also regiseterd the plugin as wellThat part seemed to have worked well since it's trying to apply
dev.shreyaspatil.compose-compiler-report-generatorMartin
09/18/2024, 9:55 AMRohan Maity
09/18/2024, 9:56 AMMartin
09/18/2024, 9:56 AMpluginManager.apply(ShreyaspatilPlugin::class.java)Martin
09/18/2024, 9:56 AMRohan Maity
09/18/2024, 9:57 AMJohnBuhanan
09/18/2024, 4:11 PMpluginManager.apply<ShreyaspatilPlugin>()
or maybe just
apply<ShreyaspatilPlugin>()