``` apply plugin: 'java' //noinspection GroovyUnu...
# intellij
k
Copy code
apply plugin: 'java'

//noinspection GroovyUnusedAssignment
sourceCompatibility = 1.6
sourceSets.main.java.srcDirs = ['src/']

project.ext.mainClassName = 'package.DesktopLauncher'
project.ext.assetsDir = new File('../android/assets');

dependencies {
    compile project(':core')
    compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$GDX_VERSION"
    compile "com.badlogicgames.gdx:gdx-platform:$GDX_VERSION:natives-desktop"
    compile "com.badlogicgames.gdx:gdx-tools:$GDX_VERSION"

    compile "de.tomgrill.gdxfacebook:gdx-facebook-desktop:$GDX_FACEBOOK_VERSION"
}

task run(dependsOn: classes, type: JavaExec) {
    main = project.mainClassName
    classpath = sourceSets.main.runtimeClasspath
    standardInput = <http://System.in|System.in>
    workingDir = project.assetsDir
    ignoreExitValue = true
}

task dist(type: Jar) {
    from files(sourceSets.main.output.classesDir)
    from files(sourceSets.main.output.resourcesDir)
    from { configurations.compile.collect { zipTree(it) } }
    from files(project.assetsDir);

    manifest {
        attributes 'Main-Class': project.mainClassName
    }
}

import com.badlogic.gdx.tools.texturepacker.TexturePacker

task texturePacker << {
    TexturePacker.process('core/assets/graphics', 'android/assets/graphics/', "game")
}

dist.dependsOn classes