-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathbuild.gradle
More file actions
75 lines (62 loc) · 2.31 KB
/
build.gradle
File metadata and controls
75 lines (62 loc) · 2.31 KB
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
buildscript {
repositories {
mavenLocal()
maven {
name = "Outlands"
url = 'https://maven.outlands.top/releases/'
}
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'top.outlands.gradle:ForgeGradle:6.0.55'
classpath('top.outlands:artifactural:3.0.4') {
transitive = false
}
}
}
plugins {
id "org.jetbrains.gradle.plugin.idea-ext" version "1.3"
//id "com.palantir.git-version" version "4.2.0"
}
apply plugin: 'com.palantir.git-version' // Declared in buildSrc/build.gradle
import com.cleanroommc.gradle.helpers.ProjectConstants
import com.cleanroommc.gradle.helpers.tasks.Util
import com.palantir.gradle.gitversion.VersionDetails
def props = project.properties
def sysProps = System.getProperties()
VersionDetails details = versionDetails()
group = 'com.cleanroommc'
if (project.hasProperty("release")) {
version = details.lastTag
} else if (!project.hasProperty("run_number")) {
version = "${details.lastTag}+build.${details.commitDistance}"
} else {
version = "${details.lastTag}+build.${details.commitDistance}.run.${props.run_number}"
}
def version_txt = new File(project.projectDir, "version.txt")
version_txt.write(version.toString())
println "Setting up Cleanroom $version"
if (project.hasProperty('run_number')) println("On GitHub runs #${props.run_number}")
println "Java: ${ -> sysProps['java.version']} | JVM: ${ -> sysProps['java.vm.version']} | Vendor: ${ -> sysProps['java.vendor']} | Architecture: ${ -> sysProps['os.arch']}"
// Initialize buildSrc
Util.init()
tasks.withType(JavaCompile).configureEach {
options.compilerArgs = options.compilerArgs + ProjectConstants.COMPILER_JVM_ARGUMENTS
options.encoding = 'UTF-8'
}
idea.project.settings.compiler.javac.javacAdditionalOptions = ProjectConstants.COMPILER_JVM_ARGUMENTS.join(' ')
tasks.register('setup') {
group = 'setup'
// These must be strings so that we can do lazy resolution. Else we need evaluationDependsOnChildren above
dependsOn ':minecraft:extractMapped'
dependsOn ':cleanroom:extractMapped'
}
subprojects {
tasks.withType(JavaCompile).tap {
configureEach {
options.compilerArgs += ProjectConstants.COMPILER_JVM_ARGUMENTS
options.encoding = 'UTF-8'
}
}
}