Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building the editor? #33

Open
wolpert opened this issue Nov 22, 2015 · 2 comments
Open

Building the editor? #33

wolpert opened this issue Nov 22, 2015 · 2 comments
Labels

Comments

@wolpert
Copy link

wolpert commented Nov 22, 2015

Just saw the move of PBE from google to git... looks like the change to gradle is a good start, but it looks like we lost the building of the executable jar file in the move from maven. (Unless I missed the gradle tasks)

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28520323-building-the-editor?utm_campaign=plugin&utm_content=tracker%2F23699865&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F23699865&utm_medium=issues&utm_source=github).
@Cervator
Copy link
Member

Hi @wolpert :-)

Did you check out the develop branch? We got far enough with Gradle to where it compiles and runs, but then IIRC there was an issue interacting with LibGDX / OpenGL in some situations. @PrivateAlpha was investigating but was drawn away for something else for the time being.

We haven't gone beyond that point yet so the editor isn't quite functional again yet, at least not for me. So building a proper jar in our Jenkins etc is beyond that.

Gradle will by default include a bunch of tasks with the Java plugin, including a jar builder, "gradlew jar" should do it as-is, I just don't think it'll work. If you're up for helping feel free! We need more contributors :-)

@dlon
Copy link

dlon commented Apr 20, 2018

I managed to build a runnable jar using the following task:

diff --git a/editor/build.gradle b/editor/build.gradle
index ea6b97c..49db10e 100644
--- a/editor/build.gradle
+++ b/editor/build.gradle
@@ -57,6 +57,17 @@ task run(type: JavaExec) {
     ignoreExitValue = true
 }

+task dist(type: Jar) {
+    from files(sourceSets.main.output.classesDir)
+    from files(sourceSets.main.output.resourcesDir)
+    from {configurations.compile.collect {zipTree(it)}}
+
+    manifest {
+        attributes 'Main-Class': project.mainClassName,
+                'Class-Path': sourceSets.main.runtimeClasspath
+    }
+}
+
 idea {
     module {
         // Change around the output a bit

It seems to cause issues at times, but I didn't look into why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants