Add Gradle task to add scopes to IntelliJ
This commit is contained in:
@@ -299,4 +299,29 @@ if (properties["openrndr.tasks"] == "true") {
|
|||||||
group = " \uD83E\uDD8C OPENRNDR"
|
group = " \uD83E\uDD8C OPENRNDR"
|
||||||
dependsOn("jpackageZip")
|
dependsOn("jpackageZip")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task("add IDE file scopes") {
|
||||||
|
group = " \uD83E\uDD8C 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",
|
||||||
|
"Images" to "file:*.png||file:*.jpg||file:*.dds||file:*.exr"
|
||||||
|
)
|
||||||
|
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()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user