-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
100 lines (85 loc) · 2.45 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
plugins {
id "java-library"
id "scala"
id "maven-publish"
id 'fabric-loom' version '0.10.30'
id "com.matthewprenger.cursegradle" version "1.4.0"
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = project.archives_base_name
group = project.maven_group
version = mod_version
def ENV = System.getenv()
version = version + "+scala." + project.scala_version + (ENV.GITHUB_ACTIONS ? "" : ".local")
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
include(api("org.scala-lang:scala3-library_3:${project.scala_version}"))
// Depended on by scala3
include(api("org.scala-lang:scala-library:2.13.6"))
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
java {
withSourcesJar()
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
repositories {
if (ENV.MAVEN_URL) {
maven {
url ENV.MAVEN_URL
credentials {
username ENV.MAVEN_USERNAME
password ENV.MAVEN_PASSWORD
}
}
}
}
}
}
curseforge {
if (ENV.CURSEFORGE_API_KEY) {
apiKey = ENV.CURSEFORGE_API_KEY
}
project {
id = '309275'
changelog = 'A changelog can be found at https://github.com/FabricMC/fabric-language-scala/commits/master'
releaseType = 'release'
addGameVersion '1.17.1'
addGameVersion '1.16.5'
addGameVersion '1.15.2'
addGameVersion '1.14.4'
addGameVersion "Fabric"
mainArtifact(file("${project.buildDir}/libs/${base.archivesBaseName}-${version}.jar")) {
displayName = "Fabric Language Scala $version"
}
}
options {
forgeGradleIntegration = false
}
}
// A task to ensure that the version being released has not already been released.
task checkVersion {
doFirst {
def xml = new URL("https://maven.fabricmc.net/net/fabricmc/fabric-language-scala/maven-metadata.xml").text
def metadata = new XmlSlurper().parseText(xml)
def versions = metadata.versioning.versions.version*.text();
if (versions.contains(version)) {
throw new RuntimeException("${version} has already been released!")
}
}
}
publish.mustRunAfter checkVersion
project.tasks.curseforge.mustRunAfter checkVersion