Skip to content

Commit 2aeaa5b

Browse files
authored
Merge pull request #44 from PatilShreyas/v1.0.1
Fix issue due to Moshi dependency in Gradle Plugin
2 parents 2481a95 + 3a184f2 commit 2aeaa5b

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
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
@@ -185,5 +185,5 @@ fun printHeader(header: String) = println(
185185
)
186186

187187
object Constants {
188-
const val VERSION = "v1.0.0"
188+
const val VERSION = "v1.0.1"
189189
}

core/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
kotlin("jvm")
3+
kotlin("plugin.serialization") version libs.versions.kotlin.get()
34
id(libs.plugins.mavenPublish.get().pluginId)
45
}
56

@@ -9,5 +10,5 @@ repositories {
910

1011
dependencies {
1112
implementation(kotlin("stdlib"))
12-
implementation(libs.moshi)
13+
implementation(libs.kotlinx.serialization.json)
1314
}

core/src/main/kotlin/dev/shreyaspatil/composeCompilerMetricsGenerator/core/ComposeCompilerMetricsProvider.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
*/
2424
package dev.shreyaspatil.composeCompilerMetricsGenerator.core
2525

26-
import com.squareup.moshi.Moshi
27-
import com.squareup.moshi.adapter
2826
import dev.shreyaspatil.composeCompilerMetricsGenerator.core.model.DetailedStatistics
2927
import dev.shreyaspatil.composeCompilerMetricsGenerator.core.model.Item
3028
import dev.shreyaspatil.composeCompilerMetricsGenerator.core.model.RowItems
3129
import dev.shreyaspatil.composeCompilerMetricsGenerator.core.model.classes.ClassesReport
3230
import dev.shreyaspatil.composeCompilerMetricsGenerator.core.model.composables.ComposablesReport
3331
import dev.shreyaspatil.composeCompilerMetricsGenerator.core.parser.ClassReportParser
3432
import dev.shreyaspatil.composeCompilerMetricsGenerator.core.parser.ComposableReportParser
33+
import kotlinx.serialization.decodeFromString
34+
import kotlinx.serialization.json.Json
3535

3636
/**
3737
* Provides metrics and reports of a Compose compiler
@@ -66,12 +66,11 @@ interface ComposeCompilerMetricsProvider {
6666
private class DefaultComposeCompilerMetricsProvider(
6767
private val contentProvider: ComposeMetricsContentProvider
6868
) : ComposeCompilerMetricsProvider {
69-
private val moshi = Moshi.Builder().build()
7069

7170
override fun getOverallStatistics(): Map<String, Long> {
7271
val statistics = mutableMapOf<String, Long>()
7372
contentProvider.briefStatisticsContents.forEach { statContent ->
74-
val stats = moshi.adapter<Map<String, Long>>().fromJson(statContent) ?: emptyMap()
73+
val stats = Json.decodeFromString<Map<String, Long>>(statContent)
7574
if (statistics.isEmpty()) {
7675
statistics.putAll(stats)
7776
} else {

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.0.0 options_list
59+
Usage: Compose Compiler Report to HTML Generator ~ v1.0.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.0.0"
22+
id "dev.shreyaspatil.compose-compiler-report-generator" version "1.0.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.0.0"
30+
id("dev.shreyaspatil.compose-compiler-report-generator") version "1.0.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.0.0"
48+
classpath "dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.0.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.0.0")
69+
classpath("dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.0.1")
7070
}
7171
}
7272
```

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.0.0
4+
VERSION_NAME=1.0.1
55

66
# Library configuration
77
SONATYPE_HOST=DEFAULT

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[versions]
22
kotlin = "1.8.0"
3+
serialization = "1.5.0"
34
coroutines = "1.6.4"
4-
moshi = "1.14.0"
55
spotless = "6.3.0"
66
kotlinxHtml = "0.7.5"
77
kotlinxCli = "0.3.5"
@@ -10,7 +10,7 @@ androidGradlePlugin = "7.3.1"
1010
gradlePluginPublish = "1.1.0"
1111

1212
[libraries]
13-
moshi = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" }
13+
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
1414
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
1515
kotlinx-html-jvm = { module = "org.jetbrains.kotlinx:kotlinx-html-jvm", version.ref = "kotlinxHtml" }
1616
kotlinx-cli = { module = "org.jetbrains.kotlinx:kotlinx-cli", version.ref = "kotlinxCli" }

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.0.0",
10+
"version": "1.0.1",
1111
"jdeploy": {
1212
"jdk": false,
1313
"javaVersion": "11",

0 commit comments

Comments
 (0)