vtm/vtm-ios/build.gradle
2023-04-14 10:28:00 +03:00

80 lines
1.7 KiB
Groovy

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.18'
}
}
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'robovm'
sourceSets.main.java.srcDirs = ["src/"]
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
ext {
roboVMVersion = "2.3.18"
}
launchIPhoneSimulator.dependsOn build
launchIPadSimulator.dependsOn build
launchIOSDevice.dependsOn build
createIPA.dependsOn build
dependencies {
api project(':vtm-gdx')
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
api "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
api "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
api "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
}
task copyVtmResources(type: Copy) {
from("../vtm/resources")
into("${buildDir}")
}
task copyVtmThemesResources(type: Copy) {
from("../vtm-themes/resources")
into("${buildDir}")
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn copyVtmResources
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn copyVtmThemesResources
}
task nativesJar(type: Jar) {
dependsOn copyVtmResources, copyVtmThemesResources
archiveClassifier = 'natives'
from('natives')
}
artifacts {
archives nativesJar
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact nativesJar
}
}
}
if (project.hasProperty("SONATYPE_USERNAME")) {
afterEvaluate {
project.apply from: "${rootProject.projectDir}/deploy.gradle"
tasks.named("sourcesJar") {
dependsOn copyVtmResources, copyVtmThemesResources
}
}
}