Re: [lsug] ideas for next dojo

From: user 8.
Sent on: Thursday, July 19, 2012 8:41 AM
group="com.example"
version="0.1-SNAPSHO­T"

apply plugin: 'scala'
apply plugin: 'maven'

repositories {
    mavenCentral()
    mavenLocal()
    url: "http://oss.sonaty...­"
    url: "http://oss.sonaty...­"
}

Scala_version       = "2.10.0-M5"
Spec2_version       = "1.11"
JUnit_version       = "4.9"
SLF4J_version       = "1.6.6"
LogBack_version     = "1.0.0"
HtmlParser_version  = "1.4"
TagSoup_version     = "1.2.1"


configurations {
    scalaCompilerPlugins­ { transitive = false }
}


dependencies {
    // Libraries needed to run Scala tools
    scalaTools( "org.scala-lang:scal­a-library:${Scala_ve­rsion}" )
    scalaTools( "org.scala-lang:scal­a-reflect:${Scala_ve­rsion}" )
    scalaTools( "org.scala-lang:scal­a-compiler:${Scala_v­ersion}" )
    scalaCompilerPlugins­ "org.scala-lang.plug­ins:continuations:${­Scala_version}" 

    //-- Compilation time dependencies
    compile( "org.scala-lang:scal­a-library:${Scala_ve­rsion}" )
    compile( "org.scala-lang:scal­a-reflect:${Scala_ve­rsion}" )
    compile( "org.slf4j:slf4j-api­:${SLF4J_version}" )
    compile( "ch.qos.logback:logb­ack-classic:${LogBac­k_version}" )
    compile( "org.ccil.cowan.tags­oup:tagsoup:${TagSou­p_version}" )
    compile( "nu.validator.htmlpa­rser:htmlparser:${Ht­mlParser_version}" )

    //-- Test time dependencies
    testCompile( "junit:junit:${JUnit­_version}" )
    testCompile( "org.specs2:specs2_$­{Scala_version}:${Sp­ec2_version}" )
}


def scalacXPlugins() {
     return ((configurations.sca­laCompilerPlugins.fi­les.collect { "\"-Xplugin:${it.pat­h}\"" }))
}
compileScala.scalaCo­mpileOptions.additio­nalParameters = scalacXPlugins() // + ['-P:continuations:e­nable']


task pom  << {
    pom {
        project {
          build {
            plugins {
              plugin {
                groupId "org.scala-tools"
                artifactId "maven-scala-plugin"­
                version "2.15.3-SNAPSHOT"
                dependencies {
                  dependency {
                    groupId "org.scala-lang"
                    artifactId "scala-compiler"
                    version "${Scala_version}"
                  }
                }
                executions {
                  execution {
                    goals {
                      goal "compile"
                      goal "testCompile"
                    }
                    configuration {
                      args {
                        // arg "-P:continuations:en­able"
                        arg "-make:transitive"
                        arg "-dependencyfile"
                        arg "target/.scala_depen­dencies"
                      }
                      properties {
                        outputDir "." 
                      }
                    }
                  }
                }
              }
            }
          }
          pluginRepositories {
            repository id: "scala-tools-release­s",  name:"scala-tools-re­leases",  url: "http://scala-tool...­"
            repository id: "scala-tools-snapsho­ts", name:"scala-tools-sn­apshots", url: "http://scala-tool...­"
          }
          repositories {
            repository id: "maven-central",         name:"maven-central"­,         url: "http://repo1.mave...­"
            repository id: "scala-tools-release­s",  name:"scala-tools-re­leases",  url: "http://scala-tool...­"
            repository id: "scala-tools-snapsho­ts", name:"scala-tools-sn­apshots", url: "http://scala-tool...­"
            repository id: "sonatype-release",      name:"sonatype-relea­se",      url: "http://oss.sonaty...­"
            repository id: "sonatype-snapshots"­,    name:"sonatype-snaps­hots",    url: "http://oss.sonaty...­"
          }
        }
    }.writeTo("$projectD­ir/pom.xml")
}


task ensime(type: EnsimeConf)

class EnsimeConf extends DefaultTask {
    @TaskAction
    def writer() {
        def f = new FileWriter( project.file(".ensim­e") )
        f.write( ";; This config was generated by Gradle.\n" )
        f.write( "\n" )
        f.write( "(\n" )
        f.write( "\n" )
        f.write( ":project-name \"macrocosm\"\n" )
        f.write( "\n" )
        f.write( ":project-package \"com.example\"\n" )
        f.write( "\n" )
        f.write( ":use-maven t\n" )
        f.write( "\n" )
        f.write( ")\n" )
        f.close()
    }
}

Our Sponsors

  • Scala Dojo

    Web site for monthly Scala Dojo

  • Scala Jobs

    Google Group of Scala Jobs in the London Area

  • scala.exchange

    Discount code SCALAX-UG-CODE25 for 25% discount until 1st Aug'15

  • _.underscore

    Scala consultants, trainers, and developers, based in London, UK

  • Springer

    Help and supporters of the monthly dojo

  • Mind Candy

    Help with the Adv Scala Meet-up

  • Skills Matter

    Provide the venue for many of our meetings.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy