-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
101 lines (85 loc) · 2.65 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
import dex.plugins.outlet.v2.util.ReleaseType
plugins {
id 'fabric-loom' version '1.9-SNAPSHOT' apply false
id 'io.github.dexman545.outlet' version '1.6.1' apply false
id 'com.modrinth.minotaur' version '2.+' apply false
id 'maven-publish'
}
ext {
debugVersion = System.currentTimeMillis()
}
allprojects {
group = "top.offsetmonkey538.meshlib"
}
subprojects {
apply plugin: "maven-publish"
apply plugin: "java"
apply plugin: "java-library"
archivesBaseName = "mesh-lib-${project.nameSuffix}"
version = "${rootProject.mod_version}+${rootProject.minecraft_version}"
tasks.named("javadoc", Javadoc) {
options.addFileOption('-add-stylesheet', rootProject.file("javadoc-stylesheet.css"))
}
java {
withSourcesJar()
withJavadocJar()
}
jar {
from("${rootProject.projectDir}/LICENSE") {
rename { "${it}" }
}
}
dependencies {
compileOnly "org.jetbrains:annotations:24.0.0"
compileOnly "org.slf4j:slf4j-api:2.0.16"
}
publishing {
repositories {
maven {
name = "OffsetMonkey538"
url = "https://maven.offsetmonkey538.top/releases"
credentials {
username = providers.gradleProperty("OffsetMonkey538Username").getOrElse(System.getenv("MAVEN_USERNAME"))
password = providers.gradleProperty("OffsetMonkey538Password").getOrElse(System.getenv("MAVEN_PASSWORD"))
}
authentication {
basic(BasicAuthentication)
}
}
}
publications {
maven(MavenPublication) {
artifactId = project.archivesBaseName
from(components["java"])
}
}
}
tasks.publishMavenPublicationToMavenLocal.doLast {
if (System.getenv("IS_DEBUG") == "true") System.out.println("Version: " + version)
}
}
configure(subprojects.findAll { it.name != "common" }) {
apply plugin: 'com.modrinth.minotaur'
apply plugin: 'io.github.dexman545.outlet'
if (System.getenv("IS_DEBUG") == "true") version = "${version}-${rootProject.debugVersion}"
outlet {
mcVersionRange = rootProject.supported_minecraft_versions
allowedReleaseTypes = Set.of(ReleaseType.RELEASE)
}
modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "mesh-lib"
def customVersionName = System.getenv("VERSION_NAME")
if (customVersionName != null) versionName = customVersionName
versionNumber = "${project.version}"
versionType = "alpha"
def isPreRelease = System.getenv("VERSION_IS_PRERELEASE")
versionType = !"false".equals(isPreRelease) ? "beta" : "release"
additionalFiles = [sourcesJar.archiveFile]
gameVersions = outlet.mcVersions()
syncBodyFrom = rootProject.file("README.md").text
def changelogEnv = System.getenv("VERSION_CHANGELOG")
if (changelogEnv != null) changelog = changelogEnv
}
tasks.modrinth.dependsOn(tasks.modrinthSyncBody)
}