@@ -3,88 +3,83 @@ plugins {
33 id ' maven-publish'
44}
55
6- version = project. mod_version
76group = project. maven_group
8-
9- base {
10- archivesName = project. archives_base_name
11- }
7+ version = project. mod_version
8+ base. archivesName = project. archives_base_name
129
1310repositories {
14- // Add repositories to retrieve artifacts from in here.
15- // You should only use this when depending on other mods because
16- // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
17- // See https://docs.gradle.org/current/userguide/declaring_repositories.html
18- // for more information about repositories.
11+ mavenCentral()
12+ maven { url = ' https://maven.fabricmc.net/' }
1913}
2014
2115loom {
2216 splitEnvironmentSourceSets()
2317
2418 mods {
25- " manifold" {
19+ manifold {
2620 sourceSet sourceSets. main
2721 sourceSet sourceSets. client
2822 }
2923 }
24+ }
3025
26+ sourceSets {
27+ main {
28+ java. srcDirs = [' src/main/java' , ' src/api/java' ]
29+ resources. srcDirs = [' src/main/resources' ]
30+ }
31+ client {
32+ java. srcDirs = [' src/client/java' ]
33+ resources. srcDirs = [' src/client/resources' ]
34+ compileClasspath + = main. output
35+ runtimeClasspath + = main. output
36+ }
3137}
3238
3339dependencies {
34- // To change the versions see the gradle.properties file
35- minecraft " com.mojang:minecraft:${ project.minecraft_version} "
40+ minecraft " com.mojang:minecraft:${ minecraft_version} "
3641 mappings loom. officialMojangMappings()
37- modImplementation " net.fabricmc:fabric-loader:${ project.loader_version} "
38-
39- // Fabric API. This is technically optional, but you probably want it anyway.
40- modImplementation " net.fabricmc.fabric-api:fabric-api:${ project.fabric_version} "
41-
42+ modImplementation " net.fabricmc:fabric-loader:${ loader_version} "
43+ modImplementation " net.fabricmc.fabric-api:fabric-api:${ fabric_version} "
4244}
4345
4446processResources {
4547 inputs. property " version" , project. version
46-
4748 filesMatching(" fabric.mod.json" ) {
48- expand " version" : inputs . properties . version
49+ expand version : project . version
4950 }
5051}
5152
52- tasks. withType(JavaCompile ). configureEach {
53- it. options. release = 21
54- }
55-
5653java {
57- // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
58- // if it is present.
59- // If you remove this line, sources will not be generated.
6054 withSourcesJar()
61-
6255 sourceCompatibility = JavaVersion . VERSION_21
6356 targetCompatibility = JavaVersion . VERSION_21
6457}
6558
66- jar {
67- inputs. property " archivesName" , project. base. archivesName
59+ tasks. withType(JavaCompile ). configureEach {
60+ it. options. release = 21
61+ }
6862
63+ jar {
6964 from(" LICENSE" ) {
70- rename { " ${ it} _${ inputs.properties. archivesName} " }
65+ rename { " ${ it} _${ base. archivesName} " }
7166 }
7267}
7368
74- // configure the maven publication
7569publishing {
7670 publications {
77- create(" mavenJava" , MavenPublication ) {
78- artifactId = project. archives_base_name
71+ mavenJava(MavenPublication ) {
7972 from components. java
8073 }
8174 }
82-
83- // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
8475 repositories {
85- // Add repositories to publish to here.
86- // Notice: This block does NOT have the same function as the block in the top level.
87- // The repositories here will be used for publishing your artifact, not for
88- // retrieving dependencies.
76+ maven {
77+ name = " GitHubPackages"
78+ url = uri(" https://maven.pkg.github.com/maxryan008/ManifoldAPI" ) // todo make this a modrinth maven instead for other mods to utilise
79+ credentials {
80+ username = project. findProperty(" gpr.user" ) ?: " "
81+ password = project. findProperty(" gpr.key" ) ?: " "
82+ }
83+ }
8984 }
9085}
0 commit comments