From 14264799daf23a1015a21912c0bae496344327ef Mon Sep 17 00:00:00 2001 From: Chris Leishman Date: Tue, 18 Oct 2022 11:57:10 +0200 Subject: [PATCH] Add an alternative jar shadowing ANTLR Fixes #29 --- build.gradle | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 690e5ae..1b4ec4b 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,7 @@ plugins { id "com.github.hierynomus.license-report" version "0.16.1" id 'io.spring.dependency-management' version '1.0.14.RELEASE' id 'net.ltgt.errorprone' version '3.0.1' + id 'com.github.johnrengelman.shadow' version '7.1.2' } description = 'A parser for Tom\'s Obvious, Minimal Language (TOML).' @@ -207,9 +208,20 @@ task javadocJar(type: Jar, dependsOn: javadoc) { from javadoc.destinationDir } -artifacts { - archives sourcesJar - archives javadocJar +shadowJar { + configurations = [ + project.configurations.compileClasspath + ] + dependencies { + exclude(dependency('org.checkerframework:checker-qual')) + } + exclude '**/pom.xml' + exclude '**/pom.properties' + relocate 'org.antlr', 'org.tomlj.internal.antlr' + minimize() + manifest { + attributes 'Description': 'This archive embeds a copy of the required ANTLR4 runtime library' + } } signing { @@ -227,7 +239,7 @@ dependencyManagement { publishing { publications { - MavenDeployment(MavenPublication) { + distribution(MavenPublication) { from components.java artifact sourcesJar { classifier 'sources' } artifact javadocJar { classifier 'javadoc' } @@ -310,8 +322,8 @@ tasks.withType(Sign) { } model { - tasks.generatePomFileForMavenDeploymentPublication { + tasks.generatePomFileForDistributionPublication { destination = file("$buildDir/generated-pom.xml") } - tasks.publishMavenDeploymentPublicationToMavenLocal { dependsOn project.tasks.signArchives } + tasks.publishDistributionPublicationToMavenLocal { dependsOn project.tasks.signArchives } }