Created
April 18, 2016 19:08
-
-
Save khardix/c0203caba93a7beb8e735286ab9a801e to your computer and use it in GitHub Desktop.
Basic scala/swing HelloWorld application with gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'scala' | |
id 'com.github.johnrengelman.shadow' version '1.2.3' | |
} | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
compile 'org.scala-lang:scala-library-all:2.11.5' | |
compile 'org.scala-lang.modules:scala-swing_2.11:1.0.1' | |
} | |
def mainClassName = 'cz.khardix.scala.HelloWorld' | |
jar.manifest.attributes 'Main-Class': mainClassName | |
task run(type: JavaExec, dependsOn: classes) { | |
main = mainClassName | |
classpath sourceSets.main.runtimeClasspath | |
classpath configurations.runtime | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cz.khardix.scala | |
import swing._ | |
object HelloWorld extends SimpleSwingApplication { | |
def top = new MainFrame { | |
title = "Hello World!" | |
contents = new Button { | |
text = "Click Me!" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment