Skip to content

Commit

Permalink
Merge pull request #184 from kkocel/master
Browse files Browse the repository at this point in the history
Shadow jar
  • Loading branch information
tha2015 authored Oct 22, 2021
2 parents 50911d2 + c83134f commit 8bd1bf4
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation

plugins {
id 'groovy'
id 'maven-publish'
id 'java-gradle-plugin'
id "com.gradle.plugin-publish" version "0.14.0"
id "com.github.johnrengelman.shadow" version "7.0.0"
id "com.gorylenko.gradle-git-properties" version "2.3.1-rc3"
}

Expand All @@ -26,8 +29,8 @@ repositories {
}

dependencies {
implementation gradleApi()
implementation localGroovy()
shadow gradleApi()
shadow localGroovy()
implementation 'org.ajoberstar.grgit:grgit-core:4.1.0'
// for debugging
//implementation 'org.gradle:gradle-language-jvm:5.6.2'
Expand All @@ -38,6 +41,23 @@ dependencies {
testImplementation gradleTestKit()
}

task relocateShadowJar(type: ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = "gradlegitproperties"
}

tasks.shadowJar.dependsOn tasks.relocateShadowJar

shadowJar {
archiveClassifier.set('')
}

tasks.shadowJar.dependsOn tasks.jar

components.java.withVariantsFromConfiguration(configurations.runtimeElements) {
skip()
}

version = "2.3.1"
group = "com.gorylenko.gradle-git-properties"

Expand Down Expand Up @@ -68,9 +88,9 @@ publishing {

publications {

pluginJar(MavenPublication) {
pluginJar(MavenPublication) { publication ->

from components.java
from project.shadow.component(publication)

artifact sourceJar
}
Expand Down

0 comments on commit 8bd1bf4

Please sign in to comment.