Processing Website examples

The Processing Website has more meta-data related to the examples. I'd like to use that meta-data going forward so I've added it
This commit is contained in:
Stef Tervelde
2024-12-18 13:09:28 +01:00
parent 529a0e09bc
commit 7fb8b2f16a
3 changed files with 22 additions and 160 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
<ExternalSystemSettings>
<option name="env">
<map>
<entry key="ORG_GRADLE_PROJECT_version" value="Local" />
<entry key="ORG_GRADLE_PROJECT_version" value="Development Build" />
</map>
</option>
<option name="executionName" />
+21 -1
View File
@@ -162,12 +162,32 @@ tasks.register<Copy>("unzipExamples") {
val dl = tasks.findByPath("downloadProcessingExamples") as Download
dependsOn(dl)
from(zipTree(dl.dest)){ // remove top level directory
exclude("processing-examples-main/README.md")
exclude("processing-examples-main/.github/**")
eachFile { relativePath = RelativePath(true, *relativePath.segments.drop(1).toTypedArray()) }
includeEmptyDirs = false
}
into(layout.buildDirectory.dir("resources-bundled/common/modes/java/examples"))
}
tasks.register<Download>("downloadProcessingWebsiteExamples") {
src("https://github.com/processing/processing-website/archive/refs/heads/main.zip")
dest(layout.buildDirectory.file("tmp/processing-website.zip"))
overwrite(false)
}
tasks.register<Copy>("unzipWebsiteExamples") {
val dl = tasks.findByPath("downloadProcessingWebsiteExamples") as Download
dependsOn(dl)
dependsOn("unzipExamples")
print(dl.dest)
from(zipTree(dl.dest)){
include("processing-website-main/content/examples/**")
eachFile { relativePath = RelativePath(true, *relativePath.segments.drop(3).toTypedArray()) }
includeEmptyDirs = false
}
into(layout.buildDirectory.dir("resources-bundled/common/modes/java/examples"))
}
tasks.register<Copy>("copyJavaMode"){
dependsOn("unzipExamples")
dependsOn("unzipExamples","unzipWebsiteExamples")
dependsOn(project(":java").tasks.named("extraResources"))
from(project(":java").layout.buildDirectory.dir("resources-bundled"))
into(layout.buildDirectory.dir("resources-bundled"))
File diff suppressed because one or more lines are too long