forked from leibnitz27/cfr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
60 lines (50 loc) · 1.21 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
plugins {
id 'java'
id 'maven-publish'
id "dev.fastmc.maven-repo" version "1.0.0"
}
version = '0.3-SNAPSHOT'
group = 'net.fabricmc'
archivesBaseName = 'cfr'
sourceSets {
main {
java.srcDirs = ['src', 'src-templates']
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
withSourcesJar()
}
repositories {
mavenCentral()
}
dependencies {
implementation 'it.unimi.dsi:fastutil:8.5.11'
}
jar {
manifest {
attributes 'Main-Class': 'org.benf.cfr.reader.Main'
attributes 'Implementation-Version': archiveVersion
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
// 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/cfr/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