Skip to content

Commit

Permalink
Use Shadow plugin for fat JAR generation
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed May 17, 2023
1 parent 3d332db commit 95e09e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
17 changes: 4 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'java-library'
id 'maven-publish'
id 'org.cadixdev.licenser'
id 'com.github.johnrengelman.shadow'
id 'checkstyle'
}

Expand Down Expand Up @@ -59,19 +60,9 @@ jar {
}
}

task allJar(type: Jar) {
from {
configurations.ship.collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes 'Implementation-Title': 'Stitch',
'Implementation-Version': archiveVersion,
'Main-Class': 'net.fabricmc.stitch.Main'
}
shadowJar {
configurations = [project.configurations.ship]
archiveClassifier = 'all'
with jar
}

java {
Expand All @@ -90,7 +81,7 @@ publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact(allJar)
artifact(shadowJar)
}
}

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ org.gradle.workers.max = 3

# Gradle Plugins
cadixdev_licenser_version = 0.6.1
shadow_version = 7.1.2

# Project Properties
version = 0.6.2
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pluginManagement {
}
plugins {
id 'org.cadixdev.licenser' version "${cadixdev_licenser_version}"
id 'com.github.johnrengelman.shadow' version "${shadow_version}"
}
}

Expand Down

0 comments on commit 95e09e2

Please sign in to comment.