Coder Social home page Coder Social logo

openrndr-template's Introduction

OPENRNDR template project

A feature rich template for creating OPENRNDR programs based on Gradle/Kts.

The template consists of a configuration for Gradle and two example OPENRNDR programs. The Gradle configuration should serve as the go-to starting point for writing OPENRNDR-based software.

If you are looking at this from IntelliJ IDEA you can start by expanding the project tab on the left. You will find a template program in src/main/kotlin/TemplateProgram.kt and a live-coding example in src/main/kotlin/TemplateLiveProgram.kt.

You will find some basic instructions in the OPENRNDR guide

Gradle tasks

  • ./gradlew run runs the TemplateProgram (Use gradlew.bat run under Windows)
  • ./gradlew shadowJar creates an executable platform specific jar file with all dependencies. Run the resulting program by typing java -jar build/libs/openrndr-template-1.0.0-all.jar in a terminal from the project root.
  • ./gradlew jpackageZip creates a zip with a stand-alone executable for the current platform (works with Java 14 only)

Cross builds

To create a runnable jar for a platform different from your current platform, use ./gradlew jar -PtargetPlatform=<platform>, where <platform> is either windows, macos, linux-x64, or linux-arm64.

Updating OPENRNDR, ORX and other dependencies

The openrndr-template depends on various packages including the core openrndr and the orx extensions. The version numbers of these dependencies are specified in your libs.versions.toml file. If you want to learn about file format visit the Gradle documentation website.

Newer versions of OPENRNDR and ORX bring useful features and bug fixes. The most recent versions are
openrndr version for OPENRNDR.
orx version for ORX.

Switch to the next-version branch or enter these version numbers in your toml file. They can look like "0.4.3" or "0.4.3-alpha4". Use the complete string, as in:

openrndr = "0.4.3-alpha4"
    orx = "0.4.3-alpha4"

You can add other dependencies needed by your project to your build.gradle.kts file, inside the dependencies { } block.

Remember to reload the Gradle configuration after changing any dependencies.

Run other Kotlin programs from the command line

By default ./gradlew run runs a program called TemplateProgram.kt but a different one can be provided as an argument:

To run src/main/kotlin/myProgram.kt

./gradlew run -Popenrndr.application=MyProgramKt

To run src/main/kotlin/foo/bar/myProgram.kt (assuming package foo.bar in myProgram.kt)

./gradlew run -Popenrndr.application=foo.bar.MyProgramKt

Github Actions

This repository contains a number of Github Actions under ./github/workflows.

build-on-commit.yaml runs a basic build on every commit, which can help detect issues in the source code.

publish-binaries.yaml publishes binaries for Linux, Mac and Windows any time a commit is tagged with a version number like v1.*.

For example, we can create and push a tag with these git commands:

git tag -a v1.0.0 -m "v1.0.0"
git push origin v1.0.0

The progress of the running actions can be followed under the Actions tab in GitHub. Once complete, the executables will be found under the Releases section.

openrndr-template's People

Contributors

edwinrndr avatar gauthams-kumar avatar goudreinette avatar hamoid avatar morisil avatar ricardomatias avatar vechro avatar yvee1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

openrndr-template's Issues

Version tags might better be named

Hello! :-)
When I use this template (including the git history) as a starting point for my project,
it means that I have version tags in my history already, which I probably don't want.
A solution that I have also seen in the Java/JVM world, is to name the version tags, like so:
openrndr-template-v0.3.4, instead of just v0.3.4.

As it is now, I can locally delete the tags, but they get re-fetched every time I fetch from the template remote, which I might want to do, to merge in your latest version.

Build constantly cancelled

Hello RNDR team! I'm back to tinkering with OpenRNDR again after a long gap. Starting a new project from VCS using this git repo, I got this error: Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.openrndr.extra:orx-git-archiver-gradle:0.4.1.

I removed orx-git-archiver from the plugins and orxFeatures and the template builds as normal again.

My setup:

  • OS: Windows 20
  • IntelliJ IDEA 2021.1.3
  • JDK 15

"Unable to create primary window" issue

I get this error when I try to run the template :

Caused by: java.lang.IllegalStateException: primary window could not be created.

My procedure was :

  • cloning the repository via version control.
  • running "run" in the gradle tasks tab.

I tried this :

  1. deleting the clone.
  2. resetting IntelliJ IDEA to default settings.
  3. going through the same steps again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.