Git R Done – Scalathon 2012 – Notes

Scalathon 2012
Anatomy
giter8
   conscript application
   typesafe
template engine
github or any git repository
push to github to update template
no authentication
use github account
use branches,tags
use master/head for template
IRC Freenode
Scalathon | the international Scala hackathon | July 15-17 2011 | http://scalathon.org
#scalathon
Assumptions
works for github, but can work for any git repository
users or org/repo
Template
dispatch/dispatch.g8
g8 is assumed extension
90% convention

<n8han> https://github.com/n8han/giter8
<n8han> cs n8han/giter8
<n8han> g8 dispatch/dispatch

use in the bin directory only

will install it locally

generates sbt script / directory structure

publishing to sonatype is eventually mirrored to maven

resolver

sbt 0.12

http://www.scala-sbt.org/learn.html

https://github.com/n8han/conscript#readme

sbt run

ny scala meetup

meetup

need a suite of tests to ensure that nothing was broken when they added features

giter8 – depends on github api, now using git interface

will use jgit soon

>g8

giter8 0.4.5
Usage: g8 [TEMPLATE] [OPTION]…
Apply specified template.

OPTIONS
-a, –auth <login>:<password>
Authorizes oauth access to Github
-b, –branch
Resolves a template within a given branch
–paramname=paramvalue
Set given parameter value and bypass interaction.


Apply template and interactively fulfill parameters.
g8 n8han/giter8

Apply template from a remote branch
g8 n8han/giter8 -b some-branch

Apply given name parameter and use defaults for all others.
g8 n8han/giter8 –name=template-test

Acquire Github authorization
g8 -a login:password

 

can pass in named parameters

Build your own giter8 template

 

g8 n8han/giter8

 

your scala sbt is in sbt plugins are a sbt beneath

 

https://github.com/sbt/xsbt-gpg-plugin/

 

proguard is not working with latest typesafe stack

issue with android + scala

we reject that jars have to be skinny

latest sbt on windows is 0.11.3

 

tree on windows 7 console

 

C:Usersspanntbinnoisewebtemplate>tree
Folder PATH listing for volume PC COE
Volume serial number is F6F0-B6B2
C:.
├───project
│ ├───project
│ │ └───target
│ │ ├───scala-2.9.1
│ │ │ └───sbt-0.11.3
│ │ │ ├───cache
│ │ │ │ ├───compile
│ │ │ │ └───update
│ │ │ └───classes
│ │ └───streams
│ │ ├───$global
│ │ │ ├───compilers
│ │ │ │ └───$global
│ │ │ ├───ivy-configuration
│ │ │ │ └───$global
│ │ │ ├───ivy-sbt
│ │ │ │ └───$global
│ │ │ ├───project-descriptors
│ │ │ │ └───$global
│ │ │ └───update
│ │ │ └───$global
│ │ └───compile
│ │ ├───$global
│ │ │ └───$global
│ │ ├───compile
│ │ │ └───$global
│ │ ├───compile-inputs
│ │ │ └───$global
│ │ ├───copy-resources
│ │ │ └───$global
│ │ └───defined-sbt-plugins
│ │ └───$global
│ └───target
│ ├───config-classes
│ ├───scala-2.9.1
│ │ └───sbt-0.11.3
│ │ └───cache
│ │ ├───compile
│ │ └───update
│ └───streams
│ ├───$global
│ │ ├───compilers
│ │ │ └───$global
│ │ ├───ivy-configuration
│ │ │ └───$global
│ │ ├───ivy-sbt
│ │ │ └───$global
│ │ ├───project-descriptors
│ │ │ └───$global
│ │ └───update
│ │ └───$global
│ └───compile
│ ├───$global
│ │ └───$global
│ ├───compile
│ │ └───$global
│ ├───compile-inputs
│ │ └───$global
│ ├───copy-resources
│ │ └───$global
│ └───defined-sbt-plugins
│ └───$global
└───src
└───main
└───g8
└───src
└───main
└───scala

 
default.properties
srcmaing8
this is input for the template mechanism
 
default.properties used for the build, this doesn’t show up
 
creates a standard Scala SBT project
 
Stub.scala
 
 
sbt
 
“sbt console”
> g8-test
 
 
SBT
build.sbt
 
srcmainscala
 

Directory of C:UsersspanntDesktopScalamydirsrcmainscala

07/27/2012 01:50 PM <DIR> .
07/27/2012 01:50 PM <DIR> ..
07/27/2012 01:50 PM 589 Hello$.class
07/27/2012 01:50 PM 605 Hello.class
07/27/2012 01:50 PM 292 Hello.scala
3 File(s) 1,486 bytes
2 Dir(s) 115,960,180,736 bytes free

sbt

run

info, warning, error – logs

sbt
[info] Set current project to default-469610 (in build file:/C:/Users/spannt/Des
ktop/Scala/mydir/)
> run
[info] Updating {file:/C:/Users/spannt/Desktop/Scala/mydir/}default-469610…
[info] Resolving org.scala-lang#scala-library;2.9.1 …
[info] Done updating.
[info] Compiling 1 Scala source to C:UsersspanntDesktopScalamydirtargetsc
ala-2.9.1classes…
[info] Running Hello
Hello World
[success] Total time: 3 s, completed Jul 27, 2012 1:55:44 PM
>

leave sbt running

works like SPRING ROO

SBT grabs it’s own SCALA on the web

 

conscript example giter8 (g8) template – https://github.com/softprops/conscript-example.g8

conscript (cs) example – https://github.com/softprops/conscript-example

 

can combine java and scala

integrate scala calling java

continuous build on src changes

 

~run

~compile

~test

compile, compile test, run test

can use ~ before anything

 

change  sbt

up xmx

up stack

hotspot options for permgen

 

put into build.sbt

https://github.com/harrah/xsbt/wiki/Getting-Started-Basic-Def

cross scala version if your library supports many version

sbt commands

reload

+compile, +test, +run

compile for every version in cross scala versions

entry point if you have many, if you have only one entry point it will find it

libraryDependencies += "org.apache.derby" % "derby" % "10.4.1.3"
can use Java and scala libraries
%%
  append my scala version to the version number

https://github.com/ymasory/sbt-prototype
test writer
https://github.com/rickynils/scalacheck
Junit
ScalaUnit
ScalaCheck

more build.properties
sbt.version=0.11.3

SBT is continuous build . like Roo or maven but more

src/main/scala

build.sbt

see sbt-prototype

don’t look at googlecode
Publishing to SBT local repo (at least for my home directory) publishTo := Some(Resolver.file(“maven-local-repo”, file(“/home/jsuereth/.m2/repository”)))
#sbt
#scala
IRC freenode
Setting up an Akka “hello world” project using SBT (and also ‘sbt make-pom’ to let Netbeans open the project and be my .scala editor) https://github.com/tvaughan77/scalathon-akka
https://github.com/harrah/xsbt/wiki/Getting-Started-Basic-Def

https://github.com/ymasory/sbt-prototype

https://github.com/rickynils/scalacheck

one run for ~compile always on

one running profilers/test

https://github.com/softprops/conscript-example.g8

https://github.com/softprops/conscript-example

http://adopting-conscript.lessis.me/#0

https://github.com/tvaughan77/scalathon-akka

 

Scala Basics

doesnt care what the name or location of the file

can put dozens of objects into one file

we’re talking about http://pamflet.databinder.net/Pamflet.html in the front

programming in scala 2nd edition  : odersky

http://pragprog.com/magazines/2012-07/scala-for-the-intrigued

Free Node   IRC

irc.freedone.net

#scalathon

Setting up SBT

https://github.com/harrah/xsbt/wiki/Getting-Started-Setup
Scala on Heroku

http://blog.heroku.com/archives/2011/10/3/scala/

https://devcenter.heroku.com/articles/scaling-out-with-scala-and-akka

http://twitter.github.com/scala_school/

http://www.planetscala.com/

http://scala-ide.org/

https://devcenter.heroku.com/articles/scala

https://github.com/foursquare/rogue/

http://www.assembla.com/wiki/show/liftweb/Mongo_Record_Basics

http://www.mongodb.org/display/DOCS/Scala+Language+Center

http://api.mongodb.org/scala/casbah/current/tutorial.html

http://www.assembla.com/wiki/show/liftweb/MongoDB

http://liftweb.net/

https://github.com/jdegoes/blueeyes

https://github.com/Mironor/Play-2.0-Scala-MongoDb-Salat-exemple

https://github.com/vznet/play-mongo-jackson-mapper

http://fabiokung.com/2011/08/06/running-java-web-applications-on-heroku-cedar-stack/
Main

http://www.jamesward.com/2011/10/19/running-play-framework-scala-apps-on-heroku
http://www.jamesward.com/2012/02/21/play-framework-2-with-scala-anorm-json-coffeescript-jquery-heroku

http://whatiscomingtomyhead.wordpress.com/2012/01/28/getting-started-with-play-2-0-heroku-and-scala/

http://scala.herokuapp.com/

http://typesafe.com/stack/download

downloaded heroku toolbelt

downloaded sbt

http://www.scala-lang.org/downloads
http://scala-ide.org/ 2.0.1

http://scala-ide.org/docs/tutorials/index.html

http://ant.apache.org/ivy/download.cgi

http://thedailywtf.com/

http://www.codecademy.com/courses/basic-jquery?curriculum_id=4f4bdd96848740000300026a

http://yuvimasory.com/software

https://gist.github.com/3191654

https://gist.github.com/3190486

https://github.com/harrah/xsbt

https://github.com/ymasory/scalaz-talk-phase

 

 

 
 
 

 

 

 

 

 

 

Written By bunkertor

Leave a Reply

Your email address will not be published. Required fields are marked *