-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
112 lines (106 loc) · 3.47 KB
/
build.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
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
/*
* Copyright (c) 2021. The Meowool Organization Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* In addition, if you modified the project, you must include the Meowool
* organization URL in your code file: https://github.com/meowool
*
* 如果您修改了此项目,则必须确保源文件中包含 Meowool 组织 URL: https://github.com/meowool
*/
@file:Suppress("SpellCheckingInspection")
val internalMarkers = arrayOf(
"com.meowool.gradle.toolkit.internal.InternalGradleToolkitApi",
"de.fayard.refreshVersions.core.internal.InternalRefreshVersionsApi"
)
apiValidation {
nonPublicMarkers += internalMarkers
ignoredPackages += arrayOf(
"com.meowool.gradle.toolkit.internal",
"com.meowool.gradle.toolkit.android.internal",
"com.meowool.gradle.toolkit.publisher.internal",
"de.fayard.refreshVersions.internal",
"de.fayard.refreshVersions.core.internal",
)
}
subprojects {
optIn(*internalMarkers)
kotlinJvmOptions {
// TODO: Remove when Gradle's embedded Kotlin uses IR
runCatching {
javaClass.getMethod("setUseIR", Boolean::class.java).invoke(this, true)
}
}
configurations.all {
// Check for updates every build
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
}
tasks.withType<Test> { useJUnitPlatform() }
afterEvaluate {
// Don't let the fork of 'refreshVersion' spotless.
if (projectDir.absolutePath.endsWith("dependency/updater")) {
tasks.findByName("spotlessApply")?.enabled = false
tasks.findByName("spotlessKotlin")?.enabled = false
}
}
}
subdependencies {
if (project.path.startsWith(":integration-testing")) return@subdependencies
// All projects depend on the ':core'
if (project.path != Projects.Core) {
apiProject(Projects.Core)
}
apiOf(
gradleKotlinDsl(),
Libs.Kotlin.Stdlib.Common,
Libs.KotlinX.Coroutines.Core,
Libs.Meowool.Toolkit.Sweekt,
)
testImplementationOf(
gradleTestKit(),
Libs.Kotest.Runner.Junit5
)
}
/** Root publish data declaration (all subprojects extends from here) */
publication {
data {
val baseVersion = "0.1.1"
version = "$baseVersion-LOCAL"
// Used to publish non-local versions of artifacts in CI environment
versionInCI = baseVersion + when (System.getenv("release-publications").toBoolean()) {
true -> ""
false -> "-SNAPSHOT"
}
displayName = "Gradle Toolkit"
groupId = "com.meowool.gradle"
description = "Raise the practicality of gradle to a new level."
url = "https://github.com/meowool-toolkit/gradle-toolkit"
vcs = "$url.git"
developer {
id = "rin"
name = "Rin Orz"
url = "https://github.com/RinOrz/"
}
tags(
"kotlin",
"kotlin-dsl",
"gradle-dsl",
"gradle-utils",
"gradle-toolkit",
"dependency",
"dependency-updater",
)
}
// Publish to the `.repo` directory for checkout in CI environment
localDestinations = mutableSetOf(DirectoryDestination(rootDir.resolve(".repo")))
}