Skip to content

Commit

Permalink
Gradle: do not skip setting version attributes when in Eclipse
Browse files Browse the repository at this point in the history
Works better with latest Eclipse IDE.
  • Loading branch information
carlosame committed Jun 18, 2024
1 parent c587c8f commit 30569b7
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions buildSrc/src/main/groovy/echosvg.java-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@ java {

tasks.register('jvmVersionAttribute') {
description = "Set the correct 'org.gradle.jvm.version' attribute"
if (!project.getPluginManager().hasPlugin('eclipse')) {
def jvmVersionAttribute = Attribute.of('org.gradle.jvm.version', Integer)
configurations.each {
if (it.canBeConsumed) {
def categoryAttr = it.attributes.getAttribute(Category.CATEGORY_ATTRIBUTE)
if (categoryAttr != null && categoryAttr.name == Category.LIBRARY) {
def usageAttr = it.attributes.getAttribute(Usage.USAGE_ATTRIBUTE)
if (usageAttr != null && (usageAttr.name == Usage.JAVA_API
|| usageAttr.name == Usage.JAVA_RUNTIME)) {
it.attributes.attribute(jvmVersionAttribute, 8)
}
def jvmVersionAttribute = Attribute.of('org.gradle.jvm.version', Integer)
configurations.each {
if (it.canBeConsumed) {
def categoryAttr = it.attributes.getAttribute(Category.CATEGORY_ATTRIBUTE)
if (categoryAttr != null && categoryAttr.name == Category.LIBRARY) {
def usageAttr = it.attributes.getAttribute(Usage.USAGE_ATTRIBUTE)
if (usageAttr != null && (usageAttr.name == Usage.JAVA_API
|| usageAttr.name == Usage.JAVA_RUNTIME)) {
it.attributes.attribute(jvmVersionAttribute, 8)
}
}
}
Expand Down

0 comments on commit 30569b7

Please sign in to comment.