Skip to content

Commit 9e33b29

Browse files
committed
add jar and shadowJar tasks
1 parent 7a650ae commit 9e33b29

2 files changed

Lines changed: 53 additions & 9 deletions

File tree

build.gradle

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
id 'com.github.johnrengelman.shadow' version '5.1.0'
3-
id 'com.eriwen.gradle.css' version '2.14.0'
2+
id 'com.github.johnrengelman.shadow' version '5.1.0'
3+
id 'com.eriwen.gradle.css' version '2.14.0'
44
}
55

66
apply plugin: 'java'
@@ -14,14 +14,37 @@ version '1.0'
1414
sourceCompatibility = 1.8
1515

1616
repositories {
17-
mavenCentral()
18-
maven {
19-
url 'https://jitpack.io/'
20-
}
17+
mavenCentral()
18+
maven {
19+
url 'https://jitpack.io/'
20+
}
21+
}
22+
23+
configurations {
24+
project.configurations.implementation.canBeResolved = true
2125
}
2226

2327
dependencies {
24-
implementation 'com.github.Querz:NBT:4192a95c9d'
25-
implementation 'org.json:json:20201115'
26-
testCompile group: 'junit', name: 'junit', version: '4.12'
28+
implementation 'com.github.Querz:NBT:4192a95c9d'
29+
implementation 'org.json:json:20201115'
30+
testCompile group: 'junit', name: 'junit', version: '4.12'
31+
}
32+
33+
jar {
34+
archiveFileName = "${project.name}-${project.version}-min.jar"
35+
manifest.attributes (
36+
'Main-Class': 'net.querz.mcmapviewer.Main',
37+
'Application-Version': project.version,
38+
'Class-Path': configurations.implementation.files.collect{"lib/$it.name"}.join(' ')
39+
)
40+
exclude 'licenses/'
41+
from 'LICENSE'
42+
}
43+
44+
shadowJar {
45+
minimize()
46+
archiveFileName = "${project.name}-${project.version}.jar"
47+
configurations = [project.configurations.implementation]
48+
manifest.attributes('Class-Path': '')
49+
from 'LICENSE'
2750
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) 2002 JSON.org
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
The Software shall be used for Good, not Evil.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)