Compare commits

...

2 Commits

Author SHA1 Message Date
55a3db11a6 shade dependencies and move package 2024-11-20 18:12:24 +01:00
d7c7b577ee feat: java-gtk dependency 2024-11-20 17:36:04 +01:00
4 changed files with 96 additions and 21 deletions

7
.idea/encodings.xml generated Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

56
pom.xml
View File

@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dev.ninjdai</groupId>
<artifactId>stalgtk</artifactId>
<groupId>dev.ninjdai.prosopagtk</groupId>
<artifactId>prosopagtk</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
@ -13,5 +13,53 @@
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.bailuk</groupId>
<artifactId>java-gtk</artifactId>
<version>v0.5.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>dev.ninjdai.prosopagtk.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>dev.ninjdai.prosopagtk.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,17 +0,0 @@
package dev.ninjdai;
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
System.out.printf("Hello and welcome!");
for (int i = 1; i <= 5; i++) {
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
System.out.println("i = " + i);
}
}
}

View File

@ -0,0 +1,37 @@
package dev.ninjdai.prosopagtk;
import ch.bailu.gtk.gtk.Application;
import ch.bailu.gtk.gtk.ApplicationWindow;
import ch.bailu.gtk.gio.ApplicationFlags;
import ch.bailu.gtk.gtk.Button;
import ch.bailu.gtk.type.Strs;
public class Main {
public static void main(String[] args) {
var app = new Application("com.example.hello",
ApplicationFlags.FLAGS_NONE);
app.onActivate(() -> {
// Create a new window
var window = new ApplicationWindow(app);
// Create a new button
var button = new Button();
// Set button label
button.setLabel("Hello, World!");
// When the button is clicked, close the window
button.onClicked(window::close);
window.setChild(button);
window.show();
});
// Start application main loop
var result = app.run(args.length, new Strs(args));
// Terminate with exit code
System.exit(result);
}
}