Skip to content

Commit 7fb8b2f

Browse files
committed
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
1 parent 529a0e0 commit 7fb8b2f

3 files changed

Lines changed: 22 additions & 160 deletions

File tree

.idea/runConfigurations/Processing.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle.kts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,32 @@ tasks.register<Copy>("unzipExamples") {
162162
val dl = tasks.findByPath("downloadProcessingExamples") as Download
163163
dependsOn(dl)
164164
from(zipTree(dl.dest)){ // remove top level directory
165+
exclude("processing-examples-main/README.md")
166+
exclude("processing-examples-main/.github/**")
165167
eachFile { relativePath = RelativePath(true, *relativePath.segments.drop(1).toTypedArray()) }
168+
includeEmptyDirs = false
166169
}
167170
into(layout.buildDirectory.dir("resources-bundled/common/modes/java/examples"))
168171
}
169-
tasks.register<Copy>("copyJavaMode"){
172+
tasks.register<Download>("downloadProcessingWebsiteExamples") {
173+
src("https://github.com/processing/processing-website/archive/refs/heads/main.zip")
174+
dest(layout.buildDirectory.file("tmp/processing-website.zip"))
175+
overwrite(false)
176+
}
177+
tasks.register<Copy>("unzipWebsiteExamples") {
178+
val dl = tasks.findByPath("downloadProcessingWebsiteExamples") as Download
179+
dependsOn(dl)
170180
dependsOn("unzipExamples")
181+
print(dl.dest)
182+
from(zipTree(dl.dest)){
183+
include("processing-website-main/content/examples/**")
184+
eachFile { relativePath = RelativePath(true, *relativePath.segments.drop(3).toTypedArray()) }
185+
includeEmptyDirs = false
186+
}
187+
into(layout.buildDirectory.dir("resources-bundled/common/modes/java/examples"))
188+
}
189+
tasks.register<Copy>("copyJavaMode"){
190+
dependsOn("unzipExamples","unzipWebsiteExamples")
171191
dependsOn(project(":java").tasks.named("extraResources"))
172192
from(project(":java").layout.buildDirectory.dir("resources-bundled"))
173193
into(layout.buildDirectory.dir("resources-bundled"))

0 commit comments

Comments
 (0)