-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
83 lines (67 loc) · 1.95 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
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id "io.freefair.lombok" version "6.0.0-m2"
id 'maven-publish'
}
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_16
def getVersionFromJava() {
def ver = 0.0, patch = 0
def versionClass = file("src/main/java/me/deftware/client/framework/FrameworkConstants.java").text
(versionClass =~ ~/double\s+([_a-zA-Z\u0024][_a-zA-Z0-9\u0024]*)\s+=\s+(([0-9]+)\.([0-9]+))/).each {
ver = it[2]
}
(versionClass =~ ~/int\s+([_a-zA-Z$][_a-zA-Z0-9$]*)\s+=\s+([0-9]+)/).each {
if (it[1].toString() == "PATCH") {
patch = it[2]
}
}
return "${ver}.${patch}".toString()
}
version = getVersionFromJava()
repositories {
maven { url 'https://jitpack.io' }
maven { url = 'https://gitlab.com/EMC-Framework/maven/raw/master/' }
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraftVersion}"
mappings "net.fabricmc:yarn:${project.minecraftVersion}${project.mappingsVer}:v2"
modImplementation "net.fabricmc:fabric-loader:0.11.7"
modImplementation 'com.github.Chocohead:Fabric-ASM:v2.3'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation files("deps/mocked.jar")
include 'com.github.Chocohead:Fabric-ASM:v2.3'
}
loom {
mixin {
useLegacyMixinAp = true
defaultRefmapName = 'mixins.emc.refmap.json'
}
}
def artifactVersion = project.hasProperty("av") ? project.property("av").toString() : project.minecraftVersion
publishing {
publications {
emc(MavenPublication) {
groupId 'me.deftware'
artifactId "EMC-F-v2"
version "${version}-${artifactVersion}"
from components['java']
}
}
repositories {
maven {
url "$rootDir/maven/"
}
}
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
task generateApiDocumentation(type: Javadoc) {
source = ['src/main/java/me/deftware/client']
title = "EMC Framework Documentation"
destinationDir = file("docs")
failOnError false
}