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

Commit d5f08fd

Browse files
committed
#295 add way to publish plugin to gradlePluginPortal
1 parent 6d49562 commit d5f08fd

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ 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")
15+
classpath("com.gradle.publish:plugin-publish-plugin:0.15.0")
1516

1617
classpath(":widgets-build-logic")
1718
}

plugin/build.gradle.kts

Lines changed: 30 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 {
@@ -39,3 +41,31 @@ publishing.publications.register("mavenJava", MavenPublication::class) {
3941
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
4042
kotlinOptions.jvmTarget = "1.8"
4143
}
44+
45+
gradlePlugin {
46+
plugins {
47+
create("multiplatform-widgets-generator") {
48+
id = "dev.icerock.mobile.multiplatform-widgets-generator"
49+
implementationClass = "dev.icerock.moko.widgets.WidgetsGeneratorGradlePlugin"
50+
}
51+
}
52+
}
53+
54+
pluginBundle {
55+
website = "https://github.com/icerockdev/moko-widgets/tree/master/plugin"
56+
vcsUrl = "https://github.com/icerockdev/moko-widgets/tree/master/plugin"
57+
description = "Plugin to codegen for new Widgets"
58+
tags = listOf("multiplatform-widgets-generator")
59+
60+
plugins {
61+
getByName("multiplatform-widgets-generator") {
62+
displayName = "Widgets Generator for IceRock projects"
63+
}
64+
}
65+
66+
mavenCoordinates {
67+
groupId = project.group as String
68+
artifactId = project.name
69+
version = project.version as String
70+
}
71+
}

0 commit comments

Comments
 (0)