build.gradle 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. sourceCompatibility = 1.7
  2. sourceSets.main.java.srcDirs = [ "src/" ]
  3. sourceSets.main.resources.srcDirs = ["../android/assets"]
  4. project.ext.mainClassName = "com.pjl.kursovaya.desktop.DesktopLauncher"
  5. project.ext.assetsDir = new File("../android/assets")
  6. task run(dependsOn: classes, type: JavaExec) {
  7. main = project.mainClassName
  8. classpath = sourceSets.main.runtimeClasspath
  9. standardInput = System.in
  10. workingDir = project.assetsDir
  11. ignoreExitValue = true
  12. }
  13. task debug(dependsOn: classes, type: JavaExec) {
  14. main = project.mainClassName
  15. classpath = sourceSets.main.runtimeClasspath
  16. standardInput = System.in
  17. workingDir = project.assetsDir
  18. ignoreExitValue = true
  19. debug = true
  20. }
  21. task dist(type: Jar) {
  22. manifest {
  23. attributes 'Main-Class': project.mainClassName
  24. }
  25. dependsOn configurations.runtimeClasspath
  26. from {
  27. configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
  28. }
  29. with jar
  30. }
  31. dist.dependsOn classes
  32. eclipse.project.name = appName + "-desktop"