Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 1c308c1

Browse files
authored
Merge pull request #303 from icerockdev/#295-publish-plugin-to-gradlePluginPortal
#295 publish plugin to gradle plugin portal
2 parents 643dc58 + d875bed commit 1c308c1

File tree

4 files changed

+35
-9
lines changed

4 files changed

+35
-9
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Cocoapods install
2929
run: (cd sample/ios-app && pod install)
3030
- name: Publish plugin
31-
run: ./gradlew -p plugin publishMavenJavaPublicationToOSSRHRepository
31+
run: ./gradlew -p plugin publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PLUGIN_PORTAL_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PLUGIN_PORTAL_SECRET }}
3232
- name: Publish library
3333
run: ./gradlew publish
3434

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,13 @@ root build.gradle
215215
```groovy
216216
buildscript {
217217
repositories {
218-
mavenCentral()
218+
gradlePluginPortal()
219219
}
220220
221221
dependencies {
222222
classpath "dev.icerock.moko.widgets:gradle-plugin:0.1.0"
223223
}
224224
}
225-
226-
allprojects {
227-
repositories {
228-
maven { url = uri("https://dl.bintray.com/icerockdev/plugins") } // compiler plugins
229-
}
230-
}
231225
```
232226

233227
project build.gradle

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ buildscript {
1010
jcenter()
1111
}
1212
dependencies {
13-
classpath("dev.icerock.moko:resources-generator:0.16.1")
13+
classpath("dev.icerock.moko:resources-generator:0.16.2")
1414
classpath("dev.icerock.moko.widgets:gradle-plugin")
1515

1616
classpath(":widgets-build-logic")

plugin/build.gradle.kts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
plugins {
66
id("org.jetbrains.kotlin.jvm") version ("1.5.20")
7+
id("com.gradle.plugin-publish") version ("0.15.0")
78
id("detekt-convention")
89
id("publication-convention")
10+
id("java-gradle-plugin")
911
}
1012

1113
buildscript {
@@ -17,6 +19,8 @@ buildscript {
1719
jcenter()
1820
}
1921
dependencies {
22+
classpath("com.gradle.publish:plugin-publish-plugin:0.15.0")
23+
2024
classpath(":widgets-build-logic")
2125
}
2226
}
@@ -39,3 +43,31 @@ publishing.publications.register("mavenJava", MavenPublication::class) {
3943
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
4044
kotlinOptions.jvmTarget = "1.8"
4145
}
46+
47+
gradlePlugin {
48+
plugins {
49+
create("multiplatform-widgets-generator") {
50+
id = "dev.icerock.mobile.multiplatform-widgets-generator"
51+
implementationClass = "dev.icerock.moko.widgets.WidgetsGeneratorGradlePlugin"
52+
}
53+
}
54+
}
55+
56+
pluginBundle {
57+
website = "https://github.com/icerockdev/moko-widgets"
58+
vcsUrl = "https://github.com/icerockdev/moko-widgets"
59+
description = "Plugin to codegen for new Widgets"
60+
tags = listOf("moko-widgets", "moko", "kotlin", "kotlin-multiplatform")
61+
62+
plugins {
63+
getByName("multiplatform-widgets-generator") {
64+
displayName = "MOKO Widgets generator plugin"
65+
}
66+
}
67+
68+
mavenCoordinates {
69+
groupId = project.group as String
70+
artifactId = project.name
71+
version = project.version as String
72+
}
73+
}

0 commit comments

Comments
 (0)