Skip to content

Commit

Permalink
Changes in build.gradle to allow the uberJar task for building a sing…
Browse files Browse the repository at this point in the history
…le jar with a whole working WS3D, without the necessity of other libraries
  • Loading branch information
rgudwin committed Mar 22, 2021
1 parent 454bb0f commit b27cd63
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*.log
/.classpath
/nbproject/
/.project
Expand Down
16 changes: 15 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,24 @@ task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task uberJar(type: Jar) {
archiveClassifier = 'full'
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': mainClassName
)
}
from sourceSets.main.output
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
}
artifacts
{
//archives javadocJar, sourcesJar
archives sourcesJar
archives sourcesJar,uberJar
}

jar {
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
action.custom-1=uberJar
action.custom-1.args=uberJar

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Thu Jan 23 12:51:32 BRT 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down

0 comments on commit b27cd63

Please sign in to comment.