150 lines
5.5 KiB
Groovy
150 lines
5.5 KiB
Groovy
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
}
|
|
dependencies {
|
|
classpath 'com.badlogicgames.gdx:gdx-tools:1.9.11'
|
|
classpath 'com.novoda:bintray-release:0.9.2'
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id 'java'
|
|
id 'org.beryx.runtime' version '1.11.2'
|
|
}
|
|
|
|
group 'games.rednblack'
|
|
version '0.0.1'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
}
|
|
|
|
ext {
|
|
appName = 'HyperLap2D'
|
|
gdxVersion = '1.9.11'
|
|
gdxVersionBeta = '1.9.11'
|
|
box2dlightsVersion = '1.5'
|
|
ashleyVersion = '1.7.3'
|
|
spineVersion = '3.8.55.1'
|
|
visuiVersion = '1.4.6'
|
|
|
|
packMain = ["art/textures", "assets/style/", "uiskin"]
|
|
packSplash = ["art/splash_textures", "assets/splash/", "splash"]
|
|
}
|
|
|
|
import com.badlogic.gdx.tools.texturepacker.TexturePacker
|
|
task packTextures {
|
|
if (project.ext.has('packMain')) {
|
|
logger.info "Calling TexturePacker: " + packMain
|
|
TexturePacker.processIfModified(file(packMain[0]).absolutePath, file(packMain[1]).absolutePath, (String)packMain[2])
|
|
}
|
|
if (project.ext.has('packSplash')) {
|
|
logger.info "Calling TexturePacker: " + packSplash
|
|
TexturePacker.processIfModified(file(packSplash[0]).absolutePath, file(packSplash[1]).absolutePath, (String)packSplash[2])
|
|
}
|
|
}
|
|
|
|
mainClassName = "games.rednblack.editor.Main"
|
|
project.ext.assetsDir = new File("assets/");
|
|
def osName = System.getProperty('os.name').toLowerCase(Locale.ROOT)
|
|
|
|
task runHyperLap2D(dependsOn: classes, type: JavaExec) {
|
|
main = project.mainClassName
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
standardInput = System.in
|
|
workingDir = project.assetsDir
|
|
ignoreExitValue = true
|
|
}
|
|
|
|
task dist(type: Jar) {
|
|
from files(sourceSets.main.output.classesDirs)
|
|
from files(sourceSets.main.output.resourcesDir)
|
|
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
|
|
from files(project.assetsDir);
|
|
|
|
manifest {
|
|
attributes 'Main-Class': project.mainClassName
|
|
}
|
|
|
|
destinationDirectory = file("$buildDir/lib")
|
|
}
|
|
|
|
jpackageImage.dependsOn dist
|
|
jpackage.dependsOn dist
|
|
|
|
dependencies {
|
|
implementation "com.badlogicgames.gdx:gdx:$gdxVersion"
|
|
implementation "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
|
|
implementation "com.badlogicgames.box2dlights:box2dlights:$box2dlightsVersion"
|
|
implementation ("com.badlogicgames.gdx:gdx-tools:$gdxVersion") {
|
|
exclude group: 'com.badlogicgames.gdx', module: 'gdx-backend-lwjgl'
|
|
}
|
|
implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
|
|
implementation "com.badlogicgames.ashley:ashley:$ashleyVersion"
|
|
|
|
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersionBeta"
|
|
|
|
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
|
implementation "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
|
|
implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
|
|
|
implementation project(":hyperlap2d-common-api")
|
|
implementation project(":hyperlap2d-runtime-libgdx")
|
|
implementation project(":h2d-libgdx-spine-extension")
|
|
|
|
implementation "com.kotcrab.vis:vis-ui:$visuiVersion"
|
|
implementation "com.esotericsoftware.spine:spine-libgdx:$spineVersion"
|
|
implementation "com.mortennobel:java-image-scaling:0.8.5"
|
|
implementation "org.apache.commons:commons-lang3:3.3.2"
|
|
implementation "org.apache.commons:commons-io:1.3.2"
|
|
implementation 'net.mountainblade:modular:1.0'
|
|
|
|
testImplementation group: 'junit', name: 'junit', version: '4.12'
|
|
}
|
|
|
|
runtime {
|
|
javaHome.set(System.getProperty("java.home"))
|
|
options = ['--strip-debug',
|
|
'--compress', '2',
|
|
'--no-header-files',
|
|
'--no-man-pages',
|
|
'--strip-native-commands',
|
|
'--vm', 'server']
|
|
modules = ['java.base',
|
|
'java.desktop',
|
|
'java.compiler',
|
|
'java.logging',
|
|
'java.management',
|
|
'jdk.crypto.cryptoki',
|
|
'jdk.crypto.ec',
|
|
'jdk.unsupported']
|
|
distDir = file(buildDir)
|
|
|
|
jpackage {
|
|
mainJar = dist.archiveFileName.get()
|
|
imageOptions += ['--app-version', getVersion(), '--vendor', 'Red & Black Games', '--description', 'HyperLap2D Editor', '--name', 'HyperLap2D']
|
|
if (osName.contains('windows')) {
|
|
imageOptions += ["--icon", file("icons/icon.ico")]
|
|
installerType = 'msi'
|
|
installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu', '--win-shortcut']
|
|
} else if (osName.contains('linux')) {
|
|
imageOptions += ["--icon", file("icons/HyperLap2D.png")]
|
|
installerType = 'deb'
|
|
installerOptions += [
|
|
'--linux-menu-group', 'Development', '--linux-deb-maintainer', 'business@rednblack.games',
|
|
'--linux-shortcut'
|
|
]
|
|
resourceDir = file("resources-linux")
|
|
} else if (osName.contains('mac')) {
|
|
imageOptions += ['--copyright', '(c) 2020, Red & Black Games', "--icon", file("icons/icon.icns")
|
|
, '--resource-dir', "${projectDir}/resources-macos"]
|
|
jvmArgs = ['-XstartOnFirstThread', '-Djava.awt.headless=true']
|
|
installerOptions += ['--verbose','--app-version', getVersion(), '--vendor', 'Red & Black Games', '--resource-dir', "${projectDir}/resources-macos" ]
|
|
installerType = 'dmg'
|
|
resourceDir = file("resources-macos")
|
|
}
|
|
}
|
|
} |