This repository has been archived by the owner on Dec 18, 2022. It is now read-only.
forked from thaliproject/Tor_Onion_Proxy_Library
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
86 lines (72 loc) · 2.65 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
buildscript {
apply from: "$rootDir/gradle/dependencies.gradle"
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath plugin.androidGradle
classpath plugin.kotlin.dokka
classpath plugin.kotlin.gradle
classpath plugin.mavenPublish
classpath plugin.gradleVersions
}
}
allprojects {
repositories {
google()
jcenter()
// maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
tasks.withType(Test) {
maxHeapSize = "4096m"
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
////////////////////////////////////////////////////////////////////////////
/// Gradle Versions: https://github.com/ben-manes/gradle-versions-plugin ///
////////////////////////////////////////////////////////////////////////////
apply plugin: 'com.github.ben-manes.versions'
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
checkForGradleUpdate = true
// Example 1: reject all non stable versions
rejectVersionIf {
isNonStable(candidate.version)
}
// Example 2: disallow release candidates as upgradable versions from stable versions
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
// Example 3: using the full syntax
resolutionStrategy {
componentSelection {
all {
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
reject('Release candidate')
}
}
}
}
}
//////////////////////////////////////////////
/// Dokka: https://github.com/Kotlin/dokka ///
//////////////////////////////////////////////
apply plugin: 'org.jetbrains.dokka'
// Dokka's configuration.externalDocumentationLink.url setting for connecting methods/variables
// in each module is quarky, especially when relying on Mkdocs to generate a website using the
// Markdown files that are created. the `externalDocumentationLink.url` setting requires a
// protocol (http, https, etc.) such that we cannot just input what we want (../../../module-name)
// and are required to go back over all files within the `docs` directory, search for our string
// constant, and replace it with what we want after Dokka Docs are all generated.
task fixDokkaDocLinks(type: Exec) {
workingDir "$rootDir"
commandLine "scripts/fix_dokka_doc_external_links.sh"
}