-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
151 lines (136 loc) · 4.77 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
143
144
145
146
147
148
149
150
151
buildscript {
ext.coroutine_version = "1.8.0"
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"
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:$gradle_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.dagger:hilt-android-gradle-plugin:$dagger_hilt_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigation_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
}
}
plugins {
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"
}"""
]
)
}
}
tasks.register('clean', Delete) {
delete rootProject.buildDir
}