apply plugin: "java"
apply plugin: 'application'
apply plugin: "jtransc"

ext.jtranscVersion = "0.2.5"

mainClassName = "HelloWorld"

sourceSets.main {
	java {
		srcDir 'src'
	}
	resources {
		srcDir 'resources'
	}
}

buildscript {
	repositories {
		mavenLocal()
		mavenCentral()
	}
	dependencies {
		classpath "com.jtransc:jtransc-gradle-plugin:0.2.5"
	}
}

repositories {
	mavenLocal()
	mavenCentral()
}

dependencies {
	//compile group: 'com.jtransc.media', name: 'jtransc-media', version: '$jtranscVersion'
	compile "com.jtransc.media:jtransc-media-lime:0.2.5"
	testCompile group: 'junit', name: 'junit', version: '4.+'
}

jtransc {
	// Optional properties (https://github.com/jtransc/jtransc/blob/master/jtransc-gradle-plugin/src/com/jtransc/gradle/JTranscExtension.kt)
	// title = "App Title"
	// name = "AppName"
	// version = "0.0.1"
	// target = "haxe:js"
	// output: String? = null
	// extra = hashMapOf<String?, String?>()
	// company = "MyCompany"
	// package_ = "com.test"
	// embedResources = true
	// libraries = arrayListOf<String>()
	// assets = arrayListOf<File>()
	// debug = true
	// initialWidth = 1280
	// initialHeight = 720
	// vsync = true
	// resizable = true
	// borderless = false
	// fullscreen = false
	// icon: String? = null
	// orientation = "auto"
	// relooper = false
	minimizeNames = false
	// analyzer = false
}

// Defined tasks

// Building tasks:
// - distribution:distCpp
// - distribution:distJs
// - distribution:distNeko
// - distribution:distPhp

// Building and running tasks:
// - distribution:runCpp
// - distribution:runNeko
// - distribution:runNodeJs
// - distribution:runPhp
// - distribution:runSwd

// Custom Building/running tasks:
// - jtransc:distJtransc (must specify target and outputFile options)
// - jtransc:runJtransc (must specify target and outputFile options)

import com.jtransc.gradle.tasks.JTranscGradleDistTask
import com.jtransc.gradle.tasks.JTranscGradleRunTask

task distWindows(type: JTranscGradleDistTask) {
	target = "haxe:cpp"
	outputFile = "program.exe"
	minimizedNames = false
}

task runWindows(type: JTranscGradleRunTask) {
	target = "haxe:cpp"
	//outputFile = "program.exe"
	minimizedNames = false
}
