Giter Club home page Giter Club logo

korge-plugins's Introduction

Plugins for KorGE

Download

Gradle plugin:

./gradlew publishToMavenLocal
./gradlew publish

korge-plugins's People

Contributors

arnis71 avatar emign avatar soywiz avatar yincrash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

korge-plugins's Issues

Task "runJvm" throws error on Gradle 6.4 and later

When trying to run the task the following error is thrown:
"The value for task ':runJvm' property 'mainClass' is final and cannot be changed any further."

I have tested the build with gradle 6.3, 6.4 and 6.5 and only after version 6.4 does this error occur.

org.apache.velocity.exception.VelocityException: Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.

On creating a brand new Korge Plugin Project on windows 10 Pro x64 in a VM on a mac host.

org.apache.velocity.exception.VelocityException: Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.
	at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:875)
	at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:262)
	at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:93)
	at com.soywiz.korge.intellij.util.TemplateExtKt.renderTemplate(TemplateExt.kt:10)
	at com.soywiz.korge.intellij.module.KorgeModuleConfig.generate(KorgeModuleConfig.kt:50)
	at com.soywiz.korge.intellij.module.KorgeModuleBuilder$setupRootModel$1$1.invokeSuspend(KorgeModuleBuilder.kt:46)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:270)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:79)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:54)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:36)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at com.soywiz.korge.intellij.module.KorgeModuleBuilder$setupRootModel$1.invoke(KorgeModuleBuilder.kt:45)
	at com.soywiz.korge.intellij.module.KorgeModuleBuilder$setupRootModel$1.invoke(KorgeModuleBuilder.kt:18)
	at com.soywiz.korge.intellij.util.UtilsKt$backgroundTask$1.run(Utils.kt:100)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:888)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:163)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:150)
	at com.intellij.openapi.progress.impl.CoreProgressManager$4.lambda$run$0(CoreProgressManager.java:402)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:221)
	at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:402)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.
	at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:220)
	at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:269)
	at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:871)
	... 31 more
Caused by: java.lang.RuntimeException: Error configuring Log4JLogChute : 
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at org.apache.velocity.util.ExceptionUtils.createWithCause(ExceptionUtils.java:67)
	at org.apache.velocity.util.ExceptionUtils.createRuntimeException(ExceptionUtils.java:45)
	at org.apache.velocity.runtime.log.Log4JLogChute.initAppender(Log4JLogChute.java:133)
	at org.apache.velocity.runtime.log.Log4JLogChute.init(Log4JLogChute.java:85)
	at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:157)
	... 33 more
Caused by: java.io.FileNotFoundException: velocity.log (Zugriff verweigert)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:158)
	at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
	at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
	at org.apache.log4j.FileAppender.<init>(FileAppender.java:110)
	at org.apache.log4j.RollingFileAppender.<init>(RollingFileAppender.java:79)
	at org.apache.velocity.runtime.log.Log4JLogChute.initAppender(Log4JLogChute.java:118)
	... 35 more

Support defining multiple entry points

Provide a way for a single project to create multiple entry points (runJvm, runJs etc). Also register a class type like JvmExec That autosets the classpath to the right value

Can't build iOS target due to absence of resources folder

When building iOS target build fails with
error: /../build/combinedResources/resources: No such file or directory (in target 'app-Arm64-Debug' from project 'app')
or more precisely The following build commands failed: PBXCp /../build/combinedResources/resources /../build/platforms/ios/app.xcodeproj/build/Build/Products/Debug-iphoneos/unnamed.app/include/app/resources

This is due to

doFirst {
	combinedResourcesFolder.mkdirs()
}

not being triggered in copyIosResources task. Moving folder creation to configuration stage does not help as gradle marks this directory as stale and deletes it before the PBXCp runs.

cannot build android aar project from scratch because no local.properties existence

OS: Mac
Android SDK location on local.properties: sdk.dir=/Users/pablocaviglia/Library/Android/sdk
Gradle task: buildAndroidAar
Exception:

`> Task :prepareAndroidBootstrap FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':prepareAndroidBootstrap'.

java.io.FileNotFoundException: /Users/pablocaviglia/devel/projects/tool_framework_multi_platform/build/platforms/android/local.properties (No such file or directory)
`
The attached image is the structure created when the project got built from scratch (after clean task).

image

The only way to make it work is to create by hand the following structure:

$project/build/platforms/android/

and by adding a valid local.properties file.

packageJvmFatJarProguard is broken

java -jar build/libs/korge-hello-world-all-proguard.jar 
screenWidth: 1920, screenHeight: 1080, winX=704, winY=284
VI: native@0x7f0f5446db40, d: native@0x7f0f54431ab0 (com.sun.jna.platform.unix.X11$Display@544399bf), w: 0x4c00001, glc: native@0x7f0f5446ddd0
GL_VENDOR: Intel Open Source Technology Center
GL_VERSION: 3.0 Mesa 19.2.8
keysim: 0x41
Korge gameWindow.loop completed
Exception in thread "main" java.lang.Error: Structure.getFieldOrder() on class com.sun.jna.platform.unix.X11$XAnyEvent does not provide enough names [0] ([]) to match declared fields [5] ([display, send_event, serial, type, window])
        at com.sun.jna.Structure.getFields(Unknown Source)
        at com.sun.jna.Structure.deriveLayout(Unknown Source)
        at com.sun.jna.Structure.calculateSize(Unknown Source)
        at com.sun.jna.Structure.allocateMemory(Unknown Source)
        at com.sun.jna.Structure.ensureAllocated(Unknown Source)
        at com.sun.jna.Structure.ensureAllocated(Unknown Source)
        at com.sun.jna.Structure.size(Unknown Source)
        at com.sun.jna.Structure.size(Unknown Source)
        at com.sun.jna.Native.getNativeSize(Unknown Source)
        at com.sun.jna.Structure.getNativeSize(Unknown Source)
        at com.sun.jna.Structure.getNativeSize(Unknown Source)
        at com.sun.jna.Structure.validateField(Unknown Source)
        at com.sun.jna.Structure.validateFields(Unknown Source)
        at com.sun.jna.Structure.<init>(Unknown Source)
        at com.sun.jna.Structure.<init>(Unknown Source)
        at com.sun.jna.Structure.<init>(Unknown Source)
        at com.sun.jna.Structure.<init>(Unknown Source)
        at com.sun.jna.Union.<init>(Unknown Source)
        at com.sun.jna.platform.unix.X11$XEvent.<init>(Unknown Source)
        at com.soywiz.korgw.x11.d.a(Unknown Source)
        at com.soywiz.h.a.a(Unknown Source)
        at com.soywiz.h.a.a(Unknown Source)
        at MainKt.main(Unknown Source)
        at a.a(Unknown Source)
        at a.c.a.d.b_(Unknown Source)
        at a.c.b.a.a.a_(Unknown Source)
        at a.c.g.a(Unknown Source)
        at a.c.b.a.g.a(Unknown Source)
        at MainKt.main(Unknown Source)

Read local.properties to get sdk.dir

Here:

//Linux: ~/Android/Sdk
//Mac: ~/Library/Android/sdk
//Windows: %LOCALAPPDATA%\Android\sdk
val Project.androidSdkPath: String by lazy {
val userHome = System.getProperty("user.home")
listOfNotNull(
System.getenv("ANDROID_HOME"),
"$userHome/AppData/Local/Android/sdk",
"$userHome/Library/Android/sdk",
"$userHome/Android/Sdk"
).firstOrNull { File(it).exists() } ?: error("Can't find android sdk (ANDROID_HOME environment not set and Android SDK not found in standard locations)")
}

v1.4.2 breaks runJS target (missing js and map files)

My project perfectly runs in the JS target in version 1.4.1 but fails in 1.4.2 with these errors:

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (favicon.ico, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (korgw-root-korgw.js, line 0)
[Error] Error: Script error for "korgw-root-korgw", needed by: work-root-korge
http://requirejs.org/docs/errors.html#scripterror
	defaultOnError (require.min.js:1:935)
	c (require.min.js:1:3260)
	onScriptError (require.min.js:1:13218)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (klogger-root-klogger.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (korim-root-korim.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (kmem-root-kmem.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (kds-root-kds.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (engineEmi.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (korinject-root-korinject.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (work-root-korge.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (korma-root-korma.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (work-root-korgw.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (kotlin.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (klock-root-klock.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (kbox2d-root-kbox2d.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (work-root-korge-box2d.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (korau-root-korau.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (korio-root-korio.js.map, line 0)

runJs doesn't update

The first time works fine, but updating the code and calling again fails to update. This started to failing later versions so it is a regression. Probably something changed on the kotlin plugin

KorgeGradlePlugin changes the project version

Hello and thank you for your awesome game engine.

When you apply the plugin in Gradle, the project version is set to "4.10.1". This was very frustrating when using the maven-publish plugin (the version was always 4.10.1). I'm not a Gradle expert, but it seems a bug to me.

To reproduce the issue, download the korge-hello-world project and add the following lines around apply<KorgeGradlePlugin>() in build.gradle.kts:

version = "0.1"
println(version)
apply<KorgeGradlePlugin>()
println(version)

Output is:

> Configure project :
0.1
Kotlin Multiplatform Projects are an experimental feature.
4.10.1

Tested with versions 1.14.0.0 & 1.15.0.0 of the plugin.

The workaround I found is to set the version of the project after applying the plugin.

Add support for MP modules as dependencies for Android target

I am trying to make a simple game with Korge but I ran into a problem where I can not build for Android target when my game module game depends on another multiplatform module data. Take a look here https://github.com/arnis71/SpaceGame.

It has one data class that I want to use on the backend and in the game called Projectile. It sees this class in game module in IDE and even runs the jvm target. But when I try to start it on android emulator it fails at :android:compileDebugKotlin and says that it can not find this Projectile class.

Possible solution is to include all dependency modules sources to generated build.gradle

Forcing ZGC on potentially unsupported systems

Right now, runJVM runs ZGC if the Java version is 14+. Not all systems running 14+ support ZGC. For instance, I'm running Windows 8.1, which meets the requirements of Java 14, but when I run runJVM the task fails with ZGC requires Windows version 1803 or later.

I tried looking for a way to add a check for ZGC support in Jvm.kt, but no luck. Could grab the os.name and os.version from system properties, but maybe it's better to just modify the check to allow JVM_USE_ZGC to be explicitly false?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.