forked from GTNewHorizons/StructureLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
54 lines (48 loc) · 1.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
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 isJENKINS = System.getenv("CI")
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) {
version = version + "-" + gitHash()
println("In CI mode")
}
publishing {
publications {
mavenJava(org.gradle.api.publish.maven.MavenPublication) {
if (project.name != "forge"){
artifactId = "structurelib-" + project.name
from components.java
}
}
}
repositories {
if (isJENKINS) {
maven {
url System.getenv("local_maven_url")
}
} else {
maven { url "file:///${project.projectDir}/mcmodsrepo"}
}
}
}
}