Skip to content

Commit

Permalink
make grease tasks depend on publish task
Browse files Browse the repository at this point in the history
  • Loading branch information
0xera authored and natario1 committed Aug 29, 2024
1 parent 08b060d commit 9acd4cd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
11 changes: 1 addition & 10 deletions grease/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "io.deepmedia.tools"
version = "0.7.0"
version = "0.3.0"

gradlePlugin {
plugins {
Expand Down Expand Up @@ -77,13 +77,4 @@ deployer {
token = secret("GHUB_PERSONAL_ACCESS_TOKEN")
}
}
}

publishing {
repositories {
maven {
name = "Local"
url = uri(rootProject.layout.buildDirectory.dir("grease_pub"))
}
}
}
13 changes: 13 additions & 0 deletions grease/src/main/kotlin/io/deepmedia/tools/grease/GreasePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,19 @@ open class GreasePlugin : Plugin<Project> {
mustRunAfter(bundleLibraryTask)
finalizedBy(greaseShadowTask)
}
greaseShadowTask.configure {
mustRunAfter(bundleLibraryTask)
}
target.plugins.withId("org.gradle.maven-publish") {
target.tasks.withType(PublishToMavenRepository::class.java) {
val publication = publication
if (publication is DefaultMavenPublication) {
if (creationConfig.name == publication.component.get().name) {
dependsOn(greaseShadowTask)
}
}
}
}
}

private fun replacePackagesInFile(
Expand Down

0 comments on commit 9acd4cd

Please sign in to comment.