Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 13 additions & 40 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
* - sonatypePassword
*/

apply plugin: 'java'
apply plugin: 'fatjar'
apply plugin: 'maven'
apply plugin: 'signing'
plugins {
id 'java'
id 'maven'
id 'signing'
id "com.github.johnrengelman.shadow" version "2.0.4"
}

group = 'com.sendgrid'
version = '4.2.1'
Expand All @@ -31,19 +33,6 @@ if (!hasProperty("sonatypeUsername")) {
ext.sonatypePassword = null
}

task wrapper(type: Wrapper) {
gradleVersion = '1.8'
}

buildscript {
dependencies {
classpath 'eu.appsatori:gradle-fatjar-plugin:0.1.2' // adds fatJar task
}
repositories {
mavenCentral()
}
}

dependencies {
compile 'com.sendgrid:java-http-client:4.1.0'
compile 'com.fasterxml.jackson.core:jackson-core:2.9.5'
Expand All @@ -64,33 +53,17 @@ allprojects {
}
}

// adds 'with-dependencies' to the fatJar name
fatJar {
classifier 'jar'
baseName "sendgrid"
shadowJar {
manifest {
attributes("Implementation-Title": "SendGrid", "Implementation-Version": version)
attributes("Implementation-Title": "SendGrid", "Implementation-Version": version)
}
}

// copy fatJar to base project directory so they will be in git (and on github for download)
build << {
// copy shadowJar to base project directory so they will be in git (and on github for download)
assemble.doLast {
copy {
println "Copying ${fatJar.archiveName} to $projectDir/repo/com/sendgrid"
from("$buildDir/libs/${fatJar.archiveName}")
into("$projectDir/repo/com/sendgrid")
}
tasks.renameSendGridVersionJarToSendGridJar.execute()
}

task renameSendGridVersionJarToSendGridJar {
doLast {
file("$projectDir/repo/com/sendgrid/${fatJar.archiveName}").renameTo(file("$projectDir/repo/com/sendgrid/sendgrid-java-latest.jar"))
copy {
from("$buildDir/libs/${fatJar.archiveName}")
into("$projectDir/repo/com/sendgrid")
}
file("$projectDir/repo/com/sendgrid/${fatJar.archiveName}").renameTo(file("$projectDir/repo/com/sendgrid/sendgrid-java-${version}.jar"))
from("$buildDir/libs/${shadowJar.archiveName}")
into("$projectDir")
}
}

Expand Down Expand Up @@ -166,7 +139,7 @@ uploadArchives {
}

artifacts {
archives fatJar
archives shadowJar
archives jar
archives javadocJar
archives sourcesJar
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon May 26 17:38:02 PDT 2014
#Wed Oct 03 16:23:45 MDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-1.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
78 changes: 43 additions & 35 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.