avito-android

Форк
0
/
settings.gradle.kts 
106 строк · 3.5 Кб
1
rootProject.name = "build-logic-settings"
2

3
pluginManagement {
4
    // See rationale inside this script
5
    apply(from = "dependency-plugin/pluginManagement-shared.settings.gradle.kts")
6
}
7

8
val isInternalBuild = booleanProperty("avito.internalBuild", false)
9

10
if (!isInternalBuild) {
11
    logger.warn(
12
        """
13
        | -----------------------------------------
14
        | WARNING! 
15
        | This build doesn't use `avito.internalBuild`
16
        | 
17
        | For Avito employees only: it makes the build slower and less hermetic.
18
        | For external contributors: some artifacts might be not published yet to Maven Central.
19
        | -----------------------------------------
20
        """.trimMargin()
21
    )
22
}
23

24
val parentBuild = gradle.parent
25

26
/**
27
 * --dry-run on root build executes tasks in a composite build
28
 * Workaround to https://github.com/gradle/gradle/issues/2517
29
 */
30
if (parentBuild != null && parentBuild.startParameter.isDryRun) {
31
    gradle.startParameter.isDryRun = true
32
}
33

34
@Suppress("UnstableApiUsage")
35
dependencyResolutionManagement {
36

37
    @Suppress("UnstableApiUsage")
38
    repositories {
39
        exclusiveContent {
40
            forRepository {
41
                maven {
42
                    if (isInternalBuild) {
43
                        val artifactoryUrl: String by settings
44
                        name = "Proxy for gradle-plugins: https://plugins.gradle.org/m2/"
45
                        setUrl("$artifactoryUrl/gradle-plugins")
46
                        isAllowInsecureProtocol = true
47
                    } else {
48
                        name = "gradle-plugins"
49
                        setUrl("https://plugins.gradle.org/m2/")
50
                    }
51
                }
52
            }
53
            filter {
54
                includeGroupByRegex("com\\.gradle.*")
55
                includeGroupByRegex("org\\.jetbrains.*")
56
            }
57
        }
58
        exclusiveContent {
59
            forRepository {
60
                maven {
61
                    if (isInternalBuild) {
62
                        val artifactoryUrl: String by settings
63
                        name = "Proxy for gradle-plugins: https://repo1.maven.org/maven2"
64
                        setUrl("$artifactoryUrl/mavenCentral")
65
                        isAllowInsecureProtocol = true
66
                    } else {
67
                        name = "mavenCentral"
68
                        setUrl("https://repo1.maven.org/maven2")
69
                    }
70
                }
71
            }
72
            filter {
73
                includeGroup("net.java.dev.jna")
74
            }
75
        }
76
    }
77
}
78

79
// HACK:
80
// We apply here the same settings as we provide by convention-cache plugin.
81
// Conventional way is to inherit build cache configuration from the root project into all included builds.
82
// The problem is - it doesn't work for included builds inside `pluginManagement`.
83
// They applied before the cache configuration in the root project itself.
84
// https://docs.gradle.org/current/userguide/build_cache.html#sec:build_cache_composite
85
apply(from = "cache-plugin/convention-cache.settings.gradle.kts")
86

87
include("dependency-plugin")
88
include("scan-plugin")
89
include("extensions")
90

91
fun Settings.booleanProperty(name: String, defaultValue: Boolean): Boolean {
92
    return if (extra.has(name)) {
93
        extra[name]?.toString()?.toBoolean() ?: defaultValue
94
    } else {
95
        defaultValue
96
    }
97
}
98

99
fun Settings.stringProperty(name: String, nullIfBlank: Boolean = false): String? {
100
    return if (extra.has(name)) {
101
        val string = extra[name]?.toString()
102
        if (nullIfBlank && string.isNullOrBlank()) null else string
103
    } else {
104
        null
105
    }
106
}
107

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.