wip
This commit is contained in:
15
examples/gradle-consumer/build.gradle.kts
Normal file
15
examples/gradle-consumer/build.gradle.kts
Normal file
@@ -0,0 +1,15 @@
|
||||
plugins {
|
||||
application
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("dev.jlibghostty:jlibghostty:0.1.0-SNAPSHOT")
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("example.Main")
|
||||
}
|
||||
|
||||
tasks.withType<JavaExec>().configureEach {
|
||||
jvmArgs("--enable-native-access=ALL-UNNAMED")
|
||||
}
|
||||
18
examples/gradle-consumer/settings.gradle.kts
Normal file
18
examples/gradle-consumer/settings.gradle.kts
Normal file
@@ -0,0 +1,18 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri(System.getenv("JLIBGHOSTTY_MAVEN_REPO") ?: "../../result/maven")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "jlibghostty-consumer"
|
||||
19
examples/gradle-consumer/src/main/java/example/Main.java
Normal file
19
examples/gradle-consumer/src/main/java/example/Main.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package example;
|
||||
|
||||
import dev.jlibghostty.Ghostty;
|
||||
import dev.jlibghostty.Terminal;
|
||||
import dev.jlibghostty.TerminalOptions;
|
||||
|
||||
public final class Main {
|
||||
private Main() {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("paste safe: " + Ghostty.pasteIsSafe("hello"));
|
||||
|
||||
try (Terminal terminal = Ghostty.open(TerminalOptions.of(80, 24))) {
|
||||
terminal.write("hello from libghostty-vt\r\n");
|
||||
System.out.println(terminal.snapshot());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user