Skip to content

Commit 162f224

Browse files
committed
[U] Gradle: Build shadow jar with dependencies
1 parent 911e2ce commit 162f224

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import org.apache.tools.ant.filters.ReplaceTokens
33
plugins {
44
id 'java'
55
id 'maven-publish'
6+
id "com.github.johnrengelman.shadow" version "7.1.2"
67
}
78

89
group 'org.hydev.csc207'
@@ -32,6 +33,9 @@ dependencies {
3233
// The Spigot API with no shadowing. Requires the OSS repo.
3334
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
3435

36+
// https://mvnrepository.com/artifact/net.sourceforge.argparse4j/argparse4j
37+
implementation 'net.sourceforge.argparse4j:argparse4j:0.9.0'
38+
3539
// Apache HTTP Client
3640
// https://mvnrepository.com/artifact/org.apache.httpcomponents.client5/httpclient5-fluent
3741
implementation 'org.apache.httpcomponents.client5:httpclient5-fluent:5.2-beta1'

tools/start_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ def update_build(mc_path: Path):
5151
print('Building project...')
5252
build_jar = Path('build/libs')
5353
shutil.rmtree(build_jar, ignore_errors=True)
54-
check_call('./gradlew build', shell=True)
54+
check_call('./gradlew shadow', shell=True)
5555

5656
# Install plugin
5757
print('Installing our MCPM plugin...')
5858
plugin_path = mc_path / 'plugins/mcpm.jar'
5959
shutil.rmtree(plugin_path, ignore_errors=True)
6060
ensure_dir(plugin_path.parent)
61-
shutil.copy2(build_jar / str(os.listdir(build_jar)[0]), plugin_path)
61+
shutil.copy2(build_jar / str([f for f in os.listdir(build_jar) if f.endswith("-all.jar")][0]), plugin_path)
6262

6363

6464
if __name__ == '__main__':

0 commit comments

Comments
 (0)