Commit 8c5def6d authored by Thomas Dupriez's avatar Thomas Dupriez

ScalaJava branch created. Build using sbt and relax

parent 6c4f4351
target
*.class
build
.classpath
.project
.settings
org.scala-ide.sdt.core/META-INF/MANIFEST.MF
org.scala-ide.sdt.update-site/site.xml
# Makefile author: Joseph Anderson <jtanderson@ratiocaeli.com>
# This is where you specify the necessary source files
# Program packages and files
# - The packages should be the path inside your src directory. eg: package1 package2/package3
PACKAGES = core graphics map_generation network user_interface
# Java compiler
JAVAC = javac
JVM = 1.8
# Directory for compiled binaries
# - trailing slash is important!
BIN = bin/
# Directory of source files
# - trailing slash is important!
SRC = src/
# Java compiler flags
# JAVAFLAGS = -g -cp $(SRC)
JAVAFLAGS = -g -d $(BIN) -cp $(SRC) -target $(JVM)
# Creating a .class file
COMPILE = $(JAVAC) $(JAVAFLAGS)
EMPTY =
JAVA_FILES = $(subst $(SRC), $(EMPTY), $(wildcard $(SRC)*.java))
ifdef PACKAGES
PACKAGEDIRS = $(addprefix $(SRC), $(PACKAGES))
PACKAGEFILES = $(subst $(SRC), $(EMPTY), $(foreach DIR, $(PACKAGEDIRS), $(wildcard $(DIR)/*.java)))
ALL_FILES = $(PACKAGEFILES) $(JAVA_FILES)
else
#ALL_FILES = $(wildcard $(SRC).java)
ALL_FILES = $(JAVA_FILES)
endif
# One of these should be the "main" class listed in Runfile
CLASS_FILES = $(subst $(SRC), $(BIN), $(ALL_FILES:.java=.class))
# CLASS_FILES = $(ALL_FILES:.java=.class)
# The first target is the one that is executed when you invoke
# "make".
all : $(addprefix $(BIN), $(CLASS_FILES))
# The line describing the action starts with <TAB>
$(BIN)%.class : $(SRC)%.java
$(COMPILE) $<
clean :
rm -rf $(BIN)*
name := "the_dungeon_project"
version := "1.0"
scalaVersion := "2.11.7"
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
libraryDependencies += "com.typesafe.akka" % "akka-actor" % "2.0.2"
scalacOptions += "-deprecation"
import core.*;
import graphics.*;
//<Just a try>
import scalaHello_package.*;
//</Just a try>
class Main {
public static void main (String[] args){
System.out.println("Hello World");
Core c = new Core();
//<Just a try>
ScalaHello.sayHelloToJava();
//</Just a try>
}
}
import core.*;
import graphics.*;
//<Just a try>
import scalaHello_package.*;
//</Just a try>
class Main {
public static void main (String[] args){
System.out.println("Hello World");
Core c = new Core();
//<Just a try>
ScalaHello.sayHelloToJava()
//</Just a try>
}
}
package scalaHello_package
object ScalaHello {
def sayHelloToJava() = {
println("Hello JAVA, my name is SCALA!")
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment