forked from Up-Mods/LibZoomer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
128 lines (110 loc) · 3.25 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'io.github.juuxel.loom-quiltflower' version '1.8.0'
id 'maven-publish'
id 'signing'
}
// Visual Studio Code completely ignores options.release.
// So, we still have those two.
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
version = System.env.GITHUB_ACTIONS == "true"
? "${project.mod_version}.github.${System.env.GITHUB_RUN_NUMBER}"
: project.mod_version
group = project.maven_group
sourceSets {
testmod {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
}
repositories {
maven {
url = "https://maven.quiltmc.org/repository/release"
name = "QuiltMC"
}
}
dependencies {
// To change the versions, see the gradle.properties file
minecraft libs.minecraft
mappings variantOf(libs.quilt.mappings) { classifier 'intermediary-v2' }
modImplementation libs.fabric.loader
modCompileOnly libs.fabric.api
modLocalRuntime libs.fabric.api
afterEvaluate {
testmodImplementation sourceSets.main.output
}
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
// Ensure that the encoding is set to UTF-8, no matter what the system default is.
// This fixes some edge cases with special characters not displaying correctly.
// See http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withJavadocJar()
withSourcesJar()
}
jar {
from "LICENSE"
}
// Configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'LibZoomer'
description = 'A library that allows other Minecraft mods to have powerful zooming easily. (internal fork)'
url = 'https://github.com/Parzivail-Modding-Team/LibZoomer'
licenses {
license {
name = 'The MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'EnnuiL'
name = 'Ennui Langeweile'
}
}
scm {
connection = 'scm:git:https://github.com/Parzivail-Modding-Team/LibZoomer.git'
developerConnection = 'scm:git:[email protected]:Parzivail-Modding-Team/LibZoomer.git'
url = 'https://github.com/Parzivail-Modding-Team/LibZoomer'
}
}
}
}
// Select the repositories you want to publish to
// To publish to maven local, no extra repositories are necessary. Just use the task `publishToMavenLocal`.
repositories {
maven {
name = "central"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
if (project.hasProperty("ossrhUsername") && project.hasProperty("ossrhPassword"))
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}