Loading...

Working from source project

View: 296    Dowload: 0   Comment: 0   Post by: daii   Category: Java Sun   Fields: Game - Entertainment

Working with LibGDX source is relatively easy if you are comfortable with your IDE and maven/ant/gradle. Even if you aren't, this article can hopefully guide you along the way. There are two main components when working with the LibGDX, the java source, and the native source; Most users won't need to dive into the c/c++ components, but for those that want to this guide will also go into that.

  • Java source only

    • Steps before importing
      • Environment setup
      • Obtaining the source
      • Fetching natives
    • Importing LibGDX into Intellij/Android Studio
    • Importing LibGDX into Eclipse
    • Building LibGDX and installing
  • Building Natives

    • Prerequisites
      • Linux host
      • Mac Host
    • Compiling

Compiling

Compiling the natives is handled through Ant scripts.

To compile the Mac and iOS natives, run:

./ant -f build-mac-ios.xml

To compile the Windows, Linux and Android natives, run:

./ant -f build.xml -Dbuild-natives=true -Dversion=nightly

You can also run each individual platforms script to build natives for just that platform, for example just the android natives, just run that particular script itself, (you may have to set some extra command line properties yourself, so check out each script to see what it expects).

Mac OS X host

What you need:

JDK 8+ XCode, through Mac app store

  • XCode command line utilities for latest XCode

Ant 1.9.3+ (must be on path, use homebrew) ccache (optional, use homebrew)

To do this we use a Linux host for crosscompilation of windows/linux and android antives. We also use a Mac host for the iOS and MacOS natives. Mac and iOS natives can only be built on MacOS.

Linux host

What you need:

64 bit linux distro (we use Ubuntu 13.10) openjdk-7-jdk Ant 1.9.3+ (must be on path) Maven 3+ (must be on path) Android NDK r13b (ANDROID_NDK and NDK_HOME variables set) Android SDK with latest targets (ANDROID_SDK variable set) Compilers

  • gcc, g++, gcc-multilib, g++-multilib, (32 bit and 64 bit linux compilers)
  • mesa-common-dev, libxxf86vm-dev, libxrandr-dev, libx11-dev:i386, jglfw only
  • mingw-w64 (windows compiler 32 bit and 64 bit)
  • ccache (optional)
  • lib32z1
  • iOS i386, arm7, arm64, x86_64

 


 

Building LibGDX

You can install LibGDX to your local maven repository by running a simple command:

mvn install

This will build and install LibGDX and all core components to your local maven repository with the current version declared in the pom.xml files

 


 

Natives

 


 

Prerequisites

Building the natives is slightly more involved. The natives are built for every platform we target:

Desktop Windows, Linux and Mac both 32 and 64 bit Android arm6, arm7, x86, x86_64

Its recommended to run the android and gwt tests on command line with the following:

ANDROID

./gradlew tests:gdx-tests-android:installDebug

HTML

./gradlew tests:gdx-tests-gwt:superDev

Importing as existing project

File > Import > General > Existing projects into workspace Search for nested projects, and make sure all sub projects are discovered and checked and hit finish Wait for the import process and workspace refresh to fully complete. Solve any missing SDK problems, and run a clean in Eclipse

 


 

Importing with Gradle

File > Import > Gradle > Gradle project

All of the other projects are hooked up and ready to test given that you have set up your system correctly, so give them a go.

Its recommended to run the android and gwt tests on command line with the following:

ANDROID

./gradlew tests:gdx-tests-android:installDebug

HTML

./gradlew tests:gdx-tests-gwt:superDev

 


 

Importing into Eclipse

Importing with Gradle Importing as existing project

 


 

Java source

 


Steps before importing

Environment setup

You must have your system setup! Make sure you have gone through the setting up guide completely.

You will also need to install maven for installing to your local repository, and ant if you don't want to use Gradle.

Obtaining source

To get the sources from github, you should clone the github repository.

git clone git://github.com/libgdx/libgdx.git
cd libgdx

Fetching natives

Native binaries must be brought down in order to run. These binaries are built on the snapshot build server, so you need to run a task to bring them down. Even if you plan on building natives later yourself, its recommended to bring these down so you can test your development environment is setup before moving to the next step.

From the LibGDX root directory

Through Gradle

./gradlew fetchNatives

Through ant

ant -f fetch.xml
If you get the following error: 
java javax.net.ssl.SSLHandshakeException 
you need to update your JDK to at least Java 8 101.

 


 

Importing into Intellij

File > Open > LibGDX root build.gradle Import all projects Wait for Intellij to finish syncing and indexing View > Tool Windows > Gradle, sync gradle button Make sure the Gradle sync succeeds, if not resolve the issues at hand. Go into preferences and turn off configure on demand Try running the LwjglTestStart class located in tests/gdx-tests/gdx-tests-lwjgl/src by right clicking and running

You should get assets not found when you try to run a test, edit the run configuration and point it to the correct assets folder.tests/gdx-tests-android/assets

working from source intellij

 

All of the other projects are hooked up and ready to test given that you have set up your system correctly, so give them a go.

Its recommended to run the android and gwt tests on command line with the following:

ANDROID

./gradlew tests:gdx-tests-android:installDebug

HTML

./gradlew tests:gdx-tests-gwt:superDev

 


 

Importing into Eclipse

  • Importing with Gradle
  • Importing as existing project

 


 

Importing with Gradle

  • File > Import > Gradle > Gradle project

Its recommended to run the android and gwt tests on command line with the following:

ANDROID

./gradlew tests:gdx-tests-android:installDebug

HTML

./gradlew tests:gdx-tests-gwt:superDev

Importing as existing project

  • File > Import > General > Existing projects into workspace
  • Search for nested projects, and make sure all sub projects are discovered and checked and hit finish
  • Wait for the import process and workspace refresh to fully complete.
  • Solve any missing SDK problems, and run a clean in Eclipse

 


 

Building LibGDX

You can install LibGDX to your local maven repository by running a simple command:

mvn install

This will build and install LibGDX and all core components to your local maven repository with the current version declared in the pom.xml files

 


 

Natives

 


 

Prerequisites

Building the natives is slightly more involved. The natives are built for every platform we target:

  • Desktop Windows, Linux and Mac both 32 and 64 bit
  • Android arm6, arm7, x86, x86_64
  • iOS i386, arm7, arm64, x86_64

To do this we use a Linux host for crosscompilation of windows/linux and android antives. We also use a Mac host for the iOS and MacOS natives. Mac and iOS natives can only be built on MacOS.

Linux host

What you need:

  • 64 bit linux distro (we use Ubuntu 13.10)
  • openjdk-7-jdk
  • Ant 1.9.3+ (must be on path)
  • Maven 3+ (must be on path)
  • Android NDK r13b (ANDROID_NDK and NDK_HOME variables set)
  • Android SDK with latest targets (ANDROID_SDK variable set)
  • Compilers
    • gcc, g++, gcc-multilib, g++-multilib, (32 bit and 64 bit linux compilers)
    • mesa-common-dev, libxxf86vm-dev, libxrandr-dev, libx11-dev:i386, jglfw only
    • mingw-w64 (windows compiler 32 bit and 64 bit)
    • ccache (optional)
    • lib32z1

Mac OS X host

What you need:

  • JDK 8+
  • XCode, through Mac app store
    • XCode command line utilities for latest XCode
  • Ant 1.9.3+ (must be on path, use homebrew)
  • ccache (optional, use homebrew)

Compiling

Compiling the natives is handled through Ant scripts.

To compile the Mac and iOS natives, run:

./ant -f build-mac-ios.xml

To compile the Windows, Linux and Android natives, run:

./ant -f build.xml -Dbuild-natives=true -Dversion=nightly

You can also run each individual platforms script to build natives for just that platform, for example just the android natives, just run that particular script itself, (you may have to set some extra command line properties yourself, so check out each script to see what it expects).

Working from source project

Working with LibGDX source is relatively easy if you are comfortable with your IDE and maven/ant/gradle. Even if you aren't, this article can hopefully guide you along the way. There are two main components when working with the LibGDX, the java source, and the native source; Most users won't need to dive into the c/c++ components, but for those that want to this guide will also go into that.

Posted on 09-02-2018 

Comment:

To comment you must be logged in members.

Files with category

  • Simple Ordering System (Console)

    Simple Ordering System (Console)

    View: 55    Download: 0   Comment: 0

    Category: Java Sun     Fields: none

    I have my original program of this using the concept of stacks however, I find it difficult on updating the elements of the array. Instead of using the same concept, I've modified it and made it just to a static array with fixed elements.

  • Scientific Calculator –Tutorial NetBeans IDE

    Scientific Calculator –Tutorial NetBeans IDE

    View: 56    Download: 0   Comment: 0

    Category: Java Sun     Fields: none

    1. Download the zip file of SCIENTIFIC CALCULATOR–Tutorial. 2. Install your Java NetBeans IDE. 3. Open the install NetBeans. 4. Go to File. 5. Select Import project. 6. Choose from Zip ; since it is a zip file. Contact (+233) 244644700 Mail:...

  • Subnet Calculator

    Subnet Calculator

    View: 84    Download: 1   Comment: 0

    Category: Java Sun     Fields: none

    If your searching about a subnet calculator then you literally know about subnetting.

  • Very Basic Java Fighting Game

    Very Basic Java Fighting Game

    View: 113    Download: 5   Comment: 0

    Category: Java Sun     Fields: none

    Sharing you the source code of this simple fighting game created in java[eclipse]. You will learn character animation, basic interaction and some AI implementation. If you have some questions just spam me at mark[dot]cabalar[at]yahoo[dot]com. Visit...

  • Very Basic Java Game programming - Part 1

    Very Basic Java Game programming - Part 1

    View: 77    Download: 2   Comment: 0

    Category: Java Sun     Fields: none

    I don’t know how exactly to start or make an introduction for this post. I just made in to the concept of designing a simple fighting game tutorial - from doing the character animation to its overall functionality. This tutorial is intended for...

  • Recharge App (Like Paytm)

    Recharge App (Like Paytm)

    View: 97    Download: 2   Comment: 0

    Category: Java Sun     Fields: none

    Hello Dear, This is a recharge app you can recharge your mobile, electricity bill, insurance, gas bill, landline bill, etc. I have wallet functionality which you can add money in your wallet and recharge mobile using wallet amount. I have Admin...

  • Credit Card Number Verifier

    Credit Card Number Verifier

    View: 71    Download: 0   Comment: 0

    Category: Java Sun     Fields: none

    It's a JAVAFXML app that verifies if a number is a valid credit card number. It uses Luhn algorithm to verify. It also predicts the last credit card number given 15 numbers.

  • Cabin Assigner Pro

    Cabin Assigner Pro

    View: 97    Download: 0   Comment: 0

    Category: Java Sun     Fields: none

    This program allows to create and assign cabins at summer camp. There are error checking features including setting a capacity, an alert if a child is assigned to a cabin outside of their age range, it will prohibit assigned a cabin that is set for...

 
File suggestion for you
Loading...
File top downloads
Loading...
Loading...
Codetitle - library source code to share, download the file to the community
Copyright © 2018. All rights reserved. codetitle Develope by Vinagon .Ltd