Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle file initial checkin #2

Merged
merged 1 commit into from
Mar 26, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'eclipse'
apply plugin: 'idea'

group = '$organization$'
version = '$version$'

ext {
//Change this with your scalafx executable file path
mainClass = "$package$.HelloScalaFX"

scalaVersion = '2.9.3'
scalaGroup = 'org.scala-lang'
}

repositories {
mavenCentral()
}


final javafxHome = System.env['JAVAFX_HOME']
if (javafxHome) {
ext.javafxJar = "${javafxHome}/rt/lib/jfxrt.jar"
if ( !new File( ext.javafxJar ).exists() ) {
ext.javafxJar = "${javafxHome}/jre/lib/jfxrt.jar"
}
} else {
final javaHome = System.env['JAVA_HOME']
if (javaHome)
ext.javafxJar = "${javaHome}/jre/lib/jfxrt.jar"
}

try {
println "${project.name} - DEBUG: JavaFX runtime jar: ${ext.javafxJar}"
dependencies {
runtime files(ext.javafxJar)
}
} catch (MissingPropertyException mpe) {
println """
| Please set the environment variable JAVAFX_HOME
| to the directory that contains rt/lib/jfxrt.jar
| or e.g set JAVAFX_HOME to the /Library/Java/JavaVirtualMachines/jdk1.7.0_11.jdk/Contents/Home
| otherwise the current JAVA_HOME will be used
| with the JavaFX version ${scalafx_requiredJavaFxVersion}.\n""".stripMargin()
System.exit 1
}


dependencies {
scalaTools "${scalaGroup}:scala-compiler:${scalaVersion}"
scalaTools "${scalaGroup}:scala-library:${scalaVersion}"

// Libraries needed for scala api
compile "${scalaGroup}:scala-library:${scalaVersion}"

// We need the JavaFX APIs
compile files(ext.javafxJar)

compile "org.scalafx:scalafx_2.9.2:1.0.0-M2"

testCompile 'junit:junit:4.10'
testCompile 'org.scalatest:scalatest_2.9.1:1.9.1'
}

task(run, dependsOn: 'classes', type: JavaExec,
description:"Runs the ScalaFX file.") {
main = mainClass
classpath = sourceSets.main.runtimeClasspath
}