Skip to content

Commit

Permalink
Fix pom generation for non-shaded version (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
racevedoo authored Oct 17, 2024
1 parent cd5ccf4 commit d53f506
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'signing'
id 'com.diffplug.spotless' version '6.11.0'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'io.github.goooler.shadow' version '8.1.7'
id 'io.github.goooler.shadow' version '8.1.7' apply false
}

group = "com.incognia"
Expand Down Expand Up @@ -74,17 +74,20 @@ spotless {
}
}

shadowJar {
archiveClassifier.set('')
relocate 'okhttp3', 'incognia.shadow.okhttp3'
relocate 'com.fasterxml', 'incognia.shadow.com.fasterxml'
relocate 'com.auth0', 'incognia.shadow.com.auth0'
def isShadow = project.findProperty("shadow") == "true"
if (isShadow) {
apply plugin: 'io.github.goooler.shadow'
shadowJar {
archiveClassifier.set('')
relocate 'okhttp3', 'incognia.shadow.okhttp3'
relocate 'com.fasterxml', 'incognia.shadow.com.fasterxml'
relocate 'com.auth0', 'incognia.shadow.com.auth0'
}
}

tasks.named('test') {
useJUnitPlatform()
}
def isShadow = project.findProperty("shadow") == "true"

publishing {
publications {
Expand All @@ -93,11 +96,9 @@ publishing {
publication.artifactId = 'incognia-api-client-shaded'
artifact shadowJar
} else {
from components.java
publication.artifactId = 'incognia-api-client'
artifact jar
}
artifact sourcesJar
artifact javadocJar
pom {
name = 'Incognia API Client'
description = "Java client library for Incognia's API"
Expand Down

0 comments on commit d53f506

Please sign in to comment.