-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle
97 lines (75 loc) · 2.55 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
import java.nio.file.Paths
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
buildscript {
ext {
kotlin_version = "1.9.0"
kotlinx_coroutines_version = "1.5.0-native-mt"
slf4j_version = "2.0.16"
log4j_version = "2.24.1"
opencv_version = "4.7.0-0"
apriltag_plugin_version = "2.1.0-C"
skiko_version = "0.8.15"
classgraph_version = "4.8.112"
opencsv_version = "5.5.2"
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()
gradlePluginPortal()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'gradle.plugin.com.github.johnrengelman:shadow:7.1.1'
classpath 'io.github.fvarrui:javapackager:1.7.6'
}
}
plugins {
id 'java'
}
allprojects {
group 'com.github.deltacv'
version '3.8.1'
apply plugin: 'java'
configurations {
// do not pull in EOCV-Sim's Common module from a repository, it's already in the project
runtime.exclude group: "com.github.deltacv.EOCV-Sim", module: "Common"
}
ext {
standardVersion = version
}
repositories {
mavenCentral()
mavenLocal()
google()
maven { url "https://jitpack.io" }
maven { url 'https://maven.openimaj.org/' }
maven { url 'https://maven.ecs.soton.ac.uk/content/repositories/thirdparty/' }
maven { url "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
}
tasks.withType(Jar) {
manifest {
attributes['Main-Class'] = 'com.github.serivesmejia.eocvsim.Main'
}
}
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()
}
}
}