Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
update to use scrooge, and more recent versions of all libs
Browse files Browse the repository at this point in the history
  • Loading branch information
Robey Pointer committed Nov 17, 2011
1 parent 766b9b3 commit 3c93e21
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 28 deletions.
7 changes: 6 additions & 1 deletion bin/scala-bootstrapper
Expand Up @@ -115,7 +115,12 @@ if File.exists?("src/scripts/startup.sh")
$files << startup
end

[ "src/scripts/#{project_name.downcase}.sh", "src/scripts/console", "run" ].each do |executable|
[
"src/scripts/#{project_name.downcase}.sh",
"src/scripts/console",
"src/scripts/devel.sh",
"run"
].each do |executable|
`chmod +x #{executable}` if File.exists?(executable)
end

Expand Down
13 changes: 5 additions & 8 deletions lib/template/project/build/BirdNameProject.scala.erb
Expand Up @@ -10,25 +10,22 @@ import com.twitter.sbt._
* mean to add a dependency on exampleland version 1.0.3 from provider "com.example".
*/
class BirdNameProject(info: ProjectInfo) extends StandardServiceProject(info)
with CompileThriftScala
with NoisyDependencies
with DefaultRepos
with SubversionPublisher
with PublishSourcesAndJavadocs
with PublishSite
with CompileThriftRuby
with CompileThriftScroogeMixin
{
val finagleVersion = "1.9.1"
val finagleVersion = "1.9.5"

val finagleC = "com.twitter" % "finagle-core" % finagleVersion
val finagleT = "com.twitter" % "finagle-thrift" % finagleVersion
val finagleO = "com.twitter" % "finagle-ostrich4" % finagleVersion

override def originalThriftNamespaces = Map("BirdName" -> "com.twitter.birdname.thrift")
override val scalaThriftTargetNamespace = "com.twitter.birdname"

val slf4jVersion = "1.5.11"
val slf4jApi = "org.slf4j" % "slf4j-api" % slf4jVersion withSources() intransitive()
val slf4jBindings = "org.slf4j" % "slf4j-jdk14" % slf4jVersion withSources() intransitive()
val scrooge_runtime = "com.twitter" % "scrooge-runtime" % "1.0.3"
override def scroogeVersion = "2.2.0"

// for tests
val specs = "org.scala-tools.testing" % "specs_2.8.1" % "1.6.7" % "test" withSources()
Expand Down
5 changes: 3 additions & 2 deletions lib/template/project/plugins/Plugins.scala.erb
Expand Up @@ -19,6 +19,7 @@ class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
}
override def ivyRepositories = Seq(Resolver.defaultLocal(None)) ++ repositories

val standardProject = "com.twitter" % "standard-project" % "0.12.7"
val sbtThrift = "com.twitter" % "sbt-thrift" % "1.4.4"
val standardProject = "com.twitter" % "standard-project" % "1.0.0"
val sbtThrift = "com.twitter" % "sbt-thrift" % "2.0.1"
val sbtScrooge = "com.twitter" % "sbt-scrooge" % "2.2.0"
}
@@ -1,11 +1,13 @@
package com.twitter.birdname

import com.twitter.logging.Logger
import com.twitter.util._
import java.util.concurrent.Executors
import scala.collection.mutable
import com.twitter.util._
import config._
import thrift._

class BirdNameServiceImpl(config: BirdNameServiceConfig) extends BirdNameServiceServer {
class BirdNameServiceImpl(config: BirdNameServiceConfig) extends BirdNameService.ThriftServer {
val serverName = "BirdName"
val thriftPort = config.thriftPort

Expand All @@ -15,7 +17,6 @@ class BirdNameServiceImpl(config: BirdNameServiceConfig) extends BirdNameService
* a thread pool, so that you don't block the main event loop. This thread pool is only
* needed for these blocking actions. The code looks like:
*
* // Depends on com.twitter.util >= 1.6.10
* val futurePool = new FuturePool(Executors.newFixedThreadPool(config.threadPoolSize))
*
* def hello() = futurePool {
Expand All @@ -40,6 +41,6 @@ class BirdNameServiceImpl(config: BirdNameServiceConfig) extends BirdNameService
def put(key: String, value: String) = {
log.debug("put %s", key)
database(key) = value
Future.void
Future.Unit
}
}
@@ -1,12 +1,16 @@
package com.twitter.birdname

import com.twitter.logging.Logger
import com.twitter.ostrich.admin.RuntimeEnvironment
import thrift._

object Main {
private val log = Logger.get(getClass)

def main(args: Array[String]) {
val env = RuntimeEnvironment(this, args)
val service = env.loadRuntimeConfig[BirdNameServiceServer]
val service = env.loadRuntimeConfig[BirdNameService.ThriftServer]()
service.start()
log.info("BirdName %s started.", env.jarVersion)
}
}

Expand Up @@ -6,8 +6,9 @@ import com.twitter.logging.config._
import com.twitter.ostrich.admin.{RuntimeEnvironment, ServiceTracker}
import com.twitter.ostrich.admin.config._
import com.twitter.util.Config
import thrift._

class BirdNameServiceConfig extends ServerConfig[BirdNameServiceServer] {
class BirdNameServiceConfig extends ServerConfig[BirdNameService.ThriftServer] {
var thriftPort: Int = 9999

def apply(runtime: RuntimeEnvironment) = new BirdNameServiceImpl(this)
Expand Down
@@ -1,18 +1,20 @@
package com.twitter.birdname

import org.specs.Specification
import com.twitter.conversions.time._
import com.twitter.ostrich.admin._
import com.twitter.util._
import com.twitter.conversions.time._
import org.specs.Specification
import thrift._

abstract class AbstractSpec extends Specification {
val env = RuntimeEnvironment(this, Array("-f", "config/test.scala"))

lazy val birdName = {
val out = env.loadRuntimeConfig[BirdNameService]
val out = env.loadRuntimeConfig[BirdNameService.ThriftServer]

// You don't really want the thrift server active, particularly if you
// are running repetitively via ~test
ServiceTracker.shutdown // all services
ServiceTracker.shutdown() // all services
out
}
}
14 changes: 8 additions & 6 deletions scala-bootstrapper.gemspec
Expand Up @@ -8,11 +8,12 @@ Gem::Specification.new do |s|
s.version = "0.9.3"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = [%q{Kyle Maxwell}]
s.date = %q{2011-10-14}
s.authors = ["Kyle Maxwell"]
s.date = %q{2011-11-17}
s.default_executable = %q{scala-bootstrapper}
s.description = %q{Twitter scala project init}
s.email = %q{kmaxwell@twitter.com}
s.executables = [%q{scala-bootstrapper}]
s.executables = ["scala-bootstrapper"]
s.extra_rdoc_files = [
"LICENSE",
"README.rdoc"
Expand Down Expand Up @@ -51,14 +52,15 @@ Gem::Specification.new do |s|
"vendor/trollop.rb"
]
s.homepage = %q{http://github.com/fizx/scala-bootstrapper}
s.require_paths = [%q{lib}]
s.rubygems_version = %q{1.8.5}
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.6}
s.summary = %q{Twitter scala project init}

if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
else
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
Expand Down

0 comments on commit 3c93e21

Please sign in to comment.