Skip to content

Commit 9acd4cd

Browse files
0xeranatario1
authored andcommitted
make grease tasks depend on publish task
1 parent 08b060d commit 9acd4cd

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

grease/build.gradle.kts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "io.deepmedia.tools"
7-
version = "0.7.0"
7+
version = "0.3.0"
88

99
gradlePlugin {
1010
plugins {
@@ -77,13 +77,4 @@ deployer {
7777
token = secret("GHUB_PERSONAL_ACCESS_TOKEN")
7878
}
7979
}
80-
}
81-
82-
publishing {
83-
repositories {
84-
maven {
85-
name = "Local"
86-
url = uri(rootProject.layout.buildDirectory.dir("grease_pub"))
87-
}
88-
}
8980
}

grease/src/main/kotlin/io/deepmedia/tools/grease/GreasePlugin.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,19 @@ open class GreasePlugin : Plugin<Project> {
536536
mustRunAfter(bundleLibraryTask)
537537
finalizedBy(greaseShadowTask)
538538
}
539+
greaseShadowTask.configure {
540+
mustRunAfter(bundleLibraryTask)
541+
}
542+
target.plugins.withId("org.gradle.maven-publish") {
543+
target.tasks.withType(PublishToMavenRepository::class.java) {
544+
val publication = publication
545+
if (publication is DefaultMavenPublication) {
546+
if (creationConfig.name == publication.component.get().name) {
547+
dependsOn(greaseShadowTask)
548+
}
549+
}
550+
}
551+
}
539552
}
540553

541554
private fun replacePackagesInFile(

0 commit comments

Comments
 (0)