-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
73 lines (58 loc) · 1.83 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
import java.nio.file.Paths
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
buildscript {
ext {
kotlin_version = "2.0.20"
kotlinx_coroutines_version = "1.8.1"
classgraph_version = "4.8.108"
imgui_version = "1.87.6"
gson_version = "2.8.9"
lwjgl_version = "3.3.2"
slf4j_version = "2.0.16"
log4j_version = "2.24.0"
logback_classic_version = "1.5.8"
Penv = findProperty('env')
if(Penv != null && (Penv != 'dev' && Penv != 'release')) {
throw new GradleException("Invalid env property, must be 'dev' or 'release'")
}
env = Penv == 'release' ? 'release' : 'dev'
println("Current build is: $env")
}
repositories {
mavenCentral()
google()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.30.0'
}
}
allprojects {
group 'org.deltacv.PaperVision'
version '1.0.3'
ext {
standardVersion = version
}
repositories {
mavenCentral()
google()
maven { url "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
maven { url 'https://jitpack.io' }
}
if(env == 'dev') {
String date = DateTimeFormatter.ofPattern(
"yyMMdd-HHmm"
).format(LocalDateTime.now())
String hash = findProperty('hash')
version += "-dev-${hash ?: date}"
println("Final version of ${project} is $version")
File libsFolder = Paths.get(
projectDir.absolutePath, 'build', 'libs'
).toFile()
for(file in libsFolder.listFiles()) {
if(file.name.contains("dev") && file.name.endsWith(".jar"))
file.delete()
}
}
}