Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PatilShreyas/compose-report-to-html
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0-beta02
Choose a base ref
...
head repository: PatilShreyas/compose-report-to-html
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.0-beta03
Choose a head ref
  • 6 commits
  • 11 files changed
  • 2 contributors

Commits on Feb 12, 2023

  1. [ImgBot] Optimize images

    *Total -- 509.61kb -> 295.01kb (42.11%)
    
    /docs/images/detailed-stats.png -- 223.09kb -> 109.70kb (50.83%)
    /docs/images/gradle-plugin-example.png -- 18.95kb -> 10.56kb (44.26%)
    /docs/images/composable-report.png -- 106.15kb -> 66.89kb (36.99%)
    /docs/images/class-report.png -- 89.35kb -> 57.50kb (35.65%)
    /docs/images/brief-stats.png -- 72.07kb -> 50.37kb (30.11%)
    
    Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
    ImgBotApp committed Feb 12, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    ImgBotApp Imgbot
    Copy the full SHA
    756cdd7 View commit details

Commits on Feb 14, 2023

  1. Merge pull request #23 from PatilShreyas/imgbot

    [ImgBot] Optimize images
    PatilShreyas authored Feb 14, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d2ae2d8 View commit details

Commits on Feb 15, 2023

  1. #30 Configure kotlinOptions{} after project evaluation to respect pro…

    …vided outputPath for report
    PatilShreyas committed Feb 15, 2023
    Copy the full SHA
    3fc4cef View commit details
  2. Copy the full SHA
    52f5f16 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ad67107 View commit details
  4. Merge pull request #31 from PatilShreyas/v1.0.0-beta03

    Release v1.0.0 beta03
    PatilShreyas authored Feb 15, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    574e411 View commit details
Original file line number Diff line number Diff line change
@@ -185,5 +185,5 @@ fun printHeader(header: String) = println(
)

object Constants {
const val VERSION = "v1.0.0-beta02"
const val VERSION = "v1.0.0-beta03"
}
Binary file modified docs/images/brief-stats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/class-report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/composable-report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/detailed-stats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/gradle-plugin-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/use/using-cli.md
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ Run the command to know the usage of CLI
!!! success "▶️Output"

```shell
Usage: Compose Compiler Report to HTML Generator ~ v1.0.0-beta02 options_list
Usage: Compose Compiler Report to HTML Generator ~ v1.0.0-beta03 options_list
Options:
--applicationName, -app -> Application name (To be displayed in the report) (always required) { String }
--inputDirectory, -i -> Input directory where composable report and metrics are available { String }
8 changes: 4 additions & 4 deletions docs/use/using-gradle-plugin.md
Original file line number Diff line number Diff line change
@@ -19,15 +19,15 @@ Apply the plugin to the module in which _**compose is enabled**_.

```groovy title="build.gradle"
plugins {
id "dev.shreyaspatil.compose-compiler-report-generator" version "1.0.0-beta02"
id "dev.shreyaspatil.compose-compiler-report-generator" version "1.0.0-beta03"
}
```

=== "Kotlin"

```kotlin title="build.gradle.kts"
plugins {
id("dev.shreyaspatil.compose-compiler-report-generator") version "1.0.0-beta02"
id("dev.shreyaspatil.compose-compiler-report-generator") version "1.0.0-beta03"
}
```

@@ -45,7 +45,7 @@ Add this to top project level `build.gradle`
}
}
dependencies {
classpath "dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.0.0-beta02"
classpath "dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.0.0-beta03"
}
}
```
@@ -66,7 +66,7 @@ Add this to top project level `build.gradle`
}
}
dependencies {
classpath("dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.0.0-beta02")
classpath("dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.0.0-beta03")
}
}
```
Original file line number Diff line number Diff line change
@@ -27,9 +27,11 @@ import com.android.build.api.dsl.CommonExtension
import com.android.build.api.variant.AndroidComponentsExtension
import dev.shreyaspatil.composeCompilerMetricsGenerator.plugin.task.createComposeCompilerReportGenTaskForVariant
import dev.shreyaspatil.composeCompilerMetricsGenerator.plugin.task.executingComposeCompilerReportGenerationGradleTask
import dev.shreyaspatil.composeCompilerMetricsGenerator.plugin.utils.kotlinOptions
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions

@Suppress("UnstableApiUsage")
class ReportGenPlugin : Plugin<Project> {
@@ -53,33 +55,38 @@ class ReportGenPlugin : Plugin<Project> {
if (isComposeEnabled != true) {
error("Jetpack Compose is not found enabled in this module '$name'")
}
}

// When this method returns true it means gradle task for generating report is executing otherwise
// normal compilation task is executing.
val isFromReportGenGradleTask = target.executingComposeCompilerReportGenerationGradleTask()
if (isFromReportGenGradleTask) {
commonExtension?.configureKotlinOptionsForComposeCompilerReport(reportExt)
// When this method returns true it means gradle task for generating report is executing otherwise
// normal compilation task is executing.
val isFromReportGenGradleTask = target.executingComposeCompilerReportGenerationGradleTask()
if (isFromReportGenGradleTask) {
val kotlinAndroidExt = extensions.getByType<KotlinAndroidProjectExtension>()
kotlinAndroidExt.target {
// Exclude for test variants, no use!
compilations.filter { !it.name.endsWith("Test") }.forEach {
it.kotlinOptions {
configureKotlinOptionsForComposeCompilerReport(this@afterEvaluate)
}
}
}
}
}
}

private fun CommonExtension<*, *, *, *>.configureKotlinOptionsForComposeCompilerReport(
reportExtension: ComposeCompilerReportExtension,
) {
kotlinOptions {
val outputPath = reportExtension.composeRawMetricsOutputDirectory.absolutePath
if (reportExtension.enableReport.get()) {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=$outputPath"
)
}
if (reportExtension.enableMetrics.get()) {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=$outputPath"
)
}
private fun KotlinJvmOptions.configureKotlinOptionsForComposeCompilerReport(project: Project) {
val reportExtension = project.extensions.getByType<ComposeCompilerReportExtension>()
val outputPath = reportExtension.composeRawMetricsOutputDirectory.absolutePath
if (reportExtension.enableReport.get()) {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=$outputPath"
)
}
if (reportExtension.enableMetrics.get()) {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=$outputPath"
)
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kotlin.code.style=official

GROUP=dev.shreyaspatil.compose-compiler-report-generator
VERSION_NAME=1.0.0-beta02
VERSION_NAME=1.0.0-beta03

# Library configuration
SONATYPE_HOST=DEFAULT
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"main": "index.js",
"preferGlobal": true,
"repository": "https://github.com/PatilShreyas/compose-report-to-html",
"version": "1.0.0-beta02",
"version": "1.0.0-beta03",
"jdeploy": {
"jdk": false,
"javaVersion": "11",