Skip to content

Commit

Permalink
Publish with gradle API attribute (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish authored Mar 24, 2024
1 parent 6c5abf2 commit b7f8601
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.gradle.api.attributes.plugin.GradlePluginApiVersion
import org.gradle.util.GradleVersion

plugins {
id 'eclipse'
id 'maven-publish'
Expand Down Expand Up @@ -65,6 +68,17 @@ subprojects.forEach { Project subProject ->
configuration.exclude group: 'org.ow2.asm'
}

['apiElements', 'runtimeElements'].each {
subProject.configurations.named(it).configure {
attributes {
attribute(
GradlePluginApiVersion.GRADLE_PLUGIN_API_VERSION_ATTRIBUTE,
objects.named(GradlePluginApiVersion, GradleVersion.current().getVersion())
)
}
}
}

//Wire up our custom repositories.
subProject.repositories.mavenLocal()
subProject.repositories.maven { MavenArtifactRepository repository ->
Expand Down

0 comments on commit b7f8601

Please sign in to comment.