Skip to content

Commit

Permalink
[PBE-5292] Shadow dependencies (#149)
Browse files Browse the repository at this point in the history
* feat: shadow io.jsonwebtoken library

some customers have conflicts for this dependency

* feat: include io.jsonwebtoken and jackson in jar

also shadow io.jsonwebtoken

* feat: publish -all artifact shadowing all the dependencies

* fix: request param name file_name -> filename (#150)

* fix: update gradle related plugins because gradle was upgraded
  • Loading branch information
shaljam authored Aug 7, 2024
1 parent 28eaac0 commit 9ee6841
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.
16 changes: 13 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
plugins {
id 'java'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
id 'java-library'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'com.diffplug.spotless' version '6.25.0'
id 'org.barfuin.gradle.jacocolog' version '2.0.0'
id 'org.barfuin.gradle.jacocolog' version '3.1.0'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}

group = 'io.getstream'
Expand All @@ -13,6 +14,9 @@ java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}

withJavadocJar()
withSourcesJar()
}

repositories {
Expand Down Expand Up @@ -99,4 +103,10 @@ task generateVersionProperties {
}
processResources.dependsOn generateVersionProperties

shadowJar {
enableRelocation true
relocationPrefix "shadowed"
mergeServiceFiles()
}

apply from: "publish.gradle"
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
23 changes: 8 additions & 15 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,9 @@ nexusPublishing {
}
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives javadocJar, sourcesJar
// to remove shadowed jar from the regular release publication
components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
skip()
}

afterEvaluate {
Expand All @@ -56,9 +47,6 @@ afterEvaluate {
from components.java
artifactId 'stream-chat-java'

artifact sourcesJar
artifact javadocJar

pom {
name = "Stream Chat official Java API Client"
description = "Stream Chat Java Client for backend integrations"
Expand All @@ -83,6 +71,11 @@ afterEvaluate {
}
}
}

shadow(MavenPublication) { publication ->
project.shadow.component(publication)
artifactId 'stream-chat-java-all'
}
}
}
}
Expand Down

0 comments on commit 9ee6841

Please sign in to comment.