generated from JamCoreModding/multi-loader-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.easytemplate
105 lines (89 loc) · 2.72 KB
/
build.gradle.easytemplate
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
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
{{#if unified_publishing}}
id "me.shedaniel.unified-publishing" version "0.1.+" apply false
{{/if}}
{{#if github_publish}}
id "com.github.breadmoirai.github-release" version "2.4.1"
{{/if}}
}
{{#if github_publish}}
if (System.getenv("GITHUB_TOKEN") != null) {
githubRelease {
token(System.getenv("GITHUB_TOKEN"))
owner("{{ github_owner }}")
repo("{{ github_repo }}")
tagName("${project.version}")
releaseName("V${project.version}")
body(project.rootProject.file("CHANGELOG.md").text)
draft(false)
if (project.branch != null) {
targetCommitish(project.branch)
}
}
}
{{/if}}
subprojects {
apply plugin: "dev.architectury.loom"
loom {
silentMojangMappingsLicense()
}
jar {
manifest {
attributes([
'Specification-Title' : mod_name,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Built-On-Minecraft' : minecraft_version,
'JamLib-File-Name' : "{{mod_id}}-${project.base.archivesName.get()}-${rootProject.version}.jar",
])
}
}
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.officialMojangMappings()
}
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
version = rootProject.version
group = rootProject.group
repositories {
mavenCentral()
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
maven {
name = "Jamalam's Maven"
url = "https://maven.jamalam.tech/releases"
}
}
base {
archivesName = "{{mod_id}}"
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 21
}
tasks.create("prepareWorkspace") {}
java {
withSourcesJar()
}
{{#ifCond github_publish '||' unified_publishing}}
tasks.publish {
{{#if github_publish}}
dependsOn(":githubRelease")
{{/if}}
{{#if unified_publishing}}
dependsOn("fabric:publishUnified")
dependsOn("neoforge:publishUnified")
{{/if}}
}
{{/ifCond}}
}