forked from FabricMC/fabric-language-scala
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
65 lines (56 loc) · 1.59 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
plugins {
id 'java-library'
id 'scala'
id 'maven-publish'
id 'fabric-loom' version '1.5-SNAPSHOT'
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = project.archives_base_name
group = project.maven_group
version = mod_version + "+scala." + project.scala_version + (System.getenv('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}"
// Scala Dependencies
implementation "org.scala-lang:scala3-library_3:${project.scala_version}"
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
java {
withSourcesJar()
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
if (System.getenv('MAVEN_URL')) {
maven {
url System.getenv('MAVEN_URL')
credentials {
username System.getenv('MAVEN_USERNAME')
password System.getenv('MAVEN_PASSWORD')
}
}
}
}
}
// 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!")
}
}
}