Skip to content

Commit 1b13fbd

Browse files
authored
Merge pull request #17 from PatilShreyas/maven-publish
Setup artifact publishing on maven
2 parents 6de8965 + 449c1d8 commit 1b13fbd

File tree

11 files changed

+103
-35
lines changed

11 files changed

+103
-35
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,40 @@ jobs:
2626
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
2727
restore-keys: |
2828
${{ runner.os }}-gradle-
29-
30-
- name: Grant Permission to Execute
31-
run: chmod +x gradlew
3229
33-
- name: 🏗 Build with Gradle 🛠️
34-
run: ./gradlew build --stacktrace
35-
3630
- name: Set up NPM
3731
uses: actions/setup-node@v3
3832
with:
3933
node-version: 14
4034
registry-url: 'https://registry.npmjs.org'
35+
36+
- name: Grant Permission to Execute
37+
run: chmod +x gradlew
38+
39+
- name: 🏗 Build with Gradle 🛠️
40+
run: ./gradlew build --stacktrace
41+
42+
- name: Publish Library on Maven Central
43+
run: |
44+
echo "Publishing Core🚀"
45+
./gradlew :core:publish
46+
echo "Published Core✅"
47+
echo "Releasing Core...🚀"
48+
./gradlew closeAndReleaseRepository
49+
echo "Released Core✅"
4150
51+
echo "Publishing Report Generator🚀"
52+
./gradlew :reportGenerator:publish
53+
echo "Published Report Generator✅"
54+
echo "Releasing Report Generator...🚀"
55+
./gradlew closeAndReleaseRepository
56+
echo "Released Report Generator✅"
57+
env:
58+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
59+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSWORD }}
60+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
61+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
62+
4263
- name: Publish CLI Application 🚀
4364
run: |
4465
npm ci

README.md

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Compose Compiler Reports to HTML Generator
22

3-
A CLI utility to convert Jetpack Compose compiler metrics and reports to beautified 😍 HTML page.
3+
A CLI utility to convert Jetpack Compose compiler metrics and reports to beautified 😍 HTML page.
44
_Made with ❤️ for Android Developers and Composers_
55

66
[![Build](https://github.com/PatilShreyas/compose-report-to-html/actions/workflows/build.yml/badge.svg)](https://github.com/PatilShreyas/compose-report-to-html/actions/workflows/build.yml)
@@ -12,23 +12,26 @@ _Made with ❤️ for Android Developers and Composers_
1212
[![GitHub watchers](https://img.shields.io/github/watchers/PatilShreyas/compose-report-to-html?style=social)](https://github.com/PatilShreyas/compose-report-to-html/watchers)
1313
[![Twitter Follow](https://img.shields.io/twitter/follow/imShreyasPatil?label=Follow&style=social)](https://twitter.com/imShreyasPatil)
1414

15+
| | **Install** | **Downloads** |
16+
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
17+
| **NPM** | [![NPM Package](https://img.shields.io/npm/v/compose-report2html?label=npm&logo=npm)](https://www.npmjs.com/package/compose-report2html) | [![NPM Downloads](https://img.shields.io/npm/dm/compose-report2html?label=Downloads&logo=npm)](https://www.npmjs.com/package/compose-report2html) |
18+
| **JAR** | [![Download JAR](https://img.shields.io/github/v/release/patilshreyas/compose-report-to-html?label=JAR&logo=java)](https://github.com/patilshreyas/compose-report-to-html/releases/latest/download/composeReport2Html.jar) | [![GitHub downloads](https://img.shields.io/github/downloads/PatilShreyas/compose-report-to-html/total?label=Downloads&logo=java)](https://github.com/patilshreyas/compose-report-to-html/releases/latest/download/composeReport2Html.jar) |
19+
| **Maven** | [![Install](https://img.shields.io/maven-central/v/dev.shreyaspatil.compose-compiler-report-generator/core?label=Maven%20Central&logo=android&style=flat-square)](https://search.maven.org/search?q=g:dev.shreyaspatil.compose-compiler-report-generator) |
1520

16-
| | **Install** | **Downloads** |
17-
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
18-
| **NPM** | [![NPM Package](https://img.shields.io/npm/v/compose-report2html?label=npm&logo=npm)](https://www.npmjs.com/package/compose-report2html) | [![NPM Downloads](https://img.shields.io/npm/dm/compose-report2html?label=Downloads&logo=npm)](https://www.npmjs.com/package/compose-report2html) |
19-
| **JAR** | [![Download JAR](https://img.shields.io/github/v/release/patilshreyas/compose-report-to-html?label=JAR&logo=java)](https://github.com/patilshreyas/compose-report-to-html/releases/latest/download/composeReport2Html.jar) | [![GitHub downloads](https://img.shields.io/github/downloads/PatilShreyas/compose-report-to-html/total?label=Downloads&logo=java)](https://github.com/patilshreyas/compose-report-to-html/releases/latest/download/composeReport2Html.jar) |
21+
## 💡 Motivation
2022

21-
22-
## 💡 Motivation
23-
24-
The Compose Compiler plugin can generate reports / metrics around certain compose-specific concepts that can be useful to understand what is happening with some of your compose code at a fine-grained level.
25-
[_**See this**_](https://github.com/androidx/androidx/blob/androidx-main/compose/compiler/design/compiler-metrics.md).
23+
The Compose Compiler plugin can generate reports / metrics around certain compose-specific concepts that can be useful
24+
to understand what is happening with some of your compose code at a fine-grained level.
25+
[_**See this**_](https://github.com/androidx/androidx/blob/androidx-main/compose/compiler/design/compiler-metrics.md).
2626

2727
This generates reports in `json`, `csv` and `txt` files which are not easily trace-able for developers.
2828
Also, Composable function and class reports becomes large and tedious to check.
29-
This tool parses the reports and metrics generated by Compose compiler and beautifies into a HTML page and intelligently distinguishes problematic and non-problematic composable functions and classes.
29+
This tool parses the reports and metrics generated by Compose compiler and beautifies into a HTML page and intelligently
30+
distinguishes problematic and non-problematic composable functions and classes.
3031

31-
_This utility doesn't generate Compose Metrics and Reports. First, raw Compose report should be generated from the Compiler and those generated files should be feed to this utility. By parsing that data, this utility generates the beautified report._
32+
_This utility doesn't generate Compose Metrics and Reports. First, raw Compose report should be generated from the
33+
Compiler and those generated files should be feed to this utility. By parsing that data, this utility generates the
34+
beautified report._
3235

3336
## 🧑‍💻 Usage
3437

@@ -40,7 +43,8 @@ To install the CLI utility, there are two ways
4043

4144
#### 1.1 Directly use `.jar` distribution
4245

43-
Navigate to the [releases](https://github.com/PatilShreyas/compose-report-to-html/releases) and download the latest JAR artifact.
46+
Navigate to the [releases](https://github.com/PatilShreyas/compose-report-to-html/releases) and download the latest JAR
47+
artifact.
4448

4549
#### 1.2 Install from NPM
4650

@@ -84,7 +88,10 @@ Options:
8488
8589
### 3. Generate report
8690
87-
Make sure to generate Compose compiler metrics and reports as mentioned [here](https://github.com/androidx/androidx/blob/androidx-main/compose/compiler/design/compiler-metrics.md) or [this good read article by Chris Banes](https://chris.banes.dev/composable-metrics/). These files are then needed to this CLI utility to feed the data.
91+
Make sure to generate Compose compiler metrics and reports as
92+
mentioned [here](https://github.com/androidx/androidx/blob/androidx-main/compose/compiler/design/compiler-metrics.md)
93+
or [this good read article by Chris Banes](https://chris.banes.dev/composable-metrics/). These files are then needed to
94+
this CLI utility to feed the data.
8895
8996
To generate the report, provide details related to app, metric and report files and output directory.
9097
@@ -112,9 +119,17 @@ java -jar composeReport2Html.jar \
112119
-o notyReport
113120
```
114121
115-
In the above example, it will create report with name **"NotyKT"** with specified metric and report files and finally report will be generated in the specified path i.e. `notyReport/index.html`.
122+
In the above example, it will create report with name **"NotyKT"** with specified metric and report files and finally
123+
report will be generated in the specified path i.e. `notyReport/index.html`.
124+
125+
## Utility as a library
126+
127+
This utility is also published as a maven artifact on Maven Central so that you can make use of it as you want to use it
128+
(_For example: automation in CI_).
129+
130+
Refer to the Wiki for more information: [**Using this utility as a library**](https://github.com/PatilShreyas/compose-report-to-html/wiki/Using-utility-as-a-library)
116131
117-
## 📈 Report Overview
132+
## 📈 Report Overview
118133
119134
Once report is generated, it looks like this.
120135
@@ -126,7 +141,7 @@ Once report is generated, it looks like this.
126141
| **Class Report** | Parses `-classes.txt` file and separates out stable and unstable classes out of it and properly highlights issues associated with them. <br><br> ![Class Report](images/class-report.png) |
127142
128143
Right now, work is in progress and more improvements related to the report
129-
will happen in some time. If you have any feedback / suggestions related to
144+
will happen in some time. If you have any feedback / suggestions related to
130145
the report, feel free to discuss it (_find discussion link in the below section_).
131146
132147
## 🙋‍♂️ Contribute
@@ -135,7 +150,8 @@ Read [contribution guidelines](CONTRIBUTING.md) for more information regarding c
135150
136151
## 💬 Discuss?
137152
138-
Have any questions, doubts or want to present your opinions, views? You're always welcome. You can [start discussions](https://github.com/PatilShreyas/compose-report-to-html/discussions).
153+
Have any questions, doubts or want to present your opinions, views? You're always welcome. You
154+
can [start discussions](https://github.com/PatilShreyas/compose-report-to-html/discussions).
139155
140156
## License
141157

build.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22

3-
val libraryVersion: String by project
4-
val libraryGroup: String by project
3+
val VERSION_NAME: String by project
4+
val GROUP: String by project
55

66
plugins {
7-
kotlin("jvm") version "1.7.20"
7+
kotlin("jvm") version libs.versions.kotlin.get()
88
alias(libs.plugins.spotless)
9+
alias(libs.plugins.mavenPublish) apply false
910
}
1011

11-
group = libraryGroup
12-
version = libraryVersion
12+
group = GROUP
13+
version = VERSION_NAME
1314

1415
repositories {
1516
mavenCentral()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,5 @@ fun printHeader(header: String) = println(
161161
)
162162

163163
object Constants {
164-
const val VERSION = "v1.0.0-alpha01"
164+
const val VERSION = "v1.0.0-alpha02"
165165
}

core/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
kotlin("jvm")
3+
id(libs.plugins.mavenPublish.get().pluginId)
34
}
45

56
repositories {

core/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_ARTIFACT_ID=core
2+
POM_NAME=Compose Report to HTML - Core
3+
POM_DESCRIPTION=Generates details from raw compose report.

gradle.properties

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
kotlin.code.style=official
22

3-
libraryGroup=dev.shreyaspatil.compose-compiler-report-generator
4-
libraryVersion=1.0.0-alpha01
3+
GROUP=dev.shreyaspatil.compose-compiler-report-generator
4+
VERSION_NAME=1.0.0-alpha02
5+
6+
# Library configuration
7+
SONATYPE_HOST=DEFAULT
8+
RELEASE_SIGNING_ENABLED=true
9+
10+
POM_INCEPTION_YEAR=2023
11+
POM_URL=https://github.com/PatilShreyas/compose-report-to-html/
12+
13+
POM_LICENSE_NAME=MIT
14+
POM_LICENSE_URL=https://raw.githubusercontent.com/PatilShreyas/compose-report-to-html/main/LICENSE
15+
POM_LICENSE_DIST=repo
16+
17+
POM_SCM_URL=https://github.com/PatilShreyas/compose-report-to-html/
18+
POM_SCM_CONNECTION=scm:git:git://github.com/PatilShreyas/compose-report-to-html.git
19+
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/PatilShreyas/compose-report-to-html.git
20+
21+
POM_DEVELOPER_ID=PatilShreyas
22+
POM_DEVELOPER_NAME=Shreyas Patil
23+
POM_DEVELOPER_URL=https://github.com/PatilShreyas/

gradle/libs.versions.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
[versions]
2-
coroutines = "1.6.1"
2+
kotlin = "1.8.0"
3+
coroutines = "1.6.4"
34
moshi = "1.13.0"
45
spotless = "6.3.0"
56
kotlinxHtml = "0.7.5"
67
kotlinxCli = "0.3.4"
8+
mavenPublish = "0.23.2"
79

810
[libraries]
911
moshi = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" }
@@ -12,4 +14,5 @@ kotlinx-html-jvm = { module = "org.jetbrains.kotlinx:kotlinx-html-jvm", version.
1214
kotlinx-cli = { module = "org.jetbrains.kotlinx:kotlinx-cli", version.ref = "kotlinxCli" }
1315

1416
[plugins]
15-
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
17+
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
18+
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }

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-alpha01",
10+
"version": "1.0.0-alpha02",
1111
"jdeploy": {
1212
"jdk": false,
1313
"javaVersion": "11",

reportGenerator/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
kotlin("jvm")
3+
id(libs.plugins.mavenPublish.get().pluginId)
34
}
45
repositories {
56
mavenCentral()

0 commit comments

Comments
 (0)