hello. I found this super nice new framework few days ago and It’s so lovely. thank you so much for this wonderful library and can’t wait to see will be update more.
can I ask something about IDE setup? (vscode)
I’m not a super professional programmer but having lot of experience with processing and openFrameworks. now a days been looking other frameworks like nannou(which is based on rust) and openRNDR.
I follow instruction IDE setup from guide document and everything works perfect but usually I don’t want to rely on specific IDE like xcode, Jetbrain IntelliJ CE. so I just want to try it on vscode.
since I don’t have deep experience with JAVA and especially kotlin (this is the first time I tried). so I’m not sure I’m doing right way. but clone repository https://github.com/openrndr/openrndr-template to new name and open in vscode. then for running, just type ./gradlew run then seems to work.
one things I want to do is that the autocomplete with language server. but I had a issue that in vscode there is an issue
Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
...
I found set kotlin version in settings.gradle.kts file
Version 1.8.0 is quite new, just changed last week I think. Maybe the language server has not been updated yet? You could use 1.6.0 and try with the newer version later to see if it works?
I believe we are not using things that require 1.8.0.
I’m curious to hear how is the experience in vscode. In Idea I find it very good, but I understand is more convenient to use the same IDE for everything.
What kind of programs do you like writing? Looking forward to see what kind of experiments / creations you do
aha! that’s why it doesn’t work. thank you for let me know that.
–
I’ve been do some interactive artwork and also teaching in school since few years ago(processing/arduino). about my works, some of them are running on desktop but also had experience build/running oF app on raspberry pi. recently designing PCB for bit engineering based project with arduino-based esp32 micro controller. I can say I mostly work as technician or tech-riding with other team/artists.
my coding environment is various. sometimes pc/linux/mac but sometimes on terminal. that’s why I don’t want to rely on specific OS or IDE. and I love vscode (also vim as well)
for beginner, I think vscode is stumbling block. but with task.json and shell script, it can be more easier.
for example, with this alias in .zshrc or .bashrc it can easily generate project folder. and open in vscode. (rm -Rf is for mac btw)
# generate OPENRNDR project
alias initOR='f(){ git clone https://github.com/openrndr/openrndr-template "$@"; cd "$@"; rm -Rf .git; code .;}; f'
One thing I like in Idea is that I can have many programs inside the same project. I wonder if this might work in vscode too? I have over 200 programs in the same project XD. That way I don’t have so many Gradle projects and I can easily copy code from one file to another, or search and replace in all my programs. And the IDE checks that my code is still compatible with the latest releases of openrndr/orx, so programs still run 3 years after I wrote them.
still I’m not familiar with gradle and and intellij IDE. that might be much better idea instead of having seperate folder with same template. I also had kinda same question that ‘do i have to clone template for every projects?’ like you saids, indexing in backgrounds are totally same except source code.
I had same experience in nannou, which is written in Rust. in rust they have cargo package manager maintained in crates. so everytime I create project and build, duplicate crates are generated which is lots and huge file size.
what if using symbolic link? will it work? i need to understand how kotlin/Gradle compile. openFrameworks are share compiled library that’s why those project folder structure is hierarchical. actually project folder can be seperated because of the Makefile.
I know Nannou The lead developers used to live here in Berlin and we met them sometimes in our creative coding meetups. Sound’s like you’ve tried every framework
Once I tried to use symbolic links with Processing + Kotlin + Idea. In that case it didn’t work well. But maybe it works outside of the IDE? I just asked about running different programs from the command line with Gradle.
I did try Did you make sure TemplateProgram.kt and test_01.kt look different? In the second one I made the circle green, but I see pink when running that line.
I tried to modify like this and run task on terminal.
group = "org.openrndr.template"
version = "0.4.0"
// val applicationMainClass = "TemplateProgramKt" // -> original
val targetClass = findProperty("targetClass");
val applicationMainClass = targetClass
and terminal
./gradlew -PtargetClass=TemplateProgramKt run # works
./gradlew -PtargetClass=TemplateLiveProgramKt run # works
./gradlew -PtargetClass=Test_01Kt run # work
any file in /src/main/kotlin directory works. can you confirm this? still doesn’t work in sub-directory.
I guess gradle have kind a code search path like Makefile. so no matter what directory in side of src/main/kotlin, passing only fileName with -P option without directory name on ./gradlew works.
here is my build.gradle.kts
// val applicationMainClass = "TemplateProgramKt" // original code
var applicationMainClass = "TemplateProgramKt"
// override -P argument from terminal command
if(project.hasProperty("targetClass")){ // check if has parameter
applicationMainClass = findProperty("targetClass").toString()
println("file $applicationMainClass will be run")
} else {
println("default $applicationMainClass will be run.") // if not, use default
}
so all of commands are work.
./gredlew run
./gredlew TemplateProgramKt
./gredlew TemplateLiveProgramKt
./gredlew Test_01Kt
./gredlew Test_02Kt
but then what if there are files have same fileName in different sub-directory?
I tested and result is quite interesting. there is no error. and last modified one launched.
I think what might be missing in your case is to specify the right package for files in subfolders. The first line in those .kt files should be package test or package test2. I hope that helps!