Can someone help me get converted over to Git?

Hi Folks - I’ve previously been successfully pulling down Vassal code from the SVN site. Hadn’t ever gotten involved in trying to check anything in, but was always able to pull down and run.

Today I decided it was time to get going on 3.3 and Git, and with some much-appreciated helpful hints from Brent I seem to have gotten “part way”.

But I now seem to be stuck on “Eclipse issues”, and I’m hoping some of you folks who actually understand how Java IDE’s work can get me over the hump.

So, first screenie, we have my “Packages view” with all my old stuff in it. Can see my custom classes, and down below are various earlier versions of Vassal I’d pulled from SVN. All mostly behaving:
[attachment=2]Screen1-Packages.jpg[/attachment]

Meanwhile I have successfully gotten to here (second screenie) in terms of telling Git to wake up and make me a copy of the main Vassal repository:
[attachment=1]Screen2-git.png[/attachment]

So of course what I WANT is to have some buildable version of Vassal that appears in my Packages view. When I go to that view and select “Import”, and tell it I want to import from Git, I reach the following screen:
[attachment=0]Screen3-import.png[/attachment]

I click the “Finish” button and then… apparently nothing happens. No error. But no project.

So I can’t figure out what I’m doing wrong. I’m sure it’s completely boneheaded and I will be the first to admit that the Java IDE completely confounds me at almost every turn – yet I always used to find Visual Studio so intuitive.

Any help getting back going would be greatly appreciated! I have a couple minor bugfixed I could probably contribute to 3.3.1+ if I can get things straightened back out.

One OTHER question – once I have this solved, and I want to fork whatever branch on Github so that I can eventually put together a PR or whatever, where do I do that? (I mean: can I do it from inside Eclipse or do I need to log into Github and handle it there?) Any special procedures? (Although I dealt with source control for decades, the last time I needed to check IN code was approximately 10 years ago today… and now my hobby has caught back up with me)

Brian

First question, I haven’t used Eclipse in a while but what you’re doing looks correct, you have what Eclipse calls a “workspace”, you cloned the github repo onto your hard drive, then import from file system into the workspace. Import it as an Eclipse project, this is also correct as there already are Eclipse files in the code. This should be working but as usual with computers, there’s probably some small detail missing. If no one else knows a solution I’ll install Eclipse and write up a step by step guide.

Second question:

  • sign up on GitHub
  • configure git locally to know who you are on github, I followed this guide for this: help.github.com/en/github/getti … set-up-git
  • fork the project (the “fork” button here at the top help.github.com/en/github/getti … ork-a-repo, including the “git remote add upstream” part, and btw if you have git on the command line, it’s much easier to follow these guides by doing all this on the command line, else you have to spend time finding the exact same things in the eclipse git plugin

Then, for a PR:

  • create a local branch of master
  • do your changes in that branch, several commits, whatever
  • when you think you’re done, push that branch, it will be pushed into your github vassal repo
  • log into github, it will have detected a new branch and offer you to make it into a PR, you click that option, write a summary and confirm, you will see that it says something like “put cattlesquat/vassal/mybranch into vassalengine/vassal/master”
  • then it shows up as a PR in the original vassal repo
  • then someone looks at it and requests changes, you will see that on github
  • you apply the changes locally, i.e. add some more commits to that local branch
  • push the local branch, and the changes will automatically get added to the PR
  • then possibly some more iterations of “changes requested” and “change locally, push branch”
  • and at some point the PR will get accepted, then you can delete the branch both on github and locally

Also, keep the “master” branch of your github and your local clone in sync with the original vassalengine/vassal branch, I regularly do these steps:

  • on my local clone, update remotes (I do this in my IDE, I think it does a “git fetch upstream”?)
  • then merge remote/master into my local/master, this makes my local master branch equal with vassalengine/vassal/master
  • then push my local/master, this makes my github/master equal with vassalengine/vassal/master

Probably too much info and a bit vague, maybe it makes sense to write up a proper step by step guide with command line commands.

Okay thank you very much. On the strength of you saying I seemed to be on the right path, I “persisted” and I guess managed to activate the sequence through a different menu or something, and anyway on around the 6th try it suddenly “worked”.

So the NEXT problem turns out to be… getting it to build. I seem to have some errors, not zillions but some. Here is an example of one error.

[attachment=1]Screen4-errors.jpg[/attachment]

Maybe I’ve got the wrong JRE or some other wrong thing in the build configuration? It looked like it came wanting 14.0.1 so I downloaded that. But don’t know if I need to specially configure it to compile Java 11 or something?

Or maybe something else is missing?

Here is part of my library build config screen:
[attachment=0]Screen5-libraries.png[/attachment]

And here is part of my build order screen:

Brian

Okay I apparently needed to go manually tell it to compile for Java 11 even though installed as Java 14 JRE.

W/r/t Vassal tree itself, that leaves me with a single build error, apparently something missing.

Anybody know where to find/include THIS?

[attachment=1]Screen-7 deferralmgr.png[/attachment]

There are also some “test” modules in the tree that have lots of big red X’s on them. Should I just be excluding them from the build path? Or is there more stuff I’m missing?

Here is an example from the X-iest one:
[attachment=0]Screen8-test.png[/attachment]

Again thanks very very much for any help.

BTW the idea of a step-by-step list on how to get this set up sounds glorious - something to put in the Wiki, maybe under the Engine Development section, e.g. “How to Get Started Developing for Vassal”. For those of us who have a programming background and can do plenty of useful stuff once they have “a working toy to improve”, but couldn’t figure out which of the 245 checkboxes to check on an IDE to save their life… :slight_smile:

Brian

Oh my, this is the exact kind of Eclipse problems that I ran away from a couple years ago by switching to IntelliJ :smiley:

One big problem with Eclipse is that it uses its own compiler “eclipsec” to compile the projects in the workspace. IntelliJ uses the default javac, same that is used during the regular build process.

And Eclipse is very dumb at times and needs to be told several times until it gets things right. Your project getting imported on the 6th try sounds like the usual Eclipse experience. Next problem shouldn’t be there, the code is imported, packages recognized, the libs all look good, the JRE is also there. It should work, or not work at all, either find no errors or find errors in every single class. Try the usual Eclipse procedure: do “Clean project” a couple times, it’s somewhere in the menu, it should rebuild everything and hopefully the errors will go away.

Also, this may sound like stupid advice but have you considered switching to IntelliJ? It runs much faster, supports Java better, supports Git, Github, Maven, out of the box. Doesn’t use anything like “eclipsec”, it compiles exactly like a compilation on the console would happen. The community edition is free and already is better than the regular Eclipse Java IDE. And it’s a pure Java IDE, while Eclipse at it’s core is a framework for building desktop applications, and the Eclipse Java IDE runs on top of that framework so if you use that you always have this whole framework underneath using up valuable resources.

Also, if my PR with the switch to Maven gets accepted, it will possibly/probably get rid of these IDE configuration problems and replace them with a standard way of how a project is configured in any IDE.

Edit: oh yes the java2d thing, the project needs certain compiler parameters to be set, look here github.com/vassalengine/vassal/ … kefile#L69:

--add-exports java.desktop/sun.java2d.cmm=ALL-UNNAMED --add-exports java.desktop/java.awt.peer=ALL-UNNAMED --add-exports java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED --add-exports java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED

But I don’t know how to set them in Eclipse :frowning:

Is “sun.java2d.cmm” something I have to go download somewhere? Or is it something I’d already “have” and just have to link in?

Because my one remaining build error in Vassal is that this package doesn’t seem to exist. It’s failing the “import” statement!

The funny thing is it doesn’t seem to think the import is even being referenced (it is offering me the “quick fix” of “remove unused import”)

(Correction it looks like it is being used in one line)

Nope no need to download anything, this is due to the compiler argument not being set.

If the error is in ImageIOImageLoader then the “remove unused Import” is a bad advice, the code references sun.java2d.cmm.ProfileDeferralMgr in line 124: github.com/vassalengine/vassal/ … .java#L124

Try setting these flags, or at least the first flag with sun.java2d:

--add-exports java.desktop/sun.java2d.cmm=ALL-UNNAMED --add-exports java.desktop/java.awt.peer=ALL-UNNAMED --add-exports java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED --add-exports java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED

To set these, try to do it like here, look at the “Expose package” option: eclipse.org/eclipse/news/4. … pendencies

Or like here: stackoverflow.com/a/54071487

Excellent, thank you! I have put a screenshot For Any Future Victims (or for your upcoming how-to-get-going article) of where and what I needed to do.

Main “Vassal” now builds. Do you know anything about these “test” things? They’re the last things I can’t build. Are they important? Should I just delete them from my tree? Or are they working for you if they get set up right?

Many thanks for the help, much progress being made.

[attachment=0]Screen9-module.png[/attachment]

Also, ALAS, although I can “build” VASSAL, I cannot “run” it because of:


Error occurred during initialization of boot layer
java.lang.RuntimeException: Unable to parse --add-exports =: java.desktop/sun.java2d.cmm=

So the build part is so far just “masking” the problem and it won’t actually run. SIGH.

Thus spake Cattlesquat:

[This message has been edited.]

Also, ALAS, although I can “build” VASSAL, I cannot “run” it because of:

__
Error occurred during initialization of boot layer
java.lang.RuntimeException: Unable to parse --add-exports
=: java.desktop/sun.java2d.cmm=

That’s because the whole argument you need for the --add-exports flag is
this:

java.desktop/sun.java2d.cmm=ALL-UNNAMED

It’s failing because you’re missing everything after the equals sign.


J.

Brent ought to be able to suggest what you should do here, as he’s also an Eclipse user.

Thus spake Cattlesquat:

Main “Vassal” now builds. Do you know anything about these “test”
things? They’re the last things I can’t build. Are they important?
Should I just delete them from my tree? Or are they working for you if
they get set up right?

The tests directory has tests in it which I run using ‘make test’ from
the command line, which compiles everything under test and then runs

java -classpath … org.junit.runner.JunitCore …bunch of class names…

Brent, what’s your setup like in Eclipse with the tests?

(Note: This is all going to be completely different if we switch over
to building with maven…)


J.

Thank you so much Joel – that clue was enough to get me over the next hump – I needed to fill the ALL-UNNAMED into the lower field of the dialog box on the module dependencies (but there was no hint at all in the esoteric dialog box).

Incidentally I now see THIS:
[attachment=0]Screen10-startupscreen.png[/attachment]

Once I actually launch Vassal inside the debugger – this is certainly a huge improvement, but I just call it out that it doesn’t “quite look right” :smiley:

Brian

Here, “for future victims” is my module dependency screen, once I got it running:

[attachment=0]Screen9-module.png[/attachment]

Many thanks to Brent, Flintb, and Joel for the help.

Look like I don’t “absolutely need” the tests to compile/run in order to interact with Vassal itself, but it would certainly be nice to get that straightened out eventually if Brent knows the answer.

Hopefully the conversion to maven will be more painless :slight_smile:

Brian

Thus spake Cattlesquat:

Once I actually launch Vassal inside the debugger – this is certainly a
huge improvement, but I just call it out that it doesn’t “quite look
right” :smiley:

Yes, that would be part of the Welcome Wizard, which is a thing I’ve
wanted to remove the entire time I’ve been here…


J.

For the record, and also for showing whoever is interested in contributing that it doesn’t have to be that complicated, the only steps needed to get running with IntelliJ were:

  1. import project, IntelliJ found everything automatically and set all the paths correctly
  2. see the sun.java2d error, look in the makefile, find these “–add-export” javac arguments
  3. copy-paste these arguments into the one preferences screen that has to do with compiler configuration, and also deactivate this “–release” option at the top of this screen since the makefile didn’t contain this --release thing:

[attachment=0]intellij.png[/attachment]

Thus spake Flint1b:

  1. copy-paste these arguments into the one preferences screen that has
    to do with compiler configuration, and also deactivate this “–release”
    option at the top of this screen since the makefile didn’t contain this
    –release thing:

What is that --release option, btw?


J.

I’m not even sure, but when I later tried messing with it, it broke the build.

Just read up on it here stackoverflow.com/questions/431 … 9-compiler, and it’s a replacement for -source -target -bootclasspath, since only -source -target are not enough to make it properly compatible with older Java versions.

Haha Flint we should pin that at the top thread - “Vassal development doesn’t need to be this painful!” :smiley: :smiley:

I will admit I am tempted. Held back only by finally having it running after a full day of pain :smiley: