paulwedeck/settlers-remake

Project build fails

Closed this issue · 7 comments

I cloned the project then tried to build the Swing version on my Ubuntu 20 Desktop..

Following https://github.com/paulwedeck/settlers-remake/wiki/Compiling-using-gradle I ran
./gradlew :assembleDist but got an error.

$ ./gradlew  :assembleDist
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.3.3/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build 
WARNING: Android is disabled.
To enable Android build, download the Android SDK. Then create a file local.properties with the following content:
    sdk.dir=<path to sdk>

FAILURE: Build failed with an exception.

* What went wrong:
Task 'assembleDist' not found in root project 'settlers-remake'.

* Try:
> Run gradlew tasks to get a list of available tasks.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
2 actionable tasks: 2 up-to-date
$

Checking the Github action file, I then switched to another command

$ ./gradlew release test --info
[...]
All projects evaluated.
Selected primary task 'release' from project :

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':release'.
> Task with path 'releaseAndroid' not found in root project 'settlers-remake'.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
2 actionable tasks: 2 up-to-date
hiran@silver:~/NetBeansProjects/settlers-remake$

So how can the project be correctly built?

Oops - looking at the logs of the Github actions at
https://github.com/paulwedeck/settlers-remake/actions
it seems all the automatic builds are failing as well.

No just some tests are failing. The AI tests are currently broken (but the AI itself is not) and I have not yet found time to debug it.
There is also the BuildingsConfigurationsTest which only indicates that some xml files are invalid in ways that usually don't trigger a bug (they should still be fixed like all failing tests).

Your issue is that you haven't installed the android sdk and the release task depends on the android module.
I am not entirely sure if its actually possible to build without android support but if it is you want to execute the task releaseJSettlers

I am pretty sure it is possible to build without android - after all gradlew run compiles and runs the game. I want to create a release to actually obtain JSettlers.jar and the dependencies. With them I thought to add a call to JPackage to build into platform dependent installable applications - deb (Linux), dmg (mac), msi (windows).
But I have to admit I never used Gradle before so am trying my way there.

Ah, reading your comment again, I realize you mention building releaseJSettlers. That seems to do the trick, and I had to search a bit for the output directory. I'll try to take it from here. It might be great if such information were available in the documentation.

It might be great if such information were available in the documentation.

I agree that having a documentation would be nice but there is nobody that knows all the details and I can only really write about the code I have worked with which is mostly the graphics and logic part but admittedly I have not yet done so (the Movable creation page is a first step).
The big issue with the existing documentation is that its not just incomplete but also partially outdated (the wiki entries concerning the actual code are mostly accurate) and there isn't any real way of knowing if some documentation is correct without checking if it does work like its described.

Well, as mentioned above I followed https://github.com/paulwedeck/settlers-remake/wiki/Compiling-using-gradle but it did not work out. Now all there is to it is to mention that either Android SDK must be configured or the target to execute is releaseJSettlers.

I've seen your update on the wiki. I think with that we can close this issue. :-)