-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
142 lines (129 loc) · 4.69 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.dagger_hilt_version = "2.51.1"
ext.gradle_version = '8.6.1'
ext.kotlin_version = "1.9.23"
ext.navigation_version = "2.8.1"
ext.dokka_version = "1.9.20"
ext.customFooterMessage = "© 2024 made with ❤️ by Nevis"
ext.customLogoFile = projectDir.toString() + "/logo-style.css"
dependencies {
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
}
}
plugins {
id 'androidx.navigation.safeargs' version "${navigation_version}" apply false
id 'com.android.application' version "${gradle_version}" apply false
id 'com.google.dagger.hilt.android' version "${dagger_hilt_version}" apply false
id 'org.jetbrains.kotlin.android' version "${kotlin_version}" apply false
id 'org.jetbrains.dokka' version "${dokka_version}" apply true
}
ext.getConfig = { String name ->
File localPropertiesFile = project.rootProject.file('local.properties')
if (localPropertiesFile?.exists()) {
Properties localProperties = new Properties()
localProperties.load(localPropertiesFile.newDataInputStream())
if (localProperties.containsKey(name)) {
return localProperties.getProperty(name)
}
}
def env = System.getenv(name)
if (env != null) {
return env
}
def prop = System.getProperty(name)
if (prop != null) {
return prop
}
if (project.hasProperty(name)) {
return project.getProperty(name)
}
println("Getting env variable failed, returning empty: set $name as environment variable or as system property in your ~/.gradle/gradle.properties")
return ""
}
allprojects {
repositories {
mavenLocal()
maven {
url "https://maven.pkg.github.com/nevissecurity/nevis-mobile-authentication-sdk-android-package"
credentials {
username = getConfig("GH_USERNAME")
password = getConfig("GH_PERSONAL_ACCESS_TOKEN")
}
}
google {
content {
excludeGroupByRegex "ch\\.nevis\\..*"
}
}
mavenCentral {
content {
excludeGroupByRegex "ch\\.nevis\\..*"
}
}
}
}
subprojects {
apply plugin: "org.jetbrains.dokka"
tasks.named("dokkaHtml") {
moduleName.set("$rootProject.name-$project.name")
outputDirectory.set(file("build/dokka/$project.name"))
failOnWarning.set(false)
suppressInheritedMembers.set(true)
suppressObviousFunctions.set(true)
dokkaSourceSets {
configureEach {
reportUndocumented.set(true)
includes.from("module.md")
externalDocumentationLink {
url.set(new URL("https://docs.nevis.net/mobilesdk/${getConfig("VERSION_NAME")}/api-references/javadoc/"))
packageListUrl.set(new URL("https://docs.nevis.net/mobilesdk/${getConfig("VERSION_NAME")}/api-references/javadoc/element-list"))
}
}
}
pluginsMapConfiguration.set(
[
"org.jetbrains.dokka.base.DokkaBase": """{
"customStyleSheets": ["$customLogoFile"],
"footerMessage": "$customFooterMessage"
}"""
]
)
}
tasks.named("dokkaHtmlPartial") {
moduleName.set("$rootProject.name-$project.name")
failOnWarning.set(false)
suppressInheritedMembers.set(true)
suppressObviousFunctions.set(true)
dokkaSourceSets {
configureEach {
reportUndocumented.set(true)
includes.from("module.md")
externalDocumentationLink {
url.set(new URL("https://docs.nevis.net/mobilesdk/${getConfig("VERSION_NAME")}/api-references/javadoc/"))
packageListUrl.set(new URL("https://docs.nevis.net/mobilesdk/${getConfig("VERSION_NAME")}/api-references/javadoc/element-list"))
}
}
}
pluginsMapConfiguration.set(
[
"org.jetbrains.dokka.base.DokkaBase": """{
"customStyleSheets": ["$customLogoFile"],
"footerMessage": "$customFooterMessage"
}"""
]
)
}
}
afterEvaluate {
tasks.named("dokkaHtmlMultiModule") {
pluginsMapConfiguration.set(
[
"org.jetbrains.dokka.base.DokkaBase": """{
"customStyleSheets": ["$customLogoFile"],
"footerMessage": "$customFooterMessage"
}"""
]
)
}
}