Skip to content

Commit 0b0b677

Browse files
authored
Merge pull request #107 from PatilShreyas/config-cache
Add support for configuration cache
2 parents e9f64c9 + d7b1e7d commit 0b0b677

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

cli/src/main/kotlin/dev/shreyaspatil/composeCompilerMetricsGenerator/cli/Main.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,5 +222,5 @@ fun printHeader(header: String) =
222222
)
223223

224224
object Constants {
225-
const val VERSION = "v1.2.0"
225+
const val VERSION = "v1.3.1"
226226
}

docs/use/using-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Run the command to know the usage of CLI
5656
!!! success "▶️Output"
5757

5858
```shell
59-
Usage: Compose Compiler Report to HTML Generator ~ v1.2.0 options_list
59+
Usage: Compose Compiler Report to HTML Generator ~ v1.3.1 options_list
6060
Options:
6161
--applicationName, -app -> Application name (To be displayed in the report) (always required) { String }
6262
--inputDirectory, -i -> Input directory where composable report and metrics are available { String }

docs/use/using-gradle-plugin.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ Apply the plugin to the module in which _**compose is enabled**_.
1919

2020
```groovy title="build.gradle"
2121
plugins {
22-
id "dev.shreyaspatil.compose-compiler-report-generator" version "1.2.0"
22+
id "dev.shreyaspatil.compose-compiler-report-generator" version "1.3.1"
2323
}
2424
```
2525

2626
=== "Kotlin"
2727

2828
```kotlin title="build.gradle.kts"
2929
plugins {
30-
id("dev.shreyaspatil.compose-compiler-report-generator") version "1.2.0"
30+
id("dev.shreyaspatil.compose-compiler-report-generator") version "1.3.1"
3131
}
3232
```
3333

@@ -45,7 +45,7 @@ Add this to top project level `build.gradle`
4545
}
4646
}
4747
dependencies {
48-
classpath "dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.2.0"
48+
classpath "dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.3.1"
4949
}
5050
}
5151
```
@@ -66,7 +66,7 @@ Add this to top project level `build.gradle`
6666
}
6767
}
6868
dependencies {
69-
classpath("dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.2.0")
69+
classpath("dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.3.1")
7070
}
7171
}
7272
```

gradle-plugin/src/main/kotlin/dev/shreyaspatil/composeCompilerMetricsGenerator/plugin/task/ComposeCompilerReportGenerateTask.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ import org.gradle.api.DefaultTask
3434
import org.gradle.api.Project
3535
import org.gradle.api.file.DirectoryProperty
3636
import org.gradle.api.provider.Property
37+
import org.gradle.api.tasks.CacheableTask
3738
import org.gradle.api.tasks.Input
39+
import org.gradle.api.tasks.InputDirectory
3840
import org.gradle.api.tasks.OutputDirectory
41+
import org.gradle.api.tasks.PathSensitive
42+
import org.gradle.api.tasks.PathSensitivity
3943
import org.gradle.api.tasks.TaskAction
4044
import org.gradle.api.tasks.TaskProvider
4145
import org.gradle.tooling.GradleConnector
@@ -44,7 +48,12 @@ import java.io.FileNotFoundException
4448

4549
const val KEY_ENABLE_REPORT_GEN = "dev.shreyaspatil.composeCompiler.reportGen.enable"
4650

51+
@CacheableTask
4752
abstract class ComposeCompilerReportGenerateTask : DefaultTask() {
53+
@get:InputDirectory
54+
@get:PathSensitive(PathSensitivity.RELATIVE)
55+
abstract val projectDirectory: DirectoryProperty
56+
4857
@get:Input
4958
abstract val compileKotlinTasks: Property<String>
5059

@@ -80,7 +89,7 @@ abstract class ComposeCompilerReportGenerateTask : DefaultTask() {
8089
}
8190

8291
private fun generateRawMetricsAndReport() {
83-
GradleConnector.newConnector().forProjectDirectory(project.layout.projectDirectory.asFile)
92+
GradleConnector.newConnector().forProjectDirectory(projectDirectory.get().asFile)
8493
.connect()
8594
.use {
8695
it.newBuild()
@@ -153,6 +162,7 @@ fun Project.registerComposeCompilerReportGenTaskForVariant(variant: Variant): Ta
153162
val reportExtension = ComposeCompilerReportExtension.get(project)
154163

155164
return tasks.register(taskName, ComposeCompilerReportGenerateTask::class.java) {
165+
projectDirectory.set(layout.projectDirectory)
156166
compileKotlinTasks.set(compileKotlinTaskName)
157167
reportName.set(reportExtension.name)
158168
composeRawMetricsOutputDirectory.set(reportExtension.composeRawMetricsOutputDirectory)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
kotlin.code.style=official
22

33
GROUP=dev.shreyaspatil.compose-compiler-report-generator
4-
VERSION_NAME=1.2.0
4+
VERSION_NAME=1.3.1
55

66
# Library configuration
77
SONATYPE_HOST=DEFAULT

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"main": "index.js",
88
"preferGlobal": true,
99
"repository": "https://github.com/PatilShreyas/compose-report-to-html",
10-
"version": "1.2.0",
10+
"version": "1.3.1",
1111
"jdeploy": {
1212
"jdk": false,
1313
"javaVersion": "11",

0 commit comments

Comments
 (0)