GoogleArchitectureSamples

Форк
0
59 строк · 2.2 Кб
1
/*
2
 * Copyright 2022 The Android Open Source Project
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
5
 *   you may not use this file except in compliance with the License.
6
 *   You may obtain a copy of the License at
7
 *
8
 *       https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
15
 */
16

17
// The init script is used to run Spotless in a gradle configuration cache compliant manner as
18
// Spotless itself is not gradle configuration cache compliant.
19
// Note that the init script needs to be run with the configuration cache turned off.
20

21
val ktlintVersion = "0.44.0"
22

23
initscript {
24
    val spotlessVersion = "6.13.0"
25

26
    repositories {
27
        mavenCentral()
28
    }
29

30
    dependencies {
31
        classpath("com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion")
32
    }
33
}
34

35
rootProject {
36
    subprojects {
37
        apply<com.diffplug.gradle.spotless.SpotlessPlugin>()
38
        extensions.configure<com.diffplug.gradle.spotless.SpotlessExtension> {
39
            kotlin {
40
                target("**/*.kt")
41
                targetExclude("**/build/**/*.kt")
42
                ktlint(ktlintVersion).userData(mapOf("android" to "true"))
43
                licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
44
            }
45
            format("kts") {
46
                target("**/*.kts")
47
                targetExclude("**/build/**/*.kts")
48
                // Look for the first line that doesn't have a block comment (assumed to be the license)
49
                licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
50
            }
51
            format("xml") {
52
                target("**/*.xml")
53
                targetExclude("**/build/**/*.xml")
54
                // Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml)
55
                licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])")
56
            }
57
        }
58
    }
59
}

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

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

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

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