Setup of source files for netbeans

XanHou

New Member
Contributor
Architecture
The setup as described here is MUCH easier than what is described for eclipse/IDEA.
No more command line stuff, or even installing git on your pc!

Overview of steps:
  1. Install netbeans
  2. Install the gradle plugin for netbeans
  3. Clone the git repository with netbeans
  4. Push to your own repo/branch
Full details:

1. Install netbeans
I tested this with netbeans 7.3.1, but any version supported by the gradle plugin and git plugin should work.
Make sure you have java 1.6 or 1.7 SDK, not JRE!
1.7 is preferred as the project is shifting towards 1.7.
link for combined package:
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7-netbeans-download-432126.html

2. Install the gradle plugin
Open netbeans and go to:
Tools->Plugins
Then go to the Available plugins tab and search for gradle
Install the gradle plugin and its dependencies (groovy).

3. Clone git repository
WARNING: cloning just takes a long time! Have patience!
Make sure you have no open project selected (build and run buttons are greyed out), then:
Go to team->git->clone
Enter the terasology git reposity location: "https://github.com/MovingBlocks/Terasology.git"

Leave the user details blank, or fill in your github account if you really want to.
Select the branches you want to work on.
The next few windows all give you some obvious choices, such as location on disc, the branch to start working on, etc.
Once done you can open the gradle project with netbeans (or it is opened automatically if you selected to scan for projects after clone).

From here you can already run the project with the big green run button! Neat!
(First time running is a bit slow because of gradle setup.)

4. Push to your own repo/branch
This step will allow you to put your work on github. This is needed for pull-requests (request the devs of Terasology to accept your additions and changes) and to work on the project on multiple computers.
Roughly follow these steps:
- Create a github account.
- Fork the terasology repo (https://github.com/MovingBlocks/Terasology -> big fork button on the top-right, if you are logged in)
- Open netbeans, open the cloned project and select it
- Go to team->remote->push...
- Select "Specify Git repositiry location" and the location to your repository. It will look like: https://github.com/XXX/Terasology.git where XXX is replaced by you name on github.
- Enter your github name and password
- Select the branches of which you want the changes to be uploaded (usually only the branch you are working on). If your local branch has a new name, you will create a new online branch.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Good stuff, thanks for this - we really lacked some stuff on Netbeans :)

Now I just hope I don't bowl it over with the restructure stuff!

Curiously, would you be up for adding it to the wiki ? Maybe we need to thin out the Dev Setup a bit and include IntelliJ / Eclipse / Netbeans on separate pages.

Also: contributor badge for useful guide :)
 

XanHou

New Member
Contributor
Architecture
Important in this method is that netbeans does not generate netbeans project files, which does happen for the current eclipse setup. Instead the gradle plugin allows netbeans to read the raw gradle project.
Im not sure if IDEA project files are created though.
It also solves various missing library issues, which were solved by cleaning the project with gradle, since gradle is now directly used by the IDE!
Interesting is that similar plugins exist for eclipse and IDEA. So for both of these IDEs the same trick should work.
Also, if you keep using gradle, this method will keep working. (Unless you grab a gradle version that is not supported by the plugins...)

There is one thing I do not understand yet. None of the mods seem to have any source files (either java or resources)?! Is this normal?
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
"graldew idea" does create idea project files (which are already present in the .gitignore). Project files itself are not bad, but maybe we should extend the .gitignore to cover eclipse (I think that is covered already) or any other project files (technically, you can even work with vim and plugins ....).

I use idea's gradle plugin by myself, but haven't tested it with the new project structure yet. Not sure if the IDE alone will get the different module right...
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
There is one thing I do not understand yet. None of the mods seem to have any source files (either java or resources)?! Is this normal?
That's just the multiplayer branch currently, Immortius took out the modules with code since they would've broken anyway with the major changes happening over there. The modules are still hanging out in the develop branch, from where they'll be extracted to independent GitHub repos, then fixed up for multiplayer with the restructure work done :)

Current IntelliJ setup in Gradle generates files, but I don't know about opening up a project Gradle-style from within IntelliJ. The few times somebody has done that by accident it usually ends up not working. But then we likely haven't tried very hard to get that working. I'm honestly not sure if we've tried getting said Gradle plugin to do anything other than enable and show up.
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
That screenshot is Netbeans, not IntelliJ like Cervator was talking about.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Still happy to hear that it works via plugin that easily in Netbeans tho! :D
 
Top