Skip to content

Instantly share code, notes, and snippets.

@main
Created April 10, 2017 17:43
Show Gist options
  • Save main/c45b5d30f476dab0e32db89d0720169a to your computer and use it in GitHub Desktop.
Save main/c45b5d30f476dab0e32db89d0720169a to your computer and use it in GitHub Desktop.
first scala application
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="Console_main" target="1.8" />
<module name="Console_test" target="1.8" />
<module name="vlad_main" target="1.8" />
<module name="vlad_test" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="/nix/store/90fcpiy1g7fkgc9m5v9q45sfx9vi50p8-gradle-3.4" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="useAutoImport" value="true" />
</GradleProjectSettings>
</option>
</component>
</project>
<component name="libraryTable">
<library name="Gradle: org.scala-lang:scala-library:2.12.1" type="Scala">
<properties>
<option name="languageLevel" value="Scala_2_12" />
<compiler-classpath>
<root url="file://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-compiler/2.12.1/73ba7c52af8bcaae57eba191f74e2a9a946a1049/scala-compiler-2.12.1.jar" />
<root url="file://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.12.1/dd235d04037dc6f4b6090257872dd35359a563ce/scala-library-2.12.1.jar" />
<root url="file://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.12.1/f6ae9e1c0204a3e92893d9a2188b276278f2074e/scala-reflect-2.12.1.jar" />
<root url="file://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-xml_2.12/1.0.6/e22de3366a698a9f744106fb6dda4335838cf6a7/scala-xml_2.12-1.0.6.jar" />
</compiler-classpath>
</properties>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.12.1/dd235d04037dc6f4b6090257872dd35359a563ce/scala-library-2.12.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.12.1/25088b0c29e5f4547dabc148a22af949d1d9ca8c/scala-library-2.12.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scala-lang:scala-reflect:2.12.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.12.1/f6ae9e1c0204a3e92893d9a2188b276278f2074e/scala-reflect-2.12.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.12.1/a31c5e285c7b70d15f446d919ec01f632c06991d/scala-reflect-2.12.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scalafx:scalafx_2.12:8.0.102-R12-SNAPSHOT">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scalafx/scalafx_2.12/8.0.102-R12-SNAPSHOT/dfd27c9363cbbffdddc1f51c07cf8cd787cf7b03/scalafx_2.12-8.0.102-R12-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scalafx/scalafx_2.12/8.0.102-R12-SNAPSHOT/763bce869e5a842882e442c43ad09f59915a1111/scalafx_2.12-8.0.102-R12-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/vlad.iml" filepath="$PROJECT_DIR$/.idea/modules/vlad.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/vlad_main.iml" filepath="$PROJECT_DIR$/.idea/modules/vlad_main.iml" group="vlad" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/vlad_test.iml" filepath="$PROJECT_DIR$/.idea/modules/vlad_test.iml" group="vlad" />
</modules>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="vlad" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="com.example.vlad" external.system.module.version="1.0-SNAPSHOT" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../..">
<excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
<excludeFolder url="file://$MODULE_DIR$/../../build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="vlad:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="com.example.vlad" external.system.module.type="sourceSet" external.system.module.version="1.0-SNAPSHOT" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/../../build/classes/main" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/main">
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../src/main/scala" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../src/main/resources" type="java-resource" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-library:2.12.1" level="project" />
<orderEntry type="library" name="Gradle: org.scalafx:scalafx_2.12:8.0.102-R12-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-reflect:2.12.1" level="project" />
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="vlad:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="com.example.vlad" external.system.module.type="sourceSet" external.system.module.version="1.0-SNAPSHOT" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output-test url="file://$MODULE_DIR$/../../build/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/test">
<sourceFolder url="file://$MODULE_DIR$/../../src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/../../src/test/scala" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/../../src/test/resources" type="java-test-resource" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="vlad_main" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-library:2.12.1" level="project" />
<orderEntry type="library" name="Gradle: org.scalafx:scalafx_2.12:8.0.102-R12-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-reflect:2.12.1" level="project" />
</component>
<component name="TestModuleProperties" production-module="vlad_main" />
</module>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ScalaCompilerConfiguration">
<profile name="Gradle 1" modules="Console,vlad">
<option name="postfixOps" value="true" />
<option name="reflectiveCalls" value="true" />
<option name="implicitConversions" value="true" />
<option name="higherKinds" value="true" />
<option name="experimental" value="true" />
<option name="deprecationWarnings" value="true" />
<option name="uncheckedWarnings" value="true" />
<option name="featureWarnings" value="true" />
<parameters>
<parameter value="-target:jvm-1.8" />
<parameter value="-Ypartial-unification" />
</parameters>
</profile>
</component>
</project>
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.8.2'
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '1.2.4'
id "edu.sc.seis.macAppBundle" version "2.1.6"
}
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'application'
apply plugin: 'javafx-gradle-plugin'
group 'com.example.vlad'
version '1.0-SNAPSHOT'
task wrapper(type: Wrapper) {
gradleVersion = '3.4'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
compile group: 'org.scala-lang', name: 'scala-library', version: '2.12.1'
// Scala wrapper over JavaFX
compile group: 'org.scalafx', name: 'scalafx_2.12', version: '8.0.102-R12-SNAPSHOT'
// Сюда подключать зависимости
// ....
// ....
// ....
// Выбирай отсюда что хочешь:
// https://github.com/trending/scala?since=monthly
// https://github.com/trending/java?since=monthly
// ...и ни в чём себе не отказывай
}
sourceSets {
main {
scala {
srcDirs = ['src/main/scala']
}
java {
srcDirs = ['src/main/java']
}
resources {
srcDirs = ['src/main/resources']
}
}
test {
scala {
srcDirs = ['src/test/scala']
}
}
}
compileScala {
scalaCompileOptions.additionalParameters = [
"-feature",
"-language:implicitConversions",
"-language:postfixOps",
"-language:reflectiveCalls",
"-language:higherKinds",
"-Xexperimental",
"-Ypartial-unification"
]
scalaCompileOptions.metaClass.daemonServer = true
scalaCompileOptions.metaClass.fork = true
scalaCompileOptions.metaClass.useAnt = false
scalaCompileOptions.metaClass.useCompileDaemon = false
}
tasks.withType(ScalaCompile) {
configure(scalaCompileOptions.forkOptions) {
memoryMaximumSize = '4g'
}
}
def guiApp = false // Change this to 'true' to switch to GUI mode
def mainClassFullName = 'com.example.vlad.' + (guiApp ? 'scalafx.Main' : 'console.Main')
mainClassName = mainClassFullName
// Плагин для упаковки всех зависимостей и твоего кода в один здоровенный jar
shadowJar {
baseName = project.name
classifier = null
version = null
manifest {
attributes 'Main-Class': mainClassFullName
}
}
// Упаковка в педопакеты
macAppBundle {
mainClassName = mainClassFullName
}
// Плагин для JavaFX
jfx {
verbose = true
mainClass = mainClassFullName
deployDir = "src/main/deploy"
jfxAppOutputDir = "build/jfx/app" // Где будет валяться jar (# ./gradlew jfxJar && java -jar app.jar)
jfxMainAppJarName = project.name + '.jar'
alternativePathToJarFile 'build/libs/' + name + '.out.jar'
useEnvironmentRelativeExecutables = true
libFolderName = "lib"
// gradle jfxJar
css2bin = true // o:false
preLoader = null // String
updateExistingJar = false
allPermissions = false
manifestAttributes = null // Map<String, String>
addPackagerJar = true
copyAdditionalAppResourcesToJar = true // o:false
skipCopyingDependencies = false
useLibFolderContentForManifestClasspath = false
fixedManifestClasspath = null
// gradle jfxNative
identifier = null
// String - setting this for windows-bundlers makes it possible to generate upgradeable installers (using same GUID)
vendor = 'StoreMood LTD'
nativeOutputDir = "build/jfx/native"
bundler = "ALL"
// set this to some specific, if your don't want all bundlers running, examples "windows.app", "jnlp", ...
jvmProperties = null // Map<String, String>
jvmArgs = null // List<String>
userJvmArgs = null // Map<String, String>
launcherArguments = null // List<String>
nativeReleaseVersion = "1.0"
needShortcut = false
needMenu = false
bundleArguments = [
// dont bundle JRE (not recommended, but increases build-size/-speed)
runtime: null
]
appName = name // this is used for files below "src/main/deploy", e.g. "src/main/deploy/windows/project.ico"
additionalBundlerResources = null
// path to some additional resources for the bundlers when creating application-bundle
additionalAppResources = null // path to some additional resources when creating application-bundle
secondaryLaunchers = [[appName: "somethingDifferent"], [appName: "somethingDifferent2"]]
fileAssociations = null // List<Map<String, Object>>
noBlobSigning = false // when using bundler "jnlp", you can choose to NOT use blob signing
customBundlers = null // List<String>
failOnError = false
onlyCustomBundlers = false
skipJNLP = false
skipNativeVersionNumberSanitizing = false // anything than numbers or dots are removed
additionalJarsignerParameters = null // List<String>
skipMainClassScanning = false // set to true might increase build-speed
skipNativeLauncherWorkaround124 = false
skipNativeLauncherWorkaround167 = false
skipNativeLauncherWorkaround205 = false
skipJNLPRessourcePathWorkaround182 = false
skipSigningJarFilesJNLP185 = false
skipSizeRecalculationForJNLP185 = false
skipMacBundlerWorkaround = false
}
#Mon Apr 10 20:04:24 SAMT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-all.zip
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
rootProject.name = 'vlad'
package com.example.vlad.console
import java.time.Instant
/**
* Created by keeper on 4/8/17.
*/
object Main extends App with Playground {
experiment1
experiment2()
}
trait Playground {
def experiment1 =
println(
s"""
|(_*_) 8${"=" * 4}D (_O_)
|Time: ${Instant.now()}
|""".stripMargin)
def experiment2() = {
println(s"(_*_) 8${"=" * 4}D (_O_)\nTime: ${Instant.now()}")
}
}
package com.example.vlad.scalafx
import scalafx.application.JFXApp.PrimaryStage
import scalafx.application.{JFXApp, Platform}
import scalafx.scene.Scene
import scalafx.scene.image.{Image, ImageView}
import scalafx.scene.layout.BorderPane
import scalafx.scene.paint.Color
/**
* Created by keeper on 4/8/17.
*/
object Main extends JFXApp {
Platform.implicitExit = false
stage = new PrimaryStage {
title = "(_*_)"
width = 1024
height = 680
scene = new Scene {
fill = Color.White
root = new BorderPane {
center = new ImageView {
image = new Image(getClass.getResourceAsStream("/uebnis.gif"))
}
}
}
onCloseRequest.set(event => {
System.exit(0)
})
onShown.set(event => {
println("Hello!")
})
}
Runtime.getRuntime.addShutdownHook(new Thread {
override def run(): Unit = {
println("Bye...")
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment