forked from DragonsPlusMinecraft/CreateDragonLib
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
115 lines (102 loc) · 3.64 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
plugins {
id "fabric-loom" version "0.12-SNAPSHOT"
id "org.quiltmc.quilt-mappings-on-loom" version "4.2.0"
id 'maven-publish'
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = "create_dragon_lib-fabric-${artifact_minecraft_version}"
version = project.mod_version
group = project.maven_group
repositories {
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu
maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib, Registrate
maven { url = "https://mvn.devos.one/releases/" } // Porting Lib Releases
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM
maven { // Flywheel
url = "https://maven.tterrag.com/"
content {
// need to be specific here due to version overlaps
includeGroup("com.jozufozu.flywheel")
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings(loom.layered {
// it.addLayer(quiltMappings.mappings("org.quiltmc:quilt-mappings:${project.minecraft_version}+build.${project.qm_version}:v2"))
it.parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
it.officialMojangMappings { nameSyntheticMembers = false }
})
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}"
modImplementation "com.simibubi.create:create-fabric-${minecraft_version}:${create_version}"
}
processResources {
// require dependencies to be the version compiled against or newer
Map<String, String> properties = new HashMap<>()
properties.put("version", mod_version)
properties.put("fabric_loader_version", fabric_loader_version)
properties.put("fabric_api_version", fabric_api_version)
properties.put("create_version", create_version)
properties.put("minecraft_version", minecraft_version)
properties.forEach((k, v) -> inputs.property(k, v))
filesMatching("fabric.mod.json") {
expand properties
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = Integer.parseInt(sourceCompatibility)
}
java {
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}
sourceSets {
main {
resources {
srcDirs += [
'src/generated/resources'
]
}
}
}
// configure the maven publication
publishing {
publications {
release(MavenPublication) {
artifactId = archivesBaseName
from components.java
}
snapshot(MavenPublication) {
artifactId = archivesBaseName
version = "SNAPSHOT.${new Date().format('yyyyMMdd')}"
from components.java
}
}
repositories {
maven {
name = "release"
url = "https://maven.dragons.plus/releases"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
maven {
name = "snapshot"
url = "https://maven.dragons.plus/snapshots"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
}