-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
80 lines (61 loc) · 1.88 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
plugins {
id 'java-library'
id 'maven-publish'
id 'net.freudasoft.gradle-cmake-plugin' version '0.0.4'
id 'de.fuerstenau.buildconfig' version '1.1.8'
id 'com.palantir.git-version' version '0.12.2'
}
group = 'de.hhu.bsinfo'
version = '0.1.1' + (Boolean.valueOf(System.getProperty('release')) ? '' : '-SNAPSHOT')
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
compileJava {
sourceCompatibility = '8'
targetCompatibility = '8'
options.encoding = 'UTF-8'
}
task sourceJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
}
javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
}
cmake {
// TODO: Setting 'buildConfig' is unnecessary for detectorJNI, but a bug in the cmake plugin
// prevents the project from building, if this variable is not set. Once this bug is fixed,
// the line can be deleted.
sourceFolder = file(project.projectDir.toString())
buildClean = true
}
artifacts {
archives sourceJar
archives javadocJar
}
wrapper {
gradleVersion = "7.2"
}
buildConfig {
def gitVersion = versionDetails()
appName = project.name
version = project.version
clsName = 'BuildConfig'
packageName = 'de.hhu.bsinfo.jdetector.generated'
charset = 'UTF-8'
buildConfigField 'String', 'BUILD_DATE', new Date().format('yyyy-MM-dd HH:mm:ss')
buildConfigField 'String', 'GIT_COMMIT', gitVersion.gitHash
buildConfigField 'String', 'GIT_BRANCH', gitVersion.branchName
}
// Workaround for 'Configuration <compile> not found', caused by de.fuerstenau.buildconfig with Gradle 7+
configurations {
create("compile")
}
apply from: 'publish.gradle'