11plugins {
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
2+ id " viaproxy.plugin-conventions"
203}
214
225repositories {
23- mavenCentral()
246 maven {
257 name = " Sonatype Snapshots"
268 url = " https://oss.sonatype.org/content/repositories/snapshots"
279 }
28- maven {
29- name = " ViaVersion"
30- url = " https://repo.viaversion.com"
31- }
3210 maven {
3311 name = " lucko"
3412 url = " https://repo.lucko.me"
@@ -40,55 +18,3 @@ dependencies {
4018
4119 include " me.lucko:spark-common:1.10.134-SNAPSHOT"
4220}
43-
44- processResources {
45- inputs. property " version" , project. version
46-
47- filesMatching(" viaproxy.yml" ) {
48- expand " version" : project. version
49- }
50- }
51-
52- jar {
53- dependsOn configurations. include
54- from {
55- duplicatesStrategy = DuplicatesStrategy . EXCLUDE
56- configurations. include. collect {
57- zipTree(it)
58- }
59- } {
60- exclude " META-INF/*.RSA" , " META-INF/*.SF" , " META-INF/*.DSA"
61- }
62-
63- from(" LICENSE" ) {
64- rename { " ${ it} _${ project.name ?: rootProject.name} " }
65- }
66- }
67-
68- idea {
69- module {
70- [" run" ]. each {
71- excludeDirs << file(" $it " )
72- }
73- }
74- }
75-
76- tasks. register(" runViaProxy" , JavaExec ) {
77- dependsOn tasks. jar
78-
79- mainClass = " net.raphimc.viaproxy.ViaProxy"
80- classpath = sourceSets. main. compileClasspath
81- workingDir = file(" run" )
82- jvmArgs = [" -DskipUpdateCheck" ]
83-
84- doFirst {
85- def pluginsDir = file(" $workingDir /plugins" )
86- pluginsDir. mkdirs()
87- file(" $pluginsDir /${ project.name} .jar" ). bytes = tasks. jar. archiveFile. get(). asFile. bytes
88- }
89-
90- doLast {
91- file(" $workingDir /plugins/${ project.name} .jar" ). delete()
92- file(" $workingDir /logs" ). deleteDir()
93- }
94- }
0 commit comments