Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an alternative jar shadowing ANTLR #54

Merged
merged 1 commit into from Oct 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 18 additions & 6 deletions build.gradle
Expand Up @@ -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).'
Expand Down Expand Up @@ -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 {
Expand All @@ -227,7 +239,7 @@ dependencyManagement {

publishing {
publications {
MavenDeployment(MavenPublication) {
distribution(MavenPublication) {
from components.java
artifact sourcesJar { classifier 'sources' }
artifact javadocJar { classifier 'javadoc' }
Expand Down Expand Up @@ -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 }
}