Skip to content
This repository has been archived by the owner on Dec 24, 2023. It is now read-only.

Commit

Permalink
Added support for building native executables
Browse files Browse the repository at this point in the history
Added commands `yea build windows`, `yea build linux` and `yea build
mac` which will create native executables for specified platforms.
  • Loading branch information
deathbeam committed Aug 23, 2015
1 parent e644788 commit 556fcac
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
- renamed "config.yml" to "project.yml"
- renamed non.config to non.project
- renamed engine to "Yae"
- added support for building native Windows, Linux and Mac OS X executables
- updated LibGDX, RoboVM, Android and YAML runtime to latest versions

[0.6.4]
- fixed documentation for methods that returns multiple values
Expand Down
22 changes: 15 additions & 7 deletions bin/yae
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,17 @@ end

local function help()
print("Commands:");
print(" yae new PROJECT_NAME # initializes new project with specified PROJECT_NAME")
print(" yae run PLATFORM # start your application for specified PLATFORM")
print(" yae build PLATFORM # build your application for PLATFORM")
print(" yae clean # clean temporary data for your project")
print(" yae update # update your project's runtime version and dependencies")
print(" yae forceupdate # force update your project's runtime version and dependencies")
print(" yae version # print current compiler version")
print(" yae new PROJECT # initializes new project")
print(" yae run PLATFORM # start your project")
print(" yae build BUILD_PLATFORM # build your project")
print(" yae clean # clean temporary data for your project")
print(" yae update # update your project's runtime version and dependencies")
print(" yae forceupdate # force update your project's runtime version and dependencies")
print(" yae version # print current compiler version")
print("")
print("PROJECT can be any string (default 'My Project')")
print("PLATFORM can be 'desktop', 'android' or 'ios' (default 'desktop')")
print("BUILD_PLATFORM can be 'desktop', 'android' 'ios', 'windows', 'linux', 'mac' (default 'desktop')")
os.exit(-1)
end

Expand All @@ -102,6 +104,12 @@ if arg[1] == "build" then
exec("update updateAndroid android:dist")
elseif arg[2] == "ios" then
exec("update updateIOS ios:dist")
elseif arg[2] == "windows" then
exec("update updateDesktop desktop:dist desktop:windows")
elseif arg[2] == "linux" then
exec("update updateDesktop desktop:dist desktop:linux")
elseif arg[2] == "mac" then
exec("update updateDesktop desktop:dist desktop:mac")
else
help()
end
Expand Down
5 changes: 3 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'org.robovm:robovm-gradle-plugin:1.6.0'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
classpath 'org.yaml:snakeyaml:1.14'
classpath 'org.yaml:snakeyaml:1.16'
classpath 'com.badlogicgames.packr:packr:1.2'
}
}

Expand Down
43 changes: 43 additions & 0 deletions core/desktop/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.badlogicgames.packr.Packr

sourceCompatibility = 1.7
sourceSets.main.java.srcDirs = [ "src/" ]

Expand All @@ -11,6 +13,47 @@ task run(type: JavaExec, dependsOn: classes) {
workingDir = project.assetsDir
}

task windows() << {
def config = new Packr.Config()
config.platform = Packr.Platform.windows
config.jdk = "https://bitbucket.org/alexkasko/openjdk-unofficial-builds/downloads/openjdk-1.7.0-u80-unofficial-windows-i586-image.zip"
config.executable = appName
config.jar = file("build/libs/desktop-${version}.jar").absolutePath
config.mainClass = project.mainClassName
config.vmArgs = ["-Xmx1G"]
config.outDir = file("../../build/windows").absolutePath
new Packr().pack(config)
}

task linux() << {
def config = new Packr.Config()
config.platform = Packr.Platform.linux32
config.jdk = "https://bitbucket.org/alexkasko/openjdk-unofficial-builds/downloads/openjdk-1.7.0-u80-unofficial-linux-i586-image.zip"
config.executable = appName
config.jar = file("build/libs/desktop-${version}.jar").absolutePath
config.mainClass = project.mainClassName
config.vmArgs = ["-Xmx1G"]
config.outDir = file("../../build/linux32").absolutePath
new Packr().pack(config)

config.platform = Packr.Platform.linux64
config.jdk = "https://bitbucket.org/alexkasko/openjdk-unofficial-builds/downloads/openjdk-1.7.0-u80-unofficial-linux-amd64-image.zip"
config.outDir = file("../../build/linux64").absolutePath
new Packr().pack(config)
}

task mac() << {
def config = new Packr.Config()
config.platform = Packr.Platform.mac
config.jdk = "https://bitbucket.org/alexkasko/openjdk-unofficial-builds/downloads/openjdk-1.7.0-u80-unofficial-macosx-x86_64-image.zip"
config.executable = appName
config.jar = file("build/libs/desktop-${version}.jar").absolutePath
config.mainClass = project.mainClassName
config.vmArgs = ["-Xmx1G"]
config.outDir = file("../../build/mac").absolutePath + "/${appName} v${version}.app"
new Packr().pack(config)
}

task dist(type: Jar, dependsOn: classes) {
from files(sourceSets.main.output.classesDir)
from files(sourceSets.main.output.resourcesDir)
Expand Down

0 comments on commit 556fcac

Please sign in to comment.