Files
HyperLap2D/build.gradle
T
2021-01-24 20:56:58 +01:00

160 lines
6.4 KiB
Groovy

buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
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.4'
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url 'https://jitpack.io' }
}
ext {
appName = 'HyperLap2D'
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 "org.lwjgl:lwjgl-tinyfd:3.2.3"
implementation "org.lwjgl:lwjgl-tinyfd:3.2.3:natives-linux"
implementation "org.lwjgl:lwjgl-tinyfd:3.2.3:natives-linux-arm32"
implementation "org.lwjgl:lwjgl-tinyfd:3.2.3:natives-linux-arm64"
implementation "org.lwjgl:lwjgl-tinyfd:3.2.3:natives-macos"
implementation "org.lwjgl:lwjgl-tinyfd:3.2.3:natives-windows"
implementation "org.lwjgl:lwjgl-tinyfd:3.2.3:natives-windows-x86"
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.talosvfx:talos-libgdx:$talosVersion"
implementation "space.earlygrey:shapedrawer:$shapedrawerVersion"
implementation "com.rafaskoberg.gdx:typing-label:$typingLabelVersion"
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.11"
implementation "commons-io:commons-io:2.7"
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']
installerOptions += ['--license-file', 'LICENSE']
if (osName.contains('windows')) {
imageOptions += ["--icon", file("icons/icon.ico")]
installerType = 'msi'
installerOptions += ['--win-dir-chooser', '--win-menu',
'--win-shortcut', '--vendor', 'Red & Black Games',
'--description', 'HyperLap2D Editor',
'--win-upgrade-uuid', 'e5f64fb6-111f-41f3-8f33-03b90e1a3a32']
resourceDir = file("resources-windows")
} 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")
}
}
}