mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Merge branch 'main' into all-contributors/add-pnngocdoan
This commit is contained in:
+66
-19
@@ -350,7 +350,8 @@
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/3434564?v=4",
|
||||
"profile": "https://github.com/joshgiesbrecht",
|
||||
"contributions": [
|
||||
"code"
|
||||
"code",
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1569,24 +1570,70 @@
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "AhmedMagedC",
|
||||
"name": "AhmedMaged",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/111961041?v=4",
|
||||
"profile": "https://github.com/AhmedMagedC",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "pnngocdoan",
|
||||
"name": "Ngoc Doan",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/113954980?v=4",
|
||||
"profile": "https://github.com/pnngocdoan",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
}
|
||||
{
|
||||
"login": "AhmedMagedC",
|
||||
"name": "AhmedMaged",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/111961041?v=4",
|
||||
"profile": "https://github.com/AhmedMagedC",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ThexXTURBOXx",
|
||||
"name": "Nico Mexis",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/12763829?v=4",
|
||||
"profile": "http://nmexis.me",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "tychedelia",
|
||||
"name": "charlotte 🌸",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/10366310?v=4",
|
||||
"profile": "http://charlotte.fyi",
|
||||
"contributions": [
|
||||
"review"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jdebou",
|
||||
"name": "Joackim de Bourqueney",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/80685479?v=4",
|
||||
"profile": "http://i-j.fr",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "toniab",
|
||||
"name": "Tonz",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/370199?v=4",
|
||||
"profile": "https://github.com/toniab",
|
||||
"contributions": [
|
||||
"code",
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "aj-m",
|
||||
"name": "Andrew",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/2524348?v=4",
|
||||
"profile": "https://github.com/aj-m",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "pnngocdoan",
|
||||
"name": "Ngoc Doan",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/113954980?v=4",
|
||||
"profile": "https://github.com/pnngocdoan",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
}
|
||||
],
|
||||
"repoType": "github",
|
||||
"repoHost": "https://github.com",
|
||||
|
||||
@@ -12,7 +12,7 @@ First, [download the IntelliJ IDEA Community Edition](https://www.jetbrains.com/
|
||||
1. Clone the Processing4 repository to your machine locally
|
||||
1. Open the cloned repository in IntelliJ IDEA CE
|
||||
1. When prompted, select **Trust Project**. You can preview the project in Safe Mode but you won't be able to build Processing.
|
||||
1. IntelliJ may start loading Gradle dependencies automatically. Wait for this process to complete.
|
||||
1. IntelliJ may ask if you want to load Gradle project. If you allow this, make sure you are using JDK version 17.
|
||||
1. In the main menu, go to File > Project Structure > Project Settings > Project.
|
||||
1. In the SDK Dropdown option, select a JDK version 17 or Download the jdk
|
||||
1. Click the green Run Icon in the top right of the window. This is also where you can find the option to debug Processing.
|
||||
@@ -130,6 +130,8 @@ The main task to run or debug the PDE is `run`. That means you just need to run
|
||||
|
||||
If your main concern is with the `Core` you don't need to build and start the whole PDE to test your changes. In IntelliJ IDEA you can select any of the sketches in `core/examples/src/.../` to run by click on the green arrow next to their main functions. This will just compile core and the example sketch. Feel free to create additional examples for your new functionality.
|
||||
|
||||
If you are specifically trying to run the `Processing CLI`, you can test commands from `app/test/Processing.app/CLITest`.
|
||||
|
||||
## Troubleshooting and Setup Tips (IntelliJ IDEA)
|
||||
|
||||
If you’re building Processing using IntelliJ IDEA and something’s not working, here are a few things that might help:
|
||||
|
||||
@@ -124,7 +124,7 @@ _Note: due to GitHub's limitations, this repository's [Contributors](https://git
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://github.com/dhowe"><img src="https://avatars.githubusercontent.com/u/737638?v=4?s=120" width="120px;" alt="Daniel Howe"/><br /><sub><b>Daniel Howe</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=dhowe" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://github.com/joshgiesbrecht"><img src="https://avatars.githubusercontent.com/u/3434564?v=4?s=120" width="120px;" alt="Josh Giesbrecht"/><br /><sub><b>Josh Giesbrecht</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=joshgiesbrecht" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://github.com/joshgiesbrecht"><img src="https://avatars.githubusercontent.com/u/3434564?v=4?s=120" width="120px;" alt="Josh Giesbrecht"/><br /><sub><b>Josh Giesbrecht</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=joshgiesbrecht" title="Code">💻</a> <a href="https://github.com/processing/processing4/issues?q=author%3Ajoshgiesbrecht" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://liquidex.house/"><img src="https://avatars.githubusercontent.com/u/16415678?v=4?s=120" width="120px;" alt="liquidex"/><br /><sub><b>liquidex</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=liquidev" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://github.com/bgc"><img src="https://avatars.githubusercontent.com/u/516129?v=4?s=120" width="120px;" alt="bgc"/><br /><sub><b>bgc</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=bgc" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://umair.io/"><img src="https://avatars.githubusercontent.com/u/3191547?v=4?s=120" width="120px;" alt="Mohammad Umair"/><br /><sub><b>Mohammad Umair</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=omerjerk" title="Code">💻</a></td>
|
||||
@@ -304,6 +304,13 @@ _Note: due to GitHub's limitations, this repository's [Contributors](https://git
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://github.com/Vaivaswat2244"><img src="https://avatars.githubusercontent.com/u/113991324?v=4?s=120" width="120px;" alt="Vaivaswat Dubey"/><br /><sub><b>Vaivaswat Dubey</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=Vaivaswat2244" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://www.cbi-games.org"><img src="https://avatars.githubusercontent.com/u/37940266?v=4?s=120" width="120px;" alt="jSdCool"/><br /><sub><b>jSdCool</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=jSdCool" title="Code">💻</a> <a href="https://github.com/processing/processing4/commits?author=jSdCool" title="Documentation">📖</a></td>
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://github.com/AhmedMagedC"><img src="https://avatars.githubusercontent.com/u/111961041?v=4?s=120" width="120px;" alt="AhmedMaged"/><br /><sub><b>AhmedMaged</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=AhmedMagedC" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="16.66%"><a href="http://nmexis.me"><img src="https://avatars.githubusercontent.com/u/12763829?v=4?s=120" width="120px;" alt="Nico Mexis"/><br /><sub><b>Nico Mexis</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=ThexXTURBOXx" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="16.66%"><a href="http://charlotte.fyi"><img src="https://avatars.githubusercontent.com/u/10366310?v=4?s=120" width="120px;" alt="charlotte 🌸"/><br /><sub><b>charlotte 🌸</b></sub></a><br /><a href="https://github.com/processing/processing4/pulls?q=is%3Apr+reviewed-by%3Atychedelia" title="Reviewed Pull Requests">👀</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="16.66%"><a href="http://i-j.fr"><img src="https://avatars.githubusercontent.com/u/80685479?v=4?s=120" width="120px;" alt="Joackim de Bourqueney"/><br /><sub><b>Joackim de Bourqueney</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=jdebou" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://github.com/toniab"><img src="https://avatars.githubusercontent.com/u/370199?v=4?s=120" width="120px;" alt="Tonz"/><br /><sub><b>Tonz</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=toniab" title="Code">💻</a> <a href="https://github.com/processing/processing4/commits?author=toniab" title="Documentation">📖</a></td>
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://github.com/aj-m"><img src="https://avatars.githubusercontent.com/u/2524348?v=4?s=120" width="120px;" alt="Andrew"/><br /><sub><b>Andrew</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=aj-m" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="16.66%"><a href="https://github.com/pnngocdoan"><img src="https://avatars.githubusercontent.com/u/113954980?v=4?s=120" width="120px;" alt="Ngoc Doan"/><br /><sub><b>Ngoc Doan</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=pnngocdoan" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -59,30 +59,22 @@ class LSP: SuspendingCliktCommand("lsp"){
|
||||
}
|
||||
}
|
||||
|
||||
class LegacyCLI(val args: Array<String>): SuspendingCliktCommand( "cli"){
|
||||
override fun help(context: Context) = "Legacy processing-java command line interface"
|
||||
|
||||
class LegacyCLI(val args: Array<String>): SuspendingCliktCommand("cli") {
|
||||
override val treatUnknownOptionsAsArgs = true
|
||||
|
||||
val help by option("--help").flag()
|
||||
val build by option("--build").flag()
|
||||
val run by option("--run").flag()
|
||||
val present by option("--present").flag()
|
||||
val sketch: String? by option("--sketch")
|
||||
val force by option("--force").flag()
|
||||
val output: String? by option("--output")
|
||||
val export by option("--export").flag()
|
||||
val noJava by option("--no-java").flag()
|
||||
val variant: String? by option("--variant")
|
||||
val arguments by argument().multiple(default = emptyList())
|
||||
|
||||
override suspend fun run(){
|
||||
val cliArgs = args.filter { it != "cli" }
|
||||
override suspend fun run() {
|
||||
try {
|
||||
if(build){
|
||||
if (arguments.contains("--build")) {
|
||||
System.setProperty("java.awt.headless", "true")
|
||||
}
|
||||
// Indirect invocation since app does not depend on java mode
|
||||
|
||||
Class.forName("processing.mode.java.Commander")
|
||||
.getMethod("main", Array<String>::class.java)
|
||||
.invoke(null, *arrayOf<Any>(cliArgs.toTypedArray()))
|
||||
.invoke(null, arguments.toTypedArray())
|
||||
} catch (e: Exception) {
|
||||
throw InternalError("Failed to invoke main method", e)
|
||||
}
|
||||
|
||||
@@ -2665,7 +2665,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
|
||||
* Clear the status area.
|
||||
*/
|
||||
public void statusEmpty() {
|
||||
statusNotice(EMPTY);
|
||||
status.empty();
|
||||
}
|
||||
|
||||
|
||||
@@ -2736,6 +2736,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
|
||||
}
|
||||
|
||||
int tabIndex = p.getTabIndex();
|
||||
sketch.setCurrentCode(tabIndex); // so we are looking at the right offsets below
|
||||
int lineNumber = p.getLineNumber();
|
||||
int lineStart = textarea.getLineStartOffset(lineNumber);
|
||||
int lineEnd = textarea.getLineStopOffset(lineNumber);
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package processing.app
|
||||
|
||||
import java.io.File
|
||||
import kotlin.test.Test
|
||||
|
||||
/*
|
||||
This class is used to test the CLI commands of the Processing IDE.
|
||||
It mostly exists to quickly run CLI commands without having to specify run configurations
|
||||
or to manually run it on the command line.
|
||||
|
||||
In IntelliJ IDEA, it should display runnable arrows next to each test method.
|
||||
Use this to quickly test the CLI commands.
|
||||
The output will be displayed in the console after `Running CLI with arguments: ...`.
|
||||
When developing on the CLI commands, feel free to add more test methods here.
|
||||
*/
|
||||
class CLITest {
|
||||
|
||||
@Test
|
||||
fun testLSP(){
|
||||
runCLIWithArguments("lsp")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testLegacyCLI(){
|
||||
runCLIWithArguments("cli --help")
|
||||
}
|
||||
|
||||
/*
|
||||
This function runs the CLI with the given arguments.
|
||||
*/
|
||||
fun runCLIWithArguments(args: String) {
|
||||
// TODO: Once Processing PDE correctly builds in IntelliJ IDEA switch over to using the code directly
|
||||
// To see if the PDE builds correctly can be tested by running the Processing.kt main function directly in IntelliJ IDEA
|
||||
// Set the JAVA_HOME environment variable to the JDK used by the IDE
|
||||
println("Running CLI with arguments: $args")
|
||||
val process = ProcessBuilder("./gradlew", "run", "--args=$args", "--quiet")
|
||||
.directory(File(System.getProperty("user.dir")).resolve("../../../"))
|
||||
.inheritIO()
|
||||
|
||||
process.environment().apply {
|
||||
put("JAVA_HOME", System.getProperty("java.home"))
|
||||
}
|
||||
|
||||
val result = process
|
||||
.start()
|
||||
.waitFor()
|
||||
println("Done running CLI with arguments: $args (Result: $result)")
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@
|
||||
<Feature Id="MainApplication" Title="Processing" Level="1">
|
||||
<Files Include="..\build\compose\binaries\main\app\Processing\**" />
|
||||
<ComponentRef Id="ApplicationShortcut" />
|
||||
<ComponentRef Id="PathComponent" />
|
||||
</Feature>
|
||||
<Directory Id="ProgramMenuFolder">
|
||||
<Directory Id="ApplicationProgramsFolder" Name="Processing"/>
|
||||
@@ -31,5 +32,13 @@
|
||||
<RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder" On="uninstall"/>
|
||||
<RegistryValue Root="HKCU" Key="Software\Processing Foundation\Processing" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
|
||||
</Component>
|
||||
<Component Id="PathComponent" Guid="795b17d1-6e67-4581-9588-1f80a73c1428">
|
||||
<Environment Id="AddProcessingToPath"
|
||||
Action="set"
|
||||
Name="Path"
|
||||
Part="last"
|
||||
Value="[INSTALLFOLDER]">
|
||||
</Environment>
|
||||
</Component>
|
||||
</Package>
|
||||
</Wix>
|
||||
@@ -774,10 +774,11 @@ public class Runner implements MessageConsumer {
|
||||
err.println("and your code should be rewritten in a more efficient manner.");
|
||||
|
||||
} else if (exceptionClass.equals("java.lang.UnsupportedClassVersionError")) {
|
||||
int javaVersion = Runtime.version().feature();
|
||||
listener.statusError("UnsupportedClassVersionError: A library is using code compiled with an unsupported version of Java.");
|
||||
err.println("This version of Processing only supports libraries and JAR files compiled for Java 1.8 or earlier.");
|
||||
err.println("A library used by this sketch was compiled for Java 1.9 or later, ");
|
||||
err.println("and needs to be recompiled to be compatible with Java 1.8.");
|
||||
err.println("This version of Processing only supports libraries and JAR files compiled for Java " + javaVersion + " or earlier.");
|
||||
err.println("A library used by this sketch was compiled for Java " + (javaVersion + 1) + " or later, ");
|
||||
err.println("and needs to be recompiled to be compatible with Java " + javaVersion + ".");
|
||||
|
||||
} else if (exceptionClass.equals("java.lang.NoSuchMethodError") ||
|
||||
exceptionClass.equals("java.lang.NoSuchFieldError")) {
|
||||
|
||||
Reference in New Issue
Block a user