-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
53 lines (47 loc) · 1.58 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
// Copyright (C) 2021 Paul Amonson
//
// SPDX-License-Identifier: Apache-2.0
//
plugins {
id 'idea'
id 'application'
}
repositories {
mavenCentral()
}
String gitVersionString() {
def origin = "main"
if(System.properties.containsKey("OfficialBuild"))
origin = "origin/main"
def stdout = new ByteArrayOutputStream()
def stderr = new ByteArrayOutputStream()
exec {
ignoreExitValue = true
standardOutput = stdout
errorOutput = stderr
commandLine "git", "--git-dir=${rootProject.projectDir}/.git", "describe", origin, "--tags"
}
String localVersion = stdout.toString().trim()
return (localVersion == null || localVersion.isEmpty())?'0.0.0':localVersion
}
dependencies {
implementation group: 'info.picocli', name: 'picocli', version: '4.6.2'
annotationProcessor 'info.picocli:picocli-codegen:4.6.2'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.8'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.1'
}
sourceCompatibility = 17
targetCompatibility = 17
project.version = gitVersionString()
project.mainClassName = 'backups.Backup'
application.mainClass = project.mainClassName
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
manifest {
attributes("Main-Class": project.mainClassName, "Implementation-Title": project.name,
"Implementation-Version": project.version, "Multi-Release": true)
}
}