From 12042e048e721fd4fc353ca3594de95849ca94fc Mon Sep 17 00:00:00 2001 From: Vlad Kozarez Date: Tue, 24 Sep 2024 13:09:25 +0300 Subject: [PATCH] compileClasspath --- build.gradle | 119 +++++++++++++++++++++++-------------------- upload-github.gradle | 3 +- 2 files changed, 65 insertions(+), 57 deletions(-) diff --git a/build.gradle b/build.gradle index 0516f11..46a28d8 100755 --- a/build.gradle +++ b/build.gradle @@ -29,9 +29,9 @@ jar { duplicatesStrategy = DuplicatesStrategy.EXCLUDE manifest { attributes('Implementation-Title': 'ic4j-agent', - 'Implementation-Version': project.version) + 'Implementation-Version': project.version) } - + archiveBaseName = 'ic4j-agent' } @@ -39,11 +39,11 @@ task fatJar(type: Jar) { duplicatesStrategy = DuplicatesStrategy.EXCLUDE manifest { attributes('Implementation-Title': 'ic4j-agent', - 'Implementation-Version': project.version) + 'Implementation-Version': project.version) } - + archiveBaseName = 'ic4j-agent-with-dependencies' - + from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } with jar } @@ -57,67 +57,74 @@ tasks.named('shadowJar', ShadowJar) { archiveBaseName = 'ic4j-agent' archiveClassifier = '' relocate 'org.apache.commons', 'shadow.apache.commons' + dependencies { + exclude { + it.moduleGroup == 'org.slf4j' || + it.moduleGroup == 'org.jetbrains.kotlin' || + it.moduleGroup == 'org.jetbrains' + } + } } test { useJUnitPlatform() - + exclude '**/*ICTest*' exclude '**/*LoanTest*' exclude '**/*TradingTest*' } dependencies { - implementation group: 'org.ic4j', name: 'ic4j-candid', version: '0.7.1' - - // https://mvnrepository.com/artifact/commons-codec/commons-codec - implementation group: 'commons-codec', name: 'commons-codec', version: '1.17.0' - - // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0' - - // https://mvnrepository.com/artifact/org.apache.httpcomponents.client5/httpclient5 - implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.3.1' - - // https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp - implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.12.0' - - // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind - implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.2' - - // https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-jdk8 - implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: '2.17.2' - - // https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor - implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: '2.17.2' - - // https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on - implementation group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.78.1' - - // https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk18on - implementation group: 'org.bouncycastle', name: 'bcpkix-jdk18on', version: '1.78.1' - - // https://mvnrepository.com/artifact/org.slf4j/slf4j-simple - implementation group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.13' - - // https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api - testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.10.0' - - // https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine - testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.10.0' - - // https://mvnrepository.com/artifact/org.junit.platform/junit-platform-launcher - testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: '1.10.0' - - // https://mvnrepository.com/artifact/org.skyscreamer/jsonassert - testImplementation group: 'org.skyscreamer', name: 'jsonassert', version: '1.5.1' - - // https://mvnrepository.com/artifact/org.mock-server/mockserver-netty - testImplementation group: 'org.mock-server', name: 'mockserver-netty', version: '5.11.2' - - // https://mvnrepository.com/artifact/org.mock-server/mockserver-junit-rule - testImplementation group: 'org.mock-server', name: 'mockserver-junit-jupiter', version: '5.11.2' - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" + shadow group: 'org.ic4j', name: 'ic4j-candid', version: '0.7.1' + + // https://mvnrepository.com/artifact/commons-codec/commons-codec + implementation group: 'commons-codec', name: 'commons-codec', version: '1.17.0' + + // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0' + + // https://mvnrepository.com/artifact/org.apache.httpcomponents.client5/httpclient5 + implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.3.1' + + // https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp + shadow group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.12.0' + + // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind + shadow group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.2' + + // https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-jdk8 + shadow group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: '2.17.2' + + // https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor + shadow group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: '2.17.2' + + // https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on + shadow group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.78.1' + + // https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk18on + shadow group: 'org.bouncycastle', name: 'bcpkix-jdk18on', version: '1.78.1' + + // https://mvnrepository.com/artifact/org.slf4j/slf4j-simple + shadow group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.13' + + // https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.10.0' + + // https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.10.0' + + // https://mvnrepository.com/artifact/org.junit.platform/junit-platform-launcher + testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: '1.10.0' + + // https://mvnrepository.com/artifact/org.skyscreamer/jsonassert + testImplementation group: 'org.skyscreamer', name: 'jsonassert', version: '1.5.1' + + // https://mvnrepository.com/artifact/org.mock-server/mockserver-netty + testImplementation group: 'org.mock-server', name: 'mockserver-netty', version: '5.11.2' + + // https://mvnrepository.com/artifact/org.mock-server/mockserver-junit-rule + testImplementation group: 'org.mock-server', name: 'mockserver-junit-jupiter', version: '5.11.2' + shadow "org.jetbrains.kotlin:kotlin-stdlib-jdk8" } kotlin { diff --git a/upload-github.gradle b/upload-github.gradle index 43465b4..9769907 100644 --- a/upload-github.gradle +++ b/upload-github.gradle @@ -1,4 +1,5 @@ apply plugin: 'maven-publish' +apply plugin: 'com.gradleup.shadow' afterEvaluate { publishing { @@ -9,7 +10,7 @@ afterEvaluate { artifactId = "$project.artifactId" version = "$project.artifactVersion" - artifact shadowJar + from components.shadow // from components.java pom.withXml {