diff --git a/.github/workflows/dispatch_build.yml b/.github/workflows/dispatch_build.yml deleted file mode 100644 index c3e4fc9b..00000000 --- a/.github/workflows/dispatch_build.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Dispatch Build - -on: - workflow_dispatch: - inputs: - isRelease: - required: true - type: boolean -jobs: - build-and-upload: - uses: ./.github/workflows/build_and_upload.yml - with: - isRelease: ${{ inputs.isRelease }} - shouldUpload: true - secrets: inherit \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ac0faf7..90a17c5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,4 +11,4 @@ jobs: with: isRelease: true shouldUpload: true - secrets: inherit \ No newline at end of file + secrets: inherit diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 00000000..a6ae966f --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,38 @@ +name: Create Tag + +on: + push: + branches: + - 'release' + +jobs: + add-tag: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: madhead/read-java-properties@latest + id: version + with: + file: "./gradle.properties" + property: version + default: 0.0.1 + + - name: Create Git tag + uses: actions/github-script@v7 + with: + script: | + const versionOutputs = ${{ toJSON(steps.version.outputs) }}; + + var version = versionOutputs.value; + + console.log("Version: " + version); + + var ref = "refs/tags/" + version + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: ref, + sha: context.sha + }); \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md index 29849a49..2bc3db43 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,13 @@ [1.0.0-SNAPSHOT] + +[1.0.0-b9] +- add TeaClassFilter printAllowedClasses() and printExcludedClasses() +- add TeaReflectionSupplier.printReflectionClasses() +- Change exclude class comparison to regex +- Downgrade teavm dev 0.10.X version to 0.9.2 release version +- Remove tool/generator from maven/snapshot. + +[1.0.0-b8] - Fix MMB code - Fix catch key - Support IntBuffer in GL20 diff --git a/README.md b/README.md index 22ce6551..51166eea 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,10 @@ repositories { } } ``` - gdxTeaVMVersion = "1.0.0-SNAPSHOT" + // SNAPSHOT: + gdxTeaVMVersion = "-SNAPSHOT" + // RELEASE: + gdxTeaVMVersion = "[LAST_TAG_VERSION]" ```groovy // In teaVM module dependencies { @@ -57,12 +60,5 @@ dependencies { - [Bullet](https://github.com/xpenatan/gdx-bullet) (WIP) - [PhysX](https://github.com/xpenatan/gdx-physx) (WIP) - [ImGui](https://github.com/xpenatan/gdx-imgui) (WIP) +- [Lua](https://github.com/xpenatan/gdx-lua) (WIP) - FreeType - -## Generator: -A WIP standalone tool to convert your libgdx game in .jar or .class format to javascript. [Example](https://youtu.be/BIL_5eaxg9w) -
-
-Note: The compiled jar game should not be obfuscated. - -Setup: TODO diff --git a/backends/backend-teavm/emu/com/badlogic/gdx/graphics/PixmapEmu.java b/backends/backend-teavm/emu/com/badlogic/gdx/graphics/PixmapEmu.java index 7e752c47..34b72912 100644 --- a/backends/backend-teavm/emu/com/badlogic/gdx/graphics/PixmapEmu.java +++ b/backends/backend-teavm/emu/com/badlogic/gdx/graphics/PixmapEmu.java @@ -6,7 +6,6 @@ import com.badlogic.gdx.utils.BufferUtils; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.GdxRuntimeException; -import com.badlogic.gdx.utils.IntMap; import com.github.xpenatan.gdx.backends.teavm.AssetLoaderListener; import com.github.xpenatan.gdx.backends.teavm.TeaApplication; import com.github.xpenatan.gdx.backends.teavm.TeaApplicationConfiguration; @@ -101,7 +100,7 @@ public static int toGlType (FormatEmu format) { private Gdx2DPixmapEmu nativePixmap; private boolean disposed; - public static void downloadFromUrl(String url, final DownloadPixmapResponseListener responseListener) { + public static void downloadFromUrl(String url, final Pixmap.DownloadPixmapResponseListener responseListener) { AssetLoaderListener listener = new AssetLoaderListener<>() { @Override public void onFailure(String url) { @@ -112,7 +111,7 @@ public void onFailure(String url) { @Override public boolean onSuccess(String url, Blob result) { Object obj = new PixmapEmu(result.getImage()); - responseListener.downloadComplete((PixmapEmu)obj); + responseListener.downloadComplete((Pixmap)obj); return false; } }; @@ -739,9 +738,4 @@ public enum BlendingEmu { public enum FilterEmu { NearestNeighbour, BiLinear } - - public interface DownloadPixmapResponseListener { - void downloadComplete (PixmapEmu pixmap); - void downloadFailed (Throwable t); - } } diff --git a/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/TeaBuilder.java b/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/TeaBuilder.java index ed91bd18..bff62914 100644 --- a/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/TeaBuilder.java +++ b/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/TeaBuilder.java @@ -75,7 +75,6 @@ public interface TeaProgressListener { private static final String EXTENSION_FREETYPE = "gdx-freetype-teavm"; private static final String EXTENSION_BOX2D = "gdx-box2d-teavm"; private static final String EXTENSION_BOX2D_GWT = "gdx-box2d-gwt"; - private static final String EXTENSION_IMGUI = "imgui-core-teavm"; public static TeaVMTool config(TeaBuildConfiguration configuration) { TeaVMTool tool = new TeaVMTool(); @@ -215,7 +214,6 @@ private static void sortAcceptedClassPath(ArrayList acceptedURL) { // Move extensions to be first so native classes are replaced by the emulated classes makeClassPathFirst(acceptedURL, EXTENSION_FREETYPE); makeClassPathFirst(acceptedURL, EXTENSION_BOX2D); - makeClassPathFirst(acceptedURL, EXTENSION_IMGUI); // Move generic backend to be first makeClassPathFirst(acceptedURL, "backend-teavm"); } @@ -430,8 +428,6 @@ else if(path.contains("gdx-jnigen")) isValid = ACCEPT_STATE.NOT_ACCEPT; else if(path.contains("gdx-platform")) isValid = ACCEPT_STATE.NOT_ACCEPT; - else if(path.contains("imgui-core")) - isValid = ACCEPT_STATE.NOT_ACCEPT; else if(path.contains("generator/core/")) isValid = ACCEPT_STATE.NOT_ACCEPT; else if(path.contains("gdx-bullet-platform")) @@ -455,8 +451,6 @@ else if(path.contains(EXTENSION_FREETYPE)) isValid = ACCEPT_STATE.ACCEPT; else if(path.contains(EXTENSION_BOX2D)) isValid = ACCEPT_STATE.ACCEPT; - else if(path.contains(EXTENSION_IMGUI)) - isValid = ACCEPT_STATE.ACCEPT; else if(path.contains("jParser-loader")) isValid = ACCEPT_STATE.ACCEPT; else if(path.contains("jzlib")) diff --git a/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/TeaVMResourceProperties.java b/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/TeaVMResourceProperties.java index 43142288..451a37fb 100644 --- a/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/TeaVMResourceProperties.java +++ b/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/TeaVMResourceProperties.java @@ -5,6 +5,8 @@ import java.io.InputStreamReader; import java.net.URI; import java.net.URL; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.Files; @@ -111,6 +113,7 @@ private static ArrayList getAllProperties(ArrayList filteredUrl = new ArrayList<>(); for(URL url : acceptedURL) { String path = url.getPath(); + path = URLDecoder.decode(path, StandardCharsets.UTF_8); boolean accept = !( !(path.endsWith(".jar")) || path.contains("org.teavm" diff --git a/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/plugins/TeaClassFilter.java b/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/plugins/TeaClassFilter.java index 7b364114..f5fb6212 100644 --- a/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/plugins/TeaClassFilter.java +++ b/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/plugins/TeaClassFilter.java @@ -1,5 +1,6 @@ package com.github.xpenatan.gdx.backends.teavm.config.plugins; +import com.github.xpenatan.gdx.backends.teavm.config.TeaBuilder; import java.util.ArrayList; import org.teavm.model.FieldReference; import org.teavm.model.MethodReference; @@ -10,6 +11,10 @@ public class TeaClassFilter implements ElementFilter { private static final ArrayList methodsToExclude = new ArrayList<>(); private static final ArrayList fieldsToExclude = new ArrayList<>(); + private static final ArrayList ALLOWED_CLASSES = new ArrayList<>(); + private static final ArrayList EXCLUDED_CLASSES = new ArrayList<>(); + + /** * my.package.ClassName or my.package */ @@ -31,10 +36,32 @@ public static void addFieldsToExclude(String className, String fieldName) { fieldsToExclude.add(new Pair(className, fieldName)); } + /** + * Must be called after TeaBuilder.build + */ + public static void printAllowedClasses() { + TeaBuilder.logHeader("EXCLUDED CLASSES: " + ALLOWED_CLASSES.size()); + for(String allowedClass : ALLOWED_CLASSES) { + TeaBuilder.log(allowedClass); + } + TeaBuilder.logEnd(); + } + + /** + * Must be called after TeaBuilder.build + */ + public static void printExcludedClasses() { + TeaBuilder.logHeader("ALLOWED CLASES: " + EXCLUDED_CLASSES.size()); + for(String excludedClass : EXCLUDED_CLASSES) { + TeaBuilder.log(excludedClass); + } + TeaBuilder.logEnd(); + } + private static boolean containsClass(ArrayList list, String className) { for(int i = 0; i < list.size(); i++) { String excludedClass = list.get(i); - if(className.contains(excludedClass)) + if(className.matches(excludedClass) || className.contains(excludedClass + "$") ) return true; } return false; @@ -58,6 +85,12 @@ public boolean acceptClass(String fullClassName) { if(containsClass(classesToExclude, fullClassName)) { accceptClass = false; } + if(accceptClass) { + ALLOWED_CLASSES.add(fullClassName); + } + else { + EXCLUDED_CLASSES.add(fullClassName); + } return accceptClass; } diff --git a/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/plugins/TeaReflectionSupplier.java b/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/plugins/TeaReflectionSupplier.java index c401fb76..6c542ad4 100644 --- a/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/plugins/TeaReflectionSupplier.java +++ b/backends/backend-teavm/src/main/java/com/github/xpenatan/gdx/backends/teavm/config/plugins/TeaReflectionSupplier.java @@ -1,5 +1,6 @@ package com.github.xpenatan.gdx.backends.teavm.config.plugins; +import com.github.xpenatan.gdx.backends.teavm.config.TeaBuilder; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -17,6 +18,8 @@ public class TeaReflectionSupplier implements ReflectionSupplier { private static ArrayList clazzList = new ArrayList(); + private static HashSet REFLECTION_CLASSES = new HashSet<>(); + public static void addReflectionClass(Class type) { addReflectionClass(type.getName()); } @@ -41,6 +44,17 @@ public static void addReflectionClass(String className) { clazzList.add(className); } + /** + * Must be called after TeaBuilder.build + */ + public static void printReflectionClasses() { + TeaBuilder.logHeader("REFLECTION CLASSES: " + REFLECTION_CLASSES.size()); + for(String reflectionClass : REFLECTION_CLASSES) { + TeaBuilder.log(reflectionClass); + } + TeaBuilder.logEnd(); + } + public TeaReflectionSupplier() { } @@ -54,6 +68,7 @@ public Collection getAccessibleFields(ReflectionContext context, String if(cls != null) { if(canHaveReflection(className)) { + REFLECTION_CLASSES.add(className); for(FieldReader field : cls.getFields()) { String name = field.getName(); fields.add(name); @@ -71,6 +86,7 @@ public Collection getAccessibleMethods(ReflectionContext conte } Set methods = new HashSet<>(); if(canHaveReflection(className)) { + REFLECTION_CLASSES.add(className); Collection methods2 = cls.getMethods(); for(MethodReader method : methods2) { MethodDescriptor descriptor = method.getDescriptor(); diff --git a/build.gradle.kts b/build.gradle.kts index 09041187..f358d205 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,10 +18,6 @@ subprojects { maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") } maven { url = uri("https://oss.sonatype.org/content/repositories/releases/") } maven { url = uri("https://oss.sonatype.org/content/repositories/releases/") } - maven { - url = uri("http://teavm.org/maven/repository/") - isAllowInsecureProtocol = true - } maven { url = uri("https://jitpack.io") } } @@ -33,9 +29,7 @@ subprojects { var libProjects = mutableSetOf( project(":backends:backend-teavm"), - project(":extensions:gdx-freetype-teavm"), - project(":tools:generator:core"), - project(":tools:generator:ui") + project(":extensions:gdx-freetype-teavm") ) configure(libProjects) { diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index e4135d6d..8498521e 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -1,12 +1,16 @@ +import java.io.File +import java.util.* + object LibExt { const val groupId = "com.github.xpenatan.gdx-teavm" - val libVersion: String = getVersion("1.0.0", "b8") + + val libVersion: String = getVersion() const val gdxVersion = "1.12.1" - const val teaVMVersion = "0.10.0-dev-1" + const val teaVMVersion = "0.9.2" const val gdxImGuiVersion = "1.0.0-SNAPSHOT" - const val gdxFrameViewportVersion = "1.0.0-SNAPSHOT" + const val gdxMultiViewVersion = "1.0.0-SNAPSHOT" const val reflectionVersion = "0.10.2" const val jettyVersion = "11.0.13" @@ -14,12 +18,17 @@ object LibExt { const val aiVersion = "1.8.2" } -private fun getVersion(releaseVersion: String, suffix: String = ""): String { +private fun getVersion(): String { + val file = File("gradle.properties") + val properties = Properties() + properties.load(file.inputStream()) + val version = properties.getProperty("version") + val isRelease = System.getenv("RELEASE") - var libVersion = "${releaseVersion}-SNAPSHOT" + var libVersion = "-SNAPSHOT" if(isRelease != null && isRelease.toBoolean()) { - libVersion = releaseVersion + if(suffix.isNotEmpty()) "-${suffix}" else "" + libVersion = version } - System.out.println("Gdx-teaVM Version: " + libVersion) + println("gdx-teavm Version: $libVersion") return libVersion } \ No newline at end of file diff --git a/examples/core/teavm/src/main/java/com/github/xpenatan/gdx/examples/teavm/BuildTeaVMTestDemo.java b/examples/core/teavm/src/main/java/com/github/xpenatan/gdx/examples/teavm/BuildTeaVMTestDemo.java index 0ab5b58f..7bf076e0 100644 --- a/examples/core/teavm/src/main/java/com/github/xpenatan/gdx/examples/teavm/BuildTeaVMTestDemo.java +++ b/examples/core/teavm/src/main/java/com/github/xpenatan/gdx/examples/teavm/BuildTeaVMTestDemo.java @@ -19,7 +19,7 @@ public static void main(String[] args) throws IOException { TeaVMTool tool = TeaBuilder.config(teaBuildConfiguration); tool.setMainClass(TeaVMTestLauncher.class.getName()); - tool.setObfuscated(false); + tool.setObfuscated(true); TeaBuilder.build(tool); } } diff --git a/examples/gdx-tests/core/build.gradle.kts b/examples/gdx-tests/core/build.gradle.kts index f36e04f3..fa56f816 100644 --- a/examples/gdx-tests/core/build.gradle.kts +++ b/examples/gdx-tests/core/build.gradle.kts @@ -8,10 +8,10 @@ dependencies { implementation("com.badlogicgames.gdx:gdx-backend-lwjgl3:${LibExt.gdxVersion}") implementation("com.github.xpenatan.gdx-imgui:imgui-core:${LibExt.gdxImGuiVersion}") - implementation("com.github.xpenatan.gdx-imgui:gdx:${LibExt.gdxImGuiVersion}") + implementation("com.github.xpenatan.gdx-imgui:gdx-impl:${LibExt.gdxImGuiVersion}") // Optional - implementation("com.github.xpenatan:gdx-frame-viewport:${LibExt.gdxFrameViewportVersion}") + implementation("com.github.xpenatan.gdx-multi-view:core:${LibExt.gdxMultiViewVersion}") api("com.badlogicgames.gdx:gdx-tests") diff --git a/examples/gdx-tests/core/src/main/java/com/badlogic/gdx/tests/TeaVMGdxTests.java b/examples/gdx-tests/core/src/main/java/com/badlogic/gdx/tests/TeaVMGdxTests.java index be6d0775..b63668a2 100644 --- a/examples/gdx-tests/core/src/main/java/com/badlogic/gdx/tests/TeaVMGdxTests.java +++ b/examples/gdx-tests/core/src/main/java/com/badlogic/gdx/tests/TeaVMGdxTests.java @@ -272,13 +272,13 @@ public GdxTest instance() { // } // } // ); -//// test.add( -//// new TeaVMInstancer() { -//// public GdxTest instance() { -//// return new DownloadTest(); -//// } -//// } -//// ); + test.add( + new TeaVMInstancer() { + public GdxTest instance() { + return new DownloadTest(); + } + } + ); // test.add( // new TeaVMInstancer() { // public GdxTest instance() { diff --git a/examples/gdx-tests/core/src/main/java/com/github/xpenatan/imgui/example/tests/frame/GameFrame.java b/examples/gdx-tests/core/src/main/java/com/github/xpenatan/imgui/example/tests/frame/GameFrame.java index 33af1ea5..31b7ea15 100644 --- a/examples/gdx-tests/core/src/main/java/com/github/xpenatan/imgui/example/tests/frame/GameFrame.java +++ b/examples/gdx-tests/core/src/main/java/com/github/xpenatan/imgui/example/tests/frame/GameFrame.java @@ -5,7 +5,7 @@ import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Rectangle; -import com.github.xpenatan.gdx.frame.viewport.EmuApplicationWindow; +import com.github.xpenatan.gdx.multiview.EmuApplicationWindow; public class GameFrame { public int windowX; diff --git a/examples/gdx-tests/core/src/main/java/com/github/xpenatan/imgui/example/tests/imgui/ImGuiTestsApp.java b/examples/gdx-tests/core/src/main/java/com/github/xpenatan/imgui/example/tests/imgui/ImGuiTestsApp.java index 1bfa342d..290e33d6 100644 --- a/examples/gdx-tests/core/src/main/java/com/github/xpenatan/imgui/example/tests/imgui/ImGuiTestsApp.java +++ b/examples/gdx-tests/core/src/main/java/com/github/xpenatan/imgui/example/tests/imgui/ImGuiTestsApp.java @@ -1,6 +1,5 @@ package com.github.xpenatan.imgui.example.tests.imgui; -import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Screen; import com.badlogic.gdx.graphics.GL20; @@ -8,14 +7,13 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.tests.InputTest; import com.badlogic.gdx.tests.utils.GdxTest; -import com.github.xpenatan.gdx.frame.viewport.EmuFrameBuffer; import com.badlogic.gdx.tests.TeaVMGdxTests; +import com.github.xpenatan.gdx.multiview.EmuFrameBuffer; import com.github.xpenatan.imgui.example.tests.frame.GameFrame; import com.github.xpenatan.imgui.gdx.ImGuiGdxImpl; import com.github.xpenatan.imgui.gdx.ImGuiGdxInputMultiplexer; import imgui.ImDrawData; import imgui.ImGui; -import imgui.ImGuiBoolean; import imgui.ImGuiIO; import imgui.ImVec2; @@ -28,7 +26,6 @@ public class ImGuiTestsApp implements Screen { boolean gdxTestInit = false; - ImGuiBoolean booleanFlag; int selected = -1; private GameFrame gameFrame; @@ -46,8 +43,6 @@ public void show() { camera.setToOrtho(true); batch = new SpriteBatch(); - booleanFlag = new ImGuiBoolean(); - ImGuiIO io = ImGui.GetIO(); // io.setIniFilename(null); @@ -65,18 +60,18 @@ public void show() { gameFrame.emuWindow.setApplicationListener(new InputTest()); ImGuiGdxInputMultiplexer multiplexer = new ImGuiGdxInputMultiplexer(); - multiplexer.addProcessor(gameFrame.emuWindow.getInput()); + multiplexer.addProcessor(gameFrame.emuWindow.getEmuInput()); Gdx.input.setInputProcessor(multiplexer); } private void drawTestListWindow() { if(!gdxTestInit) { gdxTestInit = true; - ImGui.SetNextWindowSize(ImVec2.TMP.set(200, 500)); - ImGui.SetNextWindowPos(ImVec2.TMP.set(900, 20)); + ImGui.SetNextWindowSize(ImVec2.TMP_1.set(200, 500)); + ImGui.SetNextWindowPos(ImVec2.TMP_1.set(900, 20)); } ImGui.Begin("GdxTests"); - ImGui.BeginChildFrame(313, ImVec2.TMP.set(0f, 0f)); + ImGui.BeginChildFrame(313, ImVec2.TMP_1.set(0f, 0f)); for(int i = 0; i < testList.length; i++) { String testName = testList[i].getSimpleName(); boolean isSelected = selected == i; diff --git a/examples/gdx-tests/desktop/build.gradle.kts b/examples/gdx-tests/desktop/build.gradle.kts index 12dcd06a..a5250eb5 100644 --- a/examples/gdx-tests/desktop/build.gradle.kts +++ b/examples/gdx-tests/desktop/build.gradle.kts @@ -1,7 +1,7 @@ dependencies { implementation(project(":examples:gdx-tests:core")) // need to use lwjgl2 because lwjgl3 call makeCurrent and replace Gdx.input used inside gdx wrapper. - implementation("com.badlogicgames.gdx:gdx-backend-lwjgl3:${LibExt.gdxVersion}") + implementation("com.badlogicgames.gdx:gdx-backend-lwjgl:${LibExt.gdxVersion}") implementation("com.badlogicgames.gdx:gdx-platform:${LibExt.gdxVersion}:natives-desktop") implementation("com.github.xpenatan.gdx-imgui:imgui-desktop:${LibExt.gdxImGuiVersion}") diff --git a/examples/gdx-tests/desktop/src/main/java/com/github/xpenatan/imgui/example/tests/Main.java b/examples/gdx-tests/desktop/src/main/java/com/github/xpenatan/imgui/example/tests/Main.java index b8a6dc21..5d459e79 100644 --- a/examples/gdx-tests/desktop/src/main/java/com/github/xpenatan/imgui/example/tests/Main.java +++ b/examples/gdx-tests/desktop/src/main/java/com/github/xpenatan/imgui/example/tests/Main.java @@ -1,23 +1,28 @@ package com.github.xpenatan.imgui.example.tests; -import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; -import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; +import com.badlogic.gdx.backends.lwjgl.LwjglApplication; +import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; +import com.badlogic.gdx.tests.DownloadTest; import com.badlogic.gdx.tests.FloatTextureTest; import com.badlogic.gdx.tests.g3d.MultipleRenderTargetTest; import com.badlogic.gdx.tests.g3d.TextureArrayTest; import com.badlogic.gdx.tests.g3d.TextureRegion3DTest; import com.badlogic.gdx.tests.gles3.InstancedRenderingTest; import com.github.xpenatan.imgui.example.tests.imgui.ImGuiGame; +import com.github.xpenatan.imgui.example.tests.wrapper.TeaVMTestWrapper; public class Main { public static void main(String[] args) { - Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration(); - config.setWindowedMode(1444, 800); - config.setTitle("gdx-tests"); - config.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.GL30, 4, 3); + LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); + config.width = 1444; + config.height = 800; + config.title = "gdx-tests"; + config.gles30ContextMajorVersion = 4; + config.gles30ContextMinorVersion = 3; + config.useGL30 = true; // new Lwjgl3Application(new MultipleRenderTargetTest(), config); // new Lwjgl3Application(new FloatTextureTest(), config); - new Lwjgl3Application(new ImGuiGame(), config); + new LwjglApplication(new TeaVMTestWrapper(), config); } } \ No newline at end of file diff --git a/examples/gdx-tests/teavm/build.gradle.kts b/examples/gdx-tests/teavm/build.gradle.kts index 49430d11..f7811f8e 100644 --- a/examples/gdx-tests/teavm/build.gradle.kts +++ b/examples/gdx-tests/teavm/build.gradle.kts @@ -14,7 +14,7 @@ dependencies { implementation(project(":backends:backend-teavm")) implementation(project(":extensions:gdx-freetype-teavm")) - implementation("com.github.xpenatan.gdx-imgui:core-teavm:${LibExt.gdxImGuiVersion}") + implementation("com.github.xpenatan.gdx-imgui:imgui-teavm:${LibExt.gdxImGuiVersion}") } val mainClassName = "com.github.xpenatan.gdx.examples.teavm.BuildGdxTest" diff --git a/gradle.properties b/gradle.properties index 0a21a4ca..0cb8670e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1 @@ -xUser= -xPass= \ No newline at end of file +version=1.0.0-b9 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 87b738cb..7f93135c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 170811b6..3fa8f862 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index af6708ff..1aa94a42 100644 --- a/gradlew +++ b/gradlew @@ -1,78 +1,127 @@ -#!/usr/bin/env sh +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m"' +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -81,92 +130,120 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" fi +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 6d57edc7..93e3f59f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,4 +1,20 @@ -@if "%DEBUG%" == "" @echo off +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -9,19 +25,23 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +55,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,38 +65,26 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/settings.gradle.kts b/settings.gradle.kts index 23764927..c7758fbf 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,8 +15,8 @@ include(":examples:freetype:desktop") include(":examples:freetype:teavm") // ######### Add libgdx tests to project -// ######### Need to have libgdx project source code tag 1.12.0. -// ######### Need to disable in libgdx settings :tests:gdx-tests-android, :tests:gdx-tests-gwt and :backends:gdx-backend-android because of some conflicts +// ######### Need to have libgdx project source code tag 1.12.1. +// ######### Need to disable in libgdx settings :tests:gdx-tests-gwt because of some conflicts // ######### Need to update assets path in desktop gradle and teavm build class. //include(":examples:gdx-tests:core") @@ -43,9 +43,9 @@ include(":examples:freetype:teavm") //includeBuild("E:\\Dev\\Projects\\java\\gdx-imgui") { // dependencySubstitution { -// substitute(module("com.github.xpenatan.gdx-imgui:imgui-core")).using(project(":imgui:core")) -// substitute(module("com.github.xpenatan.gdx-imgui:imgui-desktop")).using(project(":imgui:desktop")) -// substitute(module("com.github.xpenatan.gdx-imgui:imgui-teavm")).using(project(":imgui:teavm")) +// substitute(module("com.github.xpenatan.gdx-imgui:core")).using(project(":imgui:core")) +// substitute(module("com.github.xpenatan.gdx-imgui:desktop")).using(project(":imgui:desktop")) +// substitute(module("com.github.xpenatan.gdx-imgui:teavm")).using(project(":imgui:teavm")) // substitute(module("com.github.xpenatan.gdx-imgui:gdx")).using(project(":extensions:gdx")) // substitute(module("com.github.xpenatan.gdx-imgui:imlayout-core")).using(project(":extensions:imlayout:imlayout-core")) // substitute(module("com.github.xpenatan.gdx-imgui:imlayout-desktop")).using(project(":extensions:imlayout:imlayout-desktop")) diff --git a/tools/generator/core/build.gradle.kts b/tools/generator/core/build.gradle.kts index ab3907b9..fc00691c 100644 --- a/tools/generator/core/build.gradle.kts +++ b/tools/generator/core/build.gradle.kts @@ -5,7 +5,7 @@ dependencies { implementation(project(":backends:backend-teavm")) implementation("com.github.xpenatan.gdx-imgui:imgui-core:${LibExt.gdxImGuiVersion}") - implementation("com.github.xpenatan.gdx-imgui:gdx:${LibExt.gdxImGuiVersion}") + implementation("com.github.xpenatan.gdx-imgui:gdx-impl:${LibExt.gdxImGuiVersion}") implementation(project(":extensions:gdx-freetype-teavm")) @@ -13,11 +13,11 @@ dependencies { implementation("org.eclipse.jetty:jetty-webapp:${LibExt.jettyVersion}") } -publishing { - publications { - create("maven") { - artifactId = moduleName - from(components["java"]) - } - } -} +//publishing { +// publications { +// create("maven") { +// artifactId = moduleName +// from(components["java"]) +// } +// } +//} diff --git a/tools/generator/desktop/build.gradle.kts b/tools/generator/desktop/build.gradle.kts index d5f32c50..5240eb5c 100644 --- a/tools/generator/desktop/build.gradle.kts +++ b/tools/generator/desktop/build.gradle.kts @@ -6,8 +6,8 @@ dependencies { implementation("com.badlogicgames.gdx:gdx-backend-lwjgl:${LibExt.gdxVersion}") implementation("com.github.xpenatan.gdx-imgui:imgui-core:${LibExt.gdxImGuiVersion}") - implementation("com.github.xpenatan.gdx-imgui:gdx:${LibExt.gdxImGuiVersion}") implementation("com.github.xpenatan.gdx-imgui:imgui-desktop:${LibExt.gdxImGuiVersion}") + implementation("com.github.xpenatan.gdx-imgui:gdx-impl:${LibExt.gdxImGuiVersion}") } tasks.register("runGenerator") { diff --git a/tools/generator/desktop/src/main/java/com/github/xpenatan/gdx/html5/generator/ImGuiRenderer.java b/tools/generator/desktop/src/main/java/com/github/xpenatan/gdx/html5/generator/ImGuiRenderer.java index 351234da..6d94788d 100644 --- a/tools/generator/desktop/src/main/java/com/github/xpenatan/gdx/html5/generator/ImGuiRenderer.java +++ b/tools/generator/desktop/src/main/java/com/github/xpenatan/gdx/html5/generator/ImGuiRenderer.java @@ -3,10 +3,10 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.ScreenAdapter; import com.badlogic.gdx.graphics.GL20; -import com.github.xpenatan.imgui.gdx.ImGuiGdxImpl; -import com.github.xpenatan.imgui.gdx.ImGuiGdxInputMultiplexer; import imgui.ImDrawData; import imgui.ImGui; +import imgui.gdx.ImGuiGdxImpl; +import imgui.gdx.ImGuiGdxInputMultiplexer; public abstract class ImGuiRenderer extends ScreenAdapter { diff --git a/tools/generator/ui/build.gradle.kts b/tools/generator/ui/build.gradle.kts index fcd4034a..3bd64279 100644 --- a/tools/generator/ui/build.gradle.kts +++ b/tools/generator/ui/build.gradle.kts @@ -6,7 +6,7 @@ dependencies { implementation(project(":backends:backend-teavm")) implementation("com.github.xpenatan.gdx-imgui:imgui-core:${LibExt.gdxImGuiVersion}") - implementation("com.github.xpenatan.gdx-imgui:gdx:${LibExt.gdxImGuiVersion}") + implementation("com.github.xpenatan.gdx-imgui:gdx-impl:${LibExt.gdxImGuiVersion}") implementation(project(":extensions:gdx-freetype-teavm")) @@ -14,11 +14,11 @@ dependencies { implementation("org.eclipse.jetty:jetty-webapp:${LibExt.jettyVersion}") } -publishing { - publications { - create("maven") { - artifactId = moduleName - from(components["java"]) - } - } -} \ No newline at end of file +//publishing { +// publications { +// create("maven") { +// artifactId = moduleName +// from(components["java"]) +// } +// } +//} \ No newline at end of file diff --git a/tools/generator/ui/src/main/java/com/github/xpenatan/teavm/generator/ui/view/GeneratorView.java b/tools/generator/ui/src/main/java/com/github/xpenatan/teavm/generator/ui/view/GeneratorView.java index 669dea4f..22dbf5e8 100644 --- a/tools/generator/ui/src/main/java/com/github/xpenatan/teavm/generator/ui/view/GeneratorView.java +++ b/tools/generator/ui/src/main/java/com/github/xpenatan/teavm/generator/ui/view/GeneratorView.java @@ -5,7 +5,6 @@ import com.badlogic.gdx.graphics.Color; import com.github.xpenatan.teavm.generator.core.viewmodel.GeneratorViewModel; import imgui.ImGui; -import imgui.ImGuiBoolean; import imgui.ImGuiCol; import imgui.ImGuiInternal; import imgui.ImGuiItemFlags; @@ -13,6 +12,7 @@ import imgui.ImGuiStyleVar; import imgui.ImGuiWindowFlags; import imgui.ImVec2; +import imgui.idl.helper.IDLBool; public class GeneratorView { private static final String PREF_JAR_PATH = "jarPath"; @@ -46,7 +46,7 @@ public class GeneratorView { private final ImGuiString appClassName; private final ImGuiString assetsDirectory; private final ImGuiString webappDirectory; - private final ImGuiBoolean obfuscateFlag; + private final IDLBool obfuscateFlag; public GeneratorView() { preferences = Gdx.app.getPreferences("gdx-html5-generator"); @@ -60,7 +60,7 @@ public GeneratorView() { appClassName = new ImGuiString(); assetsDirectory = new ImGuiString(); webappDirectory = new ImGuiString(); - obfuscateFlag = new ImGuiBoolean(); + obfuscateFlag = new IDLBool(); loadPreference(); } @@ -72,7 +72,7 @@ private void loadPreference() { appClassName.setValue(preferences.getString(PREF_APP_CLASS_NAME, "")); assetsDirectory.setValue(preferences.getString(PREF_ASSET_PATH, "")); webappDirectory.setValue(preferences.getString(PREF_WEBAPP_PATH, "")); - obfuscateFlag.setValue(preferences.getBoolean(PREF_JAR_PATH, false)); + obfuscateFlag.set(preferences.getBoolean(PREF_JAR_PATH, false)); } private void savePreference() {