-
Notifications
You must be signed in to change notification settings - Fork 162
/
settings.gradle.kts
72 lines (58 loc) · 1.77 KB
/
settings.gradle.kts
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
import java.util.Properties
pluginManagement {
includeBuild("./plugin")
plugins {
id("org.jetbrains.kotlin.jvm") version "1.8.22"
id("org.jetbrains.kotlin.js") version "1.8.22"
id("com.android.application") version "4.2.2"
}
repositories {
gradlePluginPortal()
google()
maven("https://dl.bintray.com/jetbrains/kotlin-native-dependencies")
}
}
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
dependencyResolutionManagement {
versionCatalogs {
create("pluginLibs") {
from(files("plugin/gradle/libs.versions.toml"))
}
}
}
plugins {
`gradle-enterprise`
}
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
publishAlways()
}
}
rootProject.name = "ktlint-gradle-samples"
fun isAndroidSdkInLocalPropertiesSet(): Boolean {
val propertiesFile = file("local.properties")
if (propertiesFile.exists()) {
val properties = Properties()
properties.load(propertiesFile.inputStream())
return properties.containsKey("sdk.dir")
}
return false
}
fun isAndroidSdkVariableSet(): Boolean = System.getenv().containsKey("ANDROID_HOME")
fun isAndroidSdkAvailable(): Boolean = isAndroidSdkVariableSet() || isAndroidSdkInLocalPropertiesSet()
include("samples:kotlin-ks")
include("samples:kotlin-gradle")
if (isAndroidSdkAvailable()) {
include("samples:android-app")
}
include("samples:kotlin-js")
include("samples:kotlin-rulesets-creating")
include("samples:kotlin-rulesets-using")
include("samples:kotlin-reporter-creating")
include("samples:kotlin-reporter-using")
include("samples:kotlin-mpp")
if (isAndroidSdkAvailable()) {
include("samples:kotlin-mpp-android")
}