|
1 | 1 | plugins { |
2 | | - id "java-library" |
3 | | - id "idea" |
4 | | -} |
5 | | - |
6 | | -base { |
7 | | - java.toolchain.languageVersion = JavaLanguageVersion.of(17) |
8 | | - compileJava.options.encoding = compileTestJava.options.encoding = javadoc.options.encoding = "UTF-8" |
9 | | - |
10 | | - group = project.maven_group ?: rootProject.maven_group |
11 | | - archivesName = project.maven_name ?: rootProject.maven_name |
12 | | - version = project.maven_version ?: rootProject.maven_version |
13 | | -} |
14 | | - |
15 | | -configurations { |
16 | | - include |
17 | | - |
18 | | - implementation.extendsFrom include |
19 | | - api.extendsFrom include |
20 | | -} |
21 | | - |
22 | | -repositories { |
23 | | - mavenCentral() |
24 | | - maven { |
25 | | - name = "ViaVersion" |
26 | | - url = "https://repo.viaversion.com" |
27 | | - } |
| 2 | + id "viaproxy.plugin-conventions" |
28 | 3 | } |
29 | 4 |
|
30 | 5 | dependencies { |
31 | 6 | implementation "net.raphimc:ViaProxy:3.4.1" |
32 | 7 | } |
33 | | - |
34 | | -processResources { |
35 | | - inputs.property "version", project.version |
36 | | - |
37 | | - filesMatching("viaproxy.yml") { |
38 | | - expand "version": project.version |
39 | | - } |
40 | | -} |
41 | | - |
42 | | -jar { |
43 | | - dependsOn configurations.include |
44 | | - from { |
45 | | - duplicatesStrategy = DuplicatesStrategy.EXCLUDE |
46 | | - configurations.include.collect { |
47 | | - zipTree(it) |
48 | | - } |
49 | | - } { |
50 | | - exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA" |
51 | | - } |
52 | | - |
53 | | - from("LICENSE") { |
54 | | - rename { "${it}_${project.name ?: rootProject.name}" } |
55 | | - } |
56 | | -} |
57 | | - |
58 | | -idea { |
59 | | - module { |
60 | | - ["run"].each { |
61 | | - excludeDirs << file("$it") |
62 | | - } |
63 | | - } |
64 | | -} |
65 | | - |
66 | | -tasks.register("runViaProxy", JavaExec) { |
67 | | - dependsOn tasks.jar |
68 | | - |
69 | | - mainClass = "net.raphimc.viaproxy.ViaProxy" |
70 | | - classpath = sourceSets.main.compileClasspath |
71 | | - workingDir = file("run") |
72 | | - jvmArgs = ["-DskipUpdateCheck"] |
73 | | - |
74 | | - doFirst { |
75 | | - def pluginsDir = file("$workingDir/plugins") |
76 | | - pluginsDir.mkdirs() |
77 | | - file("$pluginsDir/${project.name}.jar").bytes = tasks.jar.archiveFile.get().asFile.bytes |
78 | | - } |
79 | | - |
80 | | - doLast { |
81 | | - file("$workingDir/plugins/${project.name}.jar").delete() |
82 | | - file("$workingDir/logs").deleteDir() |
83 | | - } |
84 | | -} |
0 commit comments