How would i turn kyuubieditor and kyuubiforge into seperate projects?
I looked up tutorials and so on but these things dont work for me.
Kyuubiforge is a dependency for kyuubieditor.
Thanks for the help!
I looked up tutorials and so on but these things dont work for me.
Kyuubiforge is a dependency for kyuubieditor.
Thanks for the help!
Why don’t the tutorials you found not work for you?
If you don’t provide more details it is highly probably that you get the same advise here, that you got from those tutorials.
So in this tutorial they show this file structure:
.
├── app
│ ...
│ └── build.gradle
└── settings.gradle
Does this mean there is another gradle project which would be the main project and app is a subproject?
This structure means you have two projects, correct.
The root project and a subproject called app
.
You would e.g. have an empty root project like in that tutorial, a subproject called kyuubiforge
and a subrpoject called kyuubieditor
.
Figured it out thx!
is there a way i can setup a task that compiles kyuubiforge and then packages it with kyuubieditor into one jar that can be executed? (as an .exe or with the java command)
So currently i have my build.gradle for kyuubiforge looking like this:
package justuswalterhelk.kyuubiforge
plugins {
id 'java'
id 'application'
}
repositories {
mavenCentral()
}
project.ext.lwjglVersion = "3.3.1"
project.ext.jomlVersion = "1.10.5"
project.ext.lwjglNatives = "natives-windows"
dependencies {
implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
implementation "org.lwjgl:lwjgl"
implementation "org.lwjgl:lwjgl-assimp"
implementation "org.lwjgl:lwjgl-glfw"
implementation "org.lwjgl:lwjgl-nfd"
implementation "org.lwjgl:lwjgl-openal"
implementation "org.lwjgl:lwjgl-opengl"
implementation "org.lwjgl:lwjgl-stb"
runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-assimp::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-nfd::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-openal::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-stb::$lwjglNatives"
implementation "org.joml:joml:${jomlVersion}"
}
thats my build.gradle from my main project:
plugins {
id 'java'
id 'application'
}
group 'io.github.justuswalterhelk'
version '1.0-SNAPSHOT'
the settings.gradle:
rootProject.name = 'Kyuubi'
include 'kyuubieditor'
include 'kyuubiforge'
but now when i run .\gradlew run i get errors saying that my dependencys dont exist.
I use IntelliJ and it does not seem that it handles the directorys as gradle projects. Is it normal that im missing tasks?
Edit:
When i try to run the dependencies task i get this:
Could not set process working directory to 'C:\Users\Kreiseljustus\Desktop\dev\java\Foxfire\kyuubieditor': could not set current directory (errno 2)
is there a way i can setup a task that compiles kyuubiforge and then packages it with kyuubieditor into one jar that can be executed? (as an .exe or with the java command)
There are ways, but I strongly recommend not to use them, but use the application
plugin as you already found out. Well, you should probably not apply it to all projects, but only to the project that is the application with the main
method and the other should probably use java-library
, not java
.
When i try to run the dependencies task i get this:
No idea what you did so that the current directory cannot be set.
Out of the blue I’d guess you are in that directory with a command line but have deleted the directory.
But just a wild guess.
but now when i run .\gradlew run i get errors saying that my dependencys dont exist.
An abstract description of an error message is most often totally useless to get help.
I use IntelliJ and it does not seem that it handles the directorys as gradle projects.
Your screenshot shows it does
Is it normal that im missing tasks?
You probably do not have anything in your kyuubieditor build script?
Just guessing though as you did not share enough information.
Btw. don’t abuse “extra” properties for local variables. Just use def
in Groovy DSL or val
in Kotlin DSL. And for the versions actually don’t do either, but better us a version catalog.
So i fixed the issues you mentioned with the plugins.
I just noticed that when i build the main project it tries to build all the sub projects… is this normal?
The error i mentioned with the dependencys means that the dependencys cant be found in the code (the package does not exist)
I tried adding a new task to kyuubieditor to see if it would show up in the gradle task window. It doesnt
package justuswalterhelk.kyuubieditor
plugins
{
id 'java'
id 'application'
}
dependencies {
implementation project(':kyuubiforge')
}
task compile{
println("Compiling editor")
}
I think i found the error!
Gradle is trying to set the working directory to
C:\Users\Kreiseljustus\Desktop\dev\java\Foxfire\kyuubieditor
but the right path should be
C:\Users\Kreiseljustus\Desktop\dev\java\Foxfire\src\main\java\justuswalterhelk\kyuubieditor
Is there a easy way to fix this
I just noticed that when i build the main project it tries to build all the sub projects… is this normal?
Depends on what you mean when you say “build”. If you execute ./gradlew build
it is normal that it executes the task build
in all projects that have a task with that name as you didn’t specify in which project you want to execute that task. If you would do ./gradlew :build
it would only execute the build
task in the root project.
The error i mentioned with the dependencys means that the dependencys cant be found in the code (the package does not exist)
Hard to guess if you don’t provide the full project. You most probably did something wrong.
I tried adding a new task to kyuubieditor to see if it would show up in the gradle task window. It doesnt
Maybe you didn’t successfully sync the project?
Btw. that innocent little task has several flaws, like not using task configuration avoidance and the println
being executed at configuration time, not execution time, to just name two of them.
but the right path should be
It’s unlikely that this is the right path.
If that were the project directory, that would a very awkward and totally non-standard project layout.
You would need to do some configuration to change that, like changing the project directory in the settings script and additionally changing the Java source directory.
But the much easier and much more appropriate solution is to use the default conventions and move your files into shape.
Your code for example should be in C:\Users\Kreiseljustus\Desktop\dev\java\Foxfire\kyuubieditor\src\main\java\justuswalterhelk\kyuubieditor
.
Also where do you have the build script?
If you have it in C:\Users\Kreiseljustus\Desktop\dev\java\Foxfire\src\main\java\justuswalterhelk\kyuubieditor
, then you shouldn’t wonder you miss your tasks, as that is not where you configured it to be. You configured it to be C:\Users\Kreiseljustus\Desktop\dev\java\Foxfire\kyuubieditor\build.gradle
or what I usually recommend C:\Users\Kreiseljustus\Desktop\dev\java\Foxfire\kyuubieditor\build.gradle.kts
.
Just remembered the repo is actually public.
Heres the link if you want to take a look at it: GitHub - Spitfox/Kyuubi-Engine