This repository was archived by the owner on Oct 4, 2024. It is now read-only.
generated from GregTech-Intergalactical/ExampleMod
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
69 lines (62 loc) · 2.15 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
plugins {
id "maven-publish"
id "idea"
}
//Print out JVM information so that we know what version is running. Extreamly useful for people to know when helping you.
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
def isCI = System.getenv("GITHUB_ACTION")
def isRELEASE = System.getenv("GITHUB_RELEASE")
static def gitHash() {
String hash = System.getenv("GITHUB_SHA")
if (hash != null) return hash.substring(0,8)
return ""
}
subprojects {
apply plugin: "maven-publish"
apply plugin: "java"
apply plugin: "idea"
group = rootProject.maven_group
version = "${project.mod_version}-${rootProject.minecraft_version}"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
apply from: 'https://raw.githubusercontent.com/GregTech-Intergalactical/GradleSripts/main/repositories.gradle'
java {
withSourcesJar()
}
if (isCI) {
if (!isRELEASE){
version = version + "-" + gitHash()
println("Not in CI Release mode")
}
println("In CI mode")
}
publishing {
publications {
mavenJava(org.gradle.api.publish.maven.MavenPublication) {
artifactId = "gtcore-" + project.name
from components.java
/*artifact(sourcesJar) {
builtBy remapSourcesJar
}
afterEvaluate {
artifact remapJar
if (project.name != "common"){
artifact shadowJar
}
}*/
}
}
repositories {
if (isCI && isRELEASE) {
maven {
url = "https://repo.repsy.io/mvn/trinsdar/gregtech-intergalactical/"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
} else {
mavenLocal()
}
}
}
}