11// file:noinspection GroovyAssignabilityCheck
22// file:noinspection GroovyAccessibility
33plugins {
4- id " fabric-loom" version " 0.9-SNAPSHOT"
5- id " maven-publish "
4+ id " fabric-loom" version " 0.9-SNAPSHOT"
5+ id " com.modrinth.minotaur " version " 1.2.1 "
66}
77
88sourceCompatibility = JavaVersion . VERSION_16
@@ -13,83 +13,60 @@ version = project.mod_version
1313group = project. maven_group
1414
1515repositories {
16- maven {
17- name = " TerraformersMC"
18- url = " https://maven.terraformersmc.com/releases/"
19- }
16+ maven {
17+ name = " TerraformersMC"
18+ url = " https://maven.terraformersmc.com/releases/"
19+ }
2020}
2121
2222dependencies {
23- minecraft " com.mojang:minecraft:${ project.minecraft_version} "
24- mappings " net.fabricmc:yarn:${ project.yarn_mappings} :v2"
25- modImplementation " net.fabricmc:fabric-loader:${ project.loader_version} "
23+ minecraft " com.mojang:minecraft:${ project.minecraft_version} "
24+ mappings " net.fabricmc:yarn:${ project.yarn_mappings} :v2"
25+ modImplementation " net.fabricmc:fabric-loader:${ project.loader_version} "
2626
27- modImplementation " com.terraformersmc:modmenu:${ project.modmenu_version} "
27+ modImplementation " com.terraformersmc:modmenu:${ project.modmenu_version} "
2828}
2929
3030processResources {
31- inputs. property " version" , project. version
32- inputs. property " modmenu_version" , project. modmenu_version
31+ inputs. property " version" , project. version
32+ inputs. property " modmenu_version" , project. modmenu_version
3333
34- filesMatching(" fabric.mod.json" ) {
35- expand project. properties
36- }
34+ filesMatching(" fabric.mod.json" ) {
35+ expand project. properties
36+ }
3737}
3838
3939tasks. withType(JavaCompile ). configureEach {
40- it. options. encoding = " UTF-8"
41- // Minecraft 1.17 (21w19a) upwards uses Java 16.
42- it. options. release = 16
40+ it. options. encoding = " UTF-8"
41+ // Minecraft 1.17 (21w19a) upwards uses Java 16.
42+ it. options. release = 16
4343}
4444
4545java {
46- withSourcesJar()
46+ withSourcesJar()
4747}
4848
4949jar {
50- from(" LICENSE" ) {
51- rename { " ${ it} _${ project.archivesBaseName} " }
52- }
50+ from(" LICENSE" ) {
51+ rename { " ${ it} _${ project.archivesBaseName} " }
52+ }
5353}
5454
55- /*
56- * Copyright 2021 DeathsGun
57- *
58- * Licensed under the Apache License, Version 2.0 (the "License");
59- * you may not use this file except in compliance with the License.
60- * You may obtain a copy of the License at
61- *
62- * http://www.apache.org/licenses/LICENSE-2.0
63- *
64- * Unless required by applicable law or agreed to in writing, software
65- * distributed under the License is distributed on an "AS IS" BASIS,
66- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
67- * See the License for the specific language governing permissions and
68- * limitations under the License.
69- */
55+ import com.modrinth.minotaur.TaskModrinthUpload
56+ import com.modrinth.minotaur.request.VersionType
57+ import com.modrinth.minotaur.request.Dependency
7058
71- // configure the maven publication
72- publishing {
73- publications {
74- mavenJava(MavenPublication ) {
75- artifact(remapJar) {
76- builtBy remapJar
77- }
78- artifact(sourcesJar) {
79- builtBy remapSourcesJar
80- }
81- }
82- }
59+ task publishModrinth (type : TaskModrinthUpload ) {
60+ onlyIf {
61+ System . getenv(" MODRINTH" )
62+ }
8363
84- repositories {
85- mavenLocal()
86- maven {
87- url = " http://vault:8081/repository/maven-snapshots/"
88- allowInsecureProtocol true
89- credentials {
90- username " buildtool"
91- password project. hasProperty(" buildtools_pw" ) ? project. buildtools_pw : " "
92- }
93- }
94- }
64+ token = System . getenv(" MODRINTH" )
65+ projectId = ' 6kq7BzRK'
66+ versionNumber = version
67+ uploadFile = remapJar
68+ versionType = VersionType . ALPHA
69+ addGameVersion(project. minecraft_version)
70+ addLoader(' fabric' )
71+ addDependency(" E4QBMVtO" , Dependency.DependencyType . REQUIRED )
9572}
0 commit comments