-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild.gradle.kts
85 lines (73 loc) · 2.43 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
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
org.openrndr.guide.convention.`kotlin-jvm`
alias(libs.plugins.git.publish)
alias(libs.plugins.dokgen)
alias(libs.plugins.versions)
}
version = "1.0-SNAPSHOT"
dependencies {
implementation(libs.jsoup)
implementation(libs.gson)
implementation(libs.csv)
implementation(libs.kotlinx.coroutines)
implementation(libs.bundles.openrndr.core)
implementation(libs.bundles.openrndr.rest)
implementation(libs.bundles.orx)
implementation(libs.dokgen) {
// Otherwise includes Gradle's slf4j implementation
isTransitive = false
}
runtimeOnly(libs.slf4j.simple)
}
tasks {
dependencyUpdates {
gradleReleaseChannel = "current"
val nonStableKeywords = listOf("alpha", "beta", "rc")
fun isNonStable(
version: String
) = nonStableKeywords.any {
version.lowercase().contains(it)
}
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}
}
dokgen {
runner {
if (System.getProperty("os.name") == "Mac OS X") {
jvmArgs = mutableListOf("-XstartOnFirstThread")
}
}
examples {
webRootUrl = "https://github.com/openrndr/openrndr-examples/blob/master/src/main/kotlin"
}
jekyll {
media = listOf(file("$projectDir/media"), file("$projectDir/static-media"))
assets = listOf(file("$projectDir/data/jekyll-assets"))
}
}
task("add IDE file scopes") {
group = " ★ OPENRNDR"
val scopesFolder = File("${project.projectDir}/.idea/scopes")
scopesFolder.mkdirs()
val files = listOf(
"Code" to "file:*.kt||file:*.frag||file:*.vert||file:*.glsl",
"Text" to "file:*.txt||file:*.md||file:*.xml||file:*.json",
"Gradle" to "file[*buildSrc*]:*/||file:*gradle.*||file:*.gradle||file:*/gradle-wrapper.properties||file:*.toml",
"Media" to "file:*.png||file:*.jpg||file:*.dds||file:*.exr||file:*.mp3||file:*.wav||file:*.mp4||file:*.mov||file:*.svg"
)
files.forEach { (name, pattern) ->
val file = File(scopesFolder, "__$name.xml")
if (!file.exists()) {
file.writeText(
"""
<component name="DependencyValidationManager">
<scope name=" ★ $name" pattern="$pattern" />
</component>
""".trimIndent()
)
}
}
}