Adds gpg, sonatype, changes groupId

This commit is contained in:
Guillaume Tâche
2025-01-03 22:08:50 +01:00
parent c3d9e72e42
commit f59863c628
183 changed files with 860 additions and 779 deletions

View File

@@ -1,12 +1,12 @@
package com.github.gtache.fxml.compiler.parsing.xml;
package ch.gtache.fxml.compiler.parsing.xml;
import com.github.gtache.fxml.compiler.impl.ClassesFinder;
import com.github.gtache.fxml.compiler.parsing.FXMLParser;
import com.github.gtache.fxml.compiler.parsing.ParseException;
import com.github.gtache.fxml.compiler.parsing.ParsedDefine;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.*;
import ch.gtache.fxml.compiler.impl.ClassesFinder;
import ch.gtache.fxml.compiler.parsing.FXMLParser;
import ch.gtache.fxml.compiler.parsing.ParseException;
import ch.gtache.fxml.compiler.parsing.ParsedDefine;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.*;
import javafx.event.EventHandler;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -134,6 +134,7 @@ public class DOMFXMLParser implements FXMLParser {
if (isObject(item)) {
objects.add(parseObject(item, imports));
} else if (isSimpleProperty(item)) {
//A property that could be an attribute
final var sourceTypeName = getSourceTypeName(item, imports);
final var property = new ParsedPropertyImpl(sourceTypeName.name(), sourceTypeName.sourceType(), item.getTextContent());
attributes.put(property.name(), property);
@@ -290,6 +291,8 @@ public class DOMFXMLParser implements FXMLParser {
if (imports.containsKey(key)) {
return imports.get(key);
} else {
//Fallback to searching in packages
logger.debug("Class {} not found in imports, searching in packages", key);
for (final var pkg : packages) {
final var className = pkg + "." + key;
try {

View File

@@ -1,10 +1,10 @@
/**
* XML parsing module for FXML compiler
*/
module com.github.gtache.fxml.compiler.xml {
requires transitive com.github.gtache.fxml.compiler.core;
module ch.gtache.fxml.compiler.xml {
requires transitive ch.gtache.fxml.compiler.core;
requires java.xml;
requires org.apache.logging.log4j;
exports com.github.gtache.fxml.compiler.parsing.xml;
exports ch.gtache.fxml.compiler.parsing.xml;
}

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.xml;
package ch.gtache.fxml.compiler.parsing.xml;
import com.github.gtache.fxml.compiler.parsing.ParseException;
import com.github.gtache.fxml.compiler.parsing.impl.*;
import ch.gtache.fxml.compiler.parsing.ParseException;
import ch.gtache.fxml.compiler.parsing.impl.*;
import javafx.collections.FXCollections;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
@@ -33,7 +33,7 @@ class TestDOMFXMLParser {
@Test
void testRealCase() throws Exception {
final var expected = new ParsedObjectImpl(BorderPane.class.getName(),
newLinkedHashMap("fx:controller", new ParsedPropertyImpl("fx:controller", null, "com.github.gtache.fxml.compiler.parsing.xml.LoadController")),
newLinkedHashMap("fx:controller", new ParsedPropertyImpl("fx:controller", null, "ch.gtache.fxml.compiler.parsing.xml.LoadController")),
newLinkedHashMap(new ParsedPropertyImpl("bottom", null, null),
List.of(new ParsedDefineImpl(List.of(new ParsedObjectImpl(HBox.class.getName(), Map.of("fx:id", new ParsedPropertyImpl("fx:id", null, "define1")), newLinkedHashMap(), List.of()))),
new ParsedObjectImpl(VBox.class.getName(),
@@ -53,7 +53,7 @@ class TestDOMFXMLParser {
newLinkedHashMap(new ParsedPropertyImpl("right", null, null),
List.of(new ParsedReferenceImpl(Map.of("source", new ParsedPropertyImpl("source", null, "define7"))))), List.of()))), List.of()),
new ParsedIncludeImpl(
Map.of("source", new ParsedPropertyImpl("source", null, "includedView.fxml"), "resources", new ParsedPropertyImpl("resources", null, "com/github/gtache/fxml/compiler/parsing/xml/IncludedBundle"), "fx:id", new ParsedPropertyImpl("fx:id", null, "id")))
Map.of("source", new ParsedPropertyImpl("source", null, "includedView.fxml"), "resources", new ParsedPropertyImpl("resources", null, "ch/gtache/fxml/compiler/parsing/xml/IncludedBundle"), "fx:id", new ParsedPropertyImpl("fx:id", null, "id")))
)), List.of(new ParsedDefineImpl(List.of(
new ParsedConstantImpl(Cursor.class.getName(), Map.of("fx:constant", new ParsedPropertyImpl("fx:constant", null, "CLOSED_HAND"))),
new ParsedObjectImpl(String.class.getName(), Map.of("fx:id", new ParsedPropertyImpl("fx:id", null, "define2")), newLinkedHashMap(), List.of(new ParsedTextImpl("text"))),

View File

@@ -2,5 +2,5 @@
<?import javafx.scene.layout.BorderPane?>
<BorderPane xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.fxml.compiler.parsing.xml.LoadController">
fx:controller="ch.gtache.fxml.compiler.parsing.xml.LoadController">
</BorderPane>

View File

@@ -2,7 +2,7 @@
<?import javafx.scene.layout.BorderPane?>
<BorderPane xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.fxml.compiler.parsing.xml.LoadController">
fx:controller="ch.gtache.fxml.compiler.parsing.xml.LoadController">
<bottom>
<fx:define>
<children></children>

View File

@@ -3,7 +3,7 @@
<?import javafx.collections.FXCollections?>
<?import javafx.scene.layout.BorderPane?>
<BorderPane xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.fxml.compiler.parsing.xml.LoadController">
fx:controller="ch.gtache.fxml.compiler.parsing.xml.LoadController">
<bottom>
<fx:define>
<FXCollections fx:id="define5" fx:factory="observableArrayList">

View File

@@ -2,5 +2,5 @@
<?import javafx.scene.layout.BorderPane?>
<fx:root type="javafx.scene.layout.BorderPane" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.fxml.compiler.parsing.xml.LoadController">
fx:controller="ch.gtache.fxml.compiler.parsing.xml.LoadController">
</fx:root>

View File

@@ -2,6 +2,6 @@
<?import javafx.scene.layout.BorderPane?>
<BorderPane xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.fxml.compiler.parsing.xml.LoadController">
fx:controller="ch.gtache.fxml.compiler.parsing.xml.LoadController">
<fx:script></fx:script>
</BorderPane>

View File

@@ -10,7 +10,7 @@
<?import javafx.scene.layout.VBox?>
<?import java.lang.*?>
<BorderPane xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.fxml.compiler.parsing.xml.LoadController">
fx:controller="ch.gtache.fxml.compiler.parsing.xml.LoadController">
<bottom>
<fx:define>
<HBox fx:id="define1"/>
@@ -54,7 +54,7 @@
</padding>
</Label>
<fx:include source="includedView.fxml"
resources="com/github/gtache/fxml/compiler/parsing/xml/IncludedBundle" fx:id="id"/>
resources="ch/gtache/fxml/compiler/parsing/xml/IncludedBundle" fx:id="id"/>
</children>
</VBox>
</bottom>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<BorderPane xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.fxml.compiler.parsing.xml.LoadController">
fx:controller="ch.gtache.fxml.compiler.parsing.xml.LoadController">
<bottom>
</bottom>
</BorderPane>