-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
109 lines (95 loc) · 3.09 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
98
99
100
101
102
103
104
105
106
107
108
// BunyipsLib Gradle configuration
import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.gradle.DokkaTask
plugins {
id 'com.android.library' apply false
id 'org.jetbrains.dokka'
}
// Kotlin-as-Java exposes Kotlin public fields strangely and makes it misleading
// so we'll choose not to use this plugin although it would be preferred. Better to keep things
// accurate and consistent.
//dependencies {
// dokkaHtmlPlugin 'org.jetbrains.dokka:kotlin-as-java-plugin:1.9.20'
//}
def getCommit = { boolean suppressDirty = false ->
try {
def stdout = new ByteArrayOutputStream()
exec {
if (suppressDirty) {
commandLine 'git', 'describe', '--always'
} else {
commandLine 'git', 'describe', '--always', '--dirty'
}
standardOutput = stdout
}
return stdout.toString().trim()
}
catch (ignored) {
return null
}
}
def getBuildTime = { ->
return new Date().format("yyyy-MM-dd@HH:mm:ss", TimeZone.getDefault())
}
def getRandomID = { ->
return UUID.randomUUID().toString()
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../build.dependencies.gradle"
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
testImplementation 'junit:junit:4.13.1'
}
android {
buildFeatures {
buildConfig = true
}
compileSdkVersion 34
defaultConfig {
minSdkVersion 24
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 28
buildConfigField "String", "GIT_COMMIT", '"' + getCommit() + '"'
buildConfigField "String", "BUILD_TIME", '"' + getBuildTime() + '"'
buildConfigField "String", "ID", '"' + getRandomID() + '"'
buildConfigField "String", "SEMVER", '"' + project.version + '"'
buildConfigField "String", "SDK_VER", '"' + project.sdk_version + '"'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
testOptions {
unitTests.all {
useJUnitPlatform()
}
}
namespace = 'au.edu.sa.mbhs.studentrobotics.bunyipslib'
}
tasks.dokkaHtml.configure {
outputDirectory.set(file("./docs"))
moduleVersion.set("v" + project.version + "-master-" + getCommit(true))
dokkaSourceSets {
configureEach {
displayName.set("BunyipsLib")
jdkVersion.set(8)
documentedVisibilities.set(
[
DokkaConfiguration.Visibility.PUBLIC,
DokkaConfiguration.Visibility.PROTECTED,
]
)
}
}
}
tasks.withType(DokkaTask.class).configureEach {
String dokkaBaseConfiguration = """
{
"customAssets": ["${file("docs/custom/logo-icon.svg")}"],
"separateInheritedMembers": true,
"footerMessage": "© 2024 Lucas Bubner, Murray Bridge High School Student Robotics Club"
}
"""
pluginsMapConfiguration.set(["org.jetbrains.dokka.base.DokkaBase": dokkaBaseConfiguration])
}