11plugins {
22 id " java"
3- id " application"
4- id " maven-publish"
5- id " idea"
3+ id " base.base-conventions"
4+ id " base.application-conventions"
5+ id " base.fill-build-constants"
6+ id " viaproxy.publishing-conventions"
67 id " net.raphimc.class-token-replacer" version " 1.1.4"
78 id " xyz.wagyourtail.jvmdowngrader" version " 1.2.2"
89}
910
10- base {
11- java. toolchain. languageVersion = JavaLanguageVersion . of(17 )
12- compileJava. options. encoding = compileTestJava. options. encoding = javadoc. options. encoding = " UTF-8"
13-
14- group = project. maven_group ?: rootProject. maven_group
15- archivesName = project. maven_name ?: rootProject. maven_name
16- version = project. maven_version ?: rootProject. maven_version
17- }
18-
1911configurations {
20- include
2112 includeJ8
22-
23- implementation. extendsFrom include
24- api. extendsFrom include
2513}
2614
2715repositories {
28- mavenCentral()
2916 maven {
3017 name = " ViaVersion"
3118 url = " https://repo.viaversion.com"
@@ -113,102 +100,20 @@ dependencies {
113100 includeJ8 " xyz.wagyourtail.jvmdowngrader:jvmdowngrader-java-api:1.2.2:downgraded-8"
114101}
115102
116- sourceSets {
117- main {
118- classTokenReplacer {
119- property(" \$ {version}" , project. version)
120- property(" \$ {impl_version}" , " git-${ project.name} -${ project.version} :${ project.latestCommitHash().get()} " )
121- }
122- }
123- }
124-
125- java {
126- withSourcesJar()
127- }
128-
129103application {
130104 mainClass = " net.raphimc.viaproxy.ViaProxy"
131105}
132106
133107jar {
134- dependsOn configurations. include
135- from {
136- duplicatesStrategy = DuplicatesStrategy . EXCLUDE
137- configurations. include. collect {
138- zipTree(it)
139- }
140- } {
141- exclude " META-INF/*.RSA" , " META-INF/*.SF" , " META-INF/*.DSA"
142- }
143-
144108 manifest {
145109 attributes(
146- " Main-Class" : application. mainClass,
147- " Multi-Release" : " true" ,
148110 " Launcher-Agent-Class" : application. mainClass
149111 )
150112 }
151-
152- from(" LICENSE" ) {
153- rename { " ${ it} _${ project.name ?: rootProject.name} " }
154- }
155- }
156-
157- publishing {
158- repositories {
159- maven {
160- name = " Via"
161- url = " https://repo.viaversion.com/"
162-
163- credentials(PasswordCredentials )
164- authentication {
165- basic(BasicAuthentication )
166- }
167- }
168- }
169- publications {
170- maven(MavenPublication ) {
171- groupId = project. maven_group
172- artifactId = project. maven_name
173- version = project. maven_version
174-
175- from components. java
176-
177- pom {
178- name = " ViaProxy"
179- description = " Standalone proxy which allows players to join EVERY Minecraft server version (Classic, Alpha, Beta, Release, Bedrock)"
180- url = " https://github.com/ViaVersion/ViaProxy"
181- licenses {
182- license {
183- name = " GPL-3.0 License"
184- url = " https://github.com/ViaVersion/ViaProxy/blob/main/LICENSE"
185- }
186- }
187- developers {
188- developer {
189- id = " RK_01"
190- }
191- }
192- scm {
193- connection = " scm:git:git://github.com/ViaVersion/ViaProxy.git"
194- developerConnection = " scm:git:ssh://github.com/ViaVersion/ViaProxy.git"
195- url = " https://github.com/ViaVersion/ViaProxy.git"
196- }
197- }
198- }
199- }
200- }
201-
202- idea {
203- module {
204- [" run" ]. each {
205- excludeDirs << file(" $it " )
206- }
207- }
208113}
209114
210115downgradeJar {
211- dependsOn configurations. includeJ8
116+ dependsOn( configurations. includeJ8)
212117 from {
213118 duplicatesStrategy = DuplicatesStrategy . EXCLUDE
214119 configurations. includeJ8. collect {
@@ -225,8 +130,4 @@ downgradeJar {
225130}
226131build. finalizedBy(" downgradeJar" )
227132
228- Provider<String > latestCommitHash () {
229- return providers. exec {
230- commandLine = [" git" , " rev-parse" , " --short" , " HEAD" ]
231- }. standardOutput. getAsText(). map(String ::trim)
232- }
133+ tasks. javadoc. enabled = false
0 commit comments