Permalink
Browse files

remove old sbt files, and provide only up to date ones

  • Loading branch information...
danielschonfeld
danielschonfeld committed Mar 26, 2012
1 parent 74d9cf7 commit 1937ab5a325fe965e1035276e8c3e202b791348d
Showing with 22 additions and 949 deletions.
  1. +2 −11 bin/scala-bootstrapper
  2. +0 −1 lib/template/Gemfile
  3. 0 lib/{template2 → template}/build.sbt.erb
  4. 0 lib/{template2 → template}/console.erb
  5. +0 −8 lib/template/project/build.properties
  6. +0 −48 lib/template/project/build/BirdNameProject.scala.erb
  7. 0 lib/{template2 → template}/project/plugins.sbt
  8. +0 −24 lib/template/project/plugins/Plugins.scala.erb
  9. 0 lib/{template2 → template}/src/main/scala/com/twitter/birdname/BirdNameConsoleClient.scala.erb
  10. +2 −2 lib/template/src/main/scala/com/twitter/birdname/BirdNameServiceImpl.scala.erb
  11. +15 −4 lib/template/src/main/scala/com/twitter/birdname/Main.scala.erb
  12. +1 −1 lib/template/src/main/scala/com/twitter/birdname/config/BirdNameServiceConfig.scala.erb
  13. +1 −1 lib/template/src/main/thrift/birdname.thrift.erb
  14. +0 −29 lib/template/src/scripts/console.erb
  15. +0 −10 lib/template2/.gitignore.erb
  16. +0 −27 lib/template2/Capfile
  17. +0 −7 lib/template2/Gemfile
  18. +0 −24 lib/template2/README.md
  19. +0 −187 lib/template2/TUTORIAL.md
  20. +0 −41 lib/template2/config/development.scala.erb
  21. +0 −41 lib/template2/config/production.scala.erb
  22. +0 −41 lib/template2/config/staging.scala.erb
  23. +0 −26 lib/template2/config/test.scala.erb
  24. +0 −125 lib/template2/run
  25. +0 −45 lib/template2/src/main/scala/com/twitter/birdname/BirdNameServiceImpl.scala.erb
  26. +0 −23 lib/template2/src/main/scala/com/twitter/birdname/Main.scala.erb
  27. +0 −14 lib/template2/src/main/scala/com/twitter/birdname/config/BirdNameServiceConfig.scala.erb
  28. +0 −20 lib/template2/src/main/thrift/birdname.thrift.erb
  29. +0 −137 lib/template2/src/scripts/startup.sh
  30. +0 −18 lib/template2/src/test/scala/com/twitter/birdname/AbstractSpec.scala.erb
  31. +0 −14 lib/template2/src/test/scala/com/twitter/birdname/BirdNameServiceSpec.scala.erb
  32. +1 −20 scala-bootstrapper.gemspec
View
@@ -8,7 +8,6 @@ opts = Trollop::options do
opt :public, "Use the public twitter maven repo"
opt :namespace, "Use something besides com.twitter", :type => :string
opt :git, "Use Git to track updates to generated files"
- opt :sbt11, "Setup an SBT 0.11 and Finagle2 skeleton"
end
@@ -87,11 +86,7 @@ if git
end
end
-if sbt11_requested
- root = File.expand_path(File.dirname(__FILE__) + "/../lib/template2")
-else
- root = File.expand_path(File.dirname(__FILE__) + "/../lib/template")
-end
+root = File.expand_path(File.dirname(__FILE__) + "/../lib/template")
Dir["#{root}/**/*"].select{|path| File.file?(path)}.each do |path|
relative = path.sub("#{root}/", "")
@@ -126,13 +121,9 @@ 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", "console", "run" ].each do |executable|
`chmod +x #{executable}` if File.exists?(executable)
end
-
-if sbt11_requested
- `chmod +x console` if File.exists?('console')
-end
if git
$files.each { |file| sys("git add #{file}") if File.exists?(file) }
View
@@ -5,4 +5,3 @@ gem "thrift_client", "0.6.2"
gem "thrift", "0.6"
gem "railsless-deploy"
gem "capistrano"
-gem "twitter-cap-utils", "~>0.8.0"
File renamed without changes.
File renamed without changes.
@@ -1,8 +0,0 @@
-#Project properties
-#Thu Feb 24 16:45:35 PST 2011
-project.organization=com.twitter
-project.name=birdname
-sbt.version=0.7.4
-project.version=1.0.0-SNAPSHOT
-build.scala.versions=2.8.1
-project.initialize=false
@@ -1,48 +0,0 @@
-import sbt._
-import Process._
-import com.twitter.sbt._
-
-/**
- * Sbt project files are written in a DSL in scala.
- *
- * The % operator is just turning strings into maven dependency declarations, so lines like
- * val example = "com.example" % "exampleland" % "1.0.3"
- * 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
-{
- val finagleVersion = "1.2.5"
-
- val finagleC = "com.twitter" % "finagle-core" % finagleVersion
- val finagleT = "com.twitter" % "finagle-thrift" % finagleVersion
- val finagleO = "com.twitter" % "finagle-ostrich4" % finagleVersion
-
- // thrift
- val libthrift = "thrift" % "libthrift" % "0.5.0"
- val util = "com.twitter" % "util" % "1.8.3"
-
- 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()
-
- // for tests
- val specs = "org.scala-tools.testing" % "specs_2.8.1" % "1.6.7" % "test" withSources()
- val jmock = "org.jmock" % "jmock" % "2.4.0" % "test"
- val hamcrest_all = "org.hamcrest" % "hamcrest-all" % "1.1" % "test"
- val cglib = "cglib" % "cglib" % "2.1_3" % "test"
- val asm = "asm" % "asm" % "1.5.3" % "test"
- val objenesis = "org.objenesis" % "objenesis" % "1.1" % "test"
-
- override def mainClass = Some("com.twitter.birdname.Main")
-
- override def subversionRepository = Some("http://svn.local.twitter.com/maven<%= '-public' if is_public %>")
-}
@@ -1,24 +0,0 @@
-import sbt._
-
-class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
- import scala.collection.jcl
- val environment = jcl.Map(System.getenv())
- def isSBTOpenTwitter = environment.get("SBT_OPEN_TWITTER").isDefined
- def isSBTTwitter = environment.get("SBT_TWITTER").isDefined
-
- override def repositories = if (isSBTOpenTwitter) {
- Set("twitter.artifactory" at "http://artifactory.local.twitter.com/open-source/")
- } else if (isSBTTwitter) {
- Set("twitter.artifactory" at "http://artifactory.local.twitter.com/repo/")
- } else {
- super.repositories ++ Set(
- "twitter.com" at "http://maven.twttr.com/",
- "scala-tools" at "http://scala-tools.org/repo-releases/",
- "freemarker" at "http://freemarker.sourceforge.net/maven2/"
- )
- }
- 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"
-}
@@ -5,7 +5,7 @@ import scala.collection.mutable
import com.twitter.util._
import config._
-class BirdNameServiceImpl(config: BirdNameServiceConfig) extends BirdNameServiceServer {
+class BirdNameServiceImpl(config: BirdNameServiceConfig) extends BirdNameService.ThriftServer {
val serverName = "BirdName"
val thriftPort = config.thriftPort
@@ -40,6 +40,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,23 @@
package com.twitter.birdname
-import com.twitter.ostrich.admin.RuntimeEnvironment
+import com.twitter.logging.Logger
+import com.twitter.ostrich.admin.{RuntimeEnvironment, ServiceTracker}
object Main {
+ val log = Logger.get(getClass)
+
def main(args: Array[String]) {
- val env = RuntimeEnvironment(this, args)
- val service = env.loadRuntimeConfig[BirdNameServiceServer]
- service.start()
+ val runtime = RuntimeEnvironment(this, args)
+ val server = runtime.loadRuntimeConfig[BirdNameService.ThriftServer]
+ try {
+ log.info("Starting BirdNameService")
+ server.start()
+ } catch {
+ case e: Exception =>
+ log.error(e, "Failed starting BirdNameService, exiting")
+ ServiceTracker.shutdown()
+ System.exit(1)
+ }
}
}
@@ -7,7 +7,7 @@ import com.twitter.ostrich.admin.{RuntimeEnvironment, ServiceTracker}
import com.twitter.ostrich.admin.config._
import com.twitter.util.Config
-class BirdNameServiceConfig extends ServerConfig[BirdNameServiceServer] {
+class BirdNameServiceConfig extends ServerConfig[BirdNameService.ThriftServer] {
var thriftPort: Int = 9999
def apply(runtime: RuntimeEnvironment) = new BirdNameServiceImpl(this)
@@ -1,4 +1,4 @@
-namespace java com.twitter.birdname.thrift
+namespace java com.twitter.birdname
namespace rb BirdName
/**
@@ -1,29 +0,0 @@
-#!/usr/bin/env ruby
-$: << File.dirname(__FILE__) + "/../../../target/gen-rb"
-
-require "rubygems"
-require "bundler/setup"
-
-require "thrift"
-require "thrift_client"
-require "bird_name_service"
-require "irb"
-
-class BirdNameClient < ThriftClient
- DEFAULTS = { :transport_wrapper => Thrift::FramedTransport }
- def initialize(servers = nil, options = {})
- if servers.nil? or servers.empty?
- STDERR.puts "No servers specified, using 127.0.0.1:9999"
- servers = ['127.0.0.1:9999']
- else
- servers = Array(servers)
- end
-
- super(BirdName::BirdNameService::Client, servers, DEFAULTS.merge(options))
- end
-end
-
-puts "Hint: the client is in the variable `$client`"
-$client = BirdNameClient.new ARGV.shift
-
-IRB.start
@@ -1,10 +0,0 @@
-*.class
-*.log
-
-# sbt specific
-dist/*
-target/
-lib_managed/
-src_managed/
-project/boot/
-project/plugins/project/
View
@@ -1,27 +0,0 @@
-# Docs at http://confluence.local.twitter.com/display/RELEASE/Twitter-cap-utils+README
-begin
- require 'rubygems'
- require "bundler/setup"
- require "railsless-deploy"
- require 'twitter_cap_utils'
-rescue LoadError => e
- puts e.message
- abort "Please gem install twitter-cap-utils railsless-deploy"
-end
-
-set :user, :twitter
-set :application, "birdname"
-set :repository, "http://git.local.twitter.com/ro/#{application}"
-
-task :staging do
- role :app, "server1", "server2", "etc"
-end
-
-task :canary do
- role :app, "server1"
-end
-
-task :production do
- role :app, "server1", "server2", "etc"
-end
-
View
@@ -1,7 +0,0 @@
-# use "bundle install" to update gems; "gem install bundler" to install bundler.
-source :rubygems
-source "http://gems.local.twitter.com"
-gem "thrift_client", "0.6.2"
-gem "thrift", "0.6"
-gem "railsless-deploy"
-gem "capistrano"
View
@@ -1,24 +0,0 @@
-# Project BirdName
-
-Welcome to your birdname project! To make sure things are working
-properly, you may want to:
-
- $ sbt update test
-
-There is a tutorial for what to do next, which you can find in the
-scala-bootstrapper README.rdoc file.
-
-# Configuring Intellij
-
-If you want to setup Intellij, it has to happen off to the side:
-
- $ sbt
- > *sbtIdeaRepo at http://mpeltonen.github.com/maven/
- > *idea is com.github.mpeltonen sbt-idea-processor 0.4.0
- > update
- > idea
-
-# Documenting your project
-
-Add documentation here! Eventually, you'll be able to publish this to
-a web site for the world to easily find and read.
Oops, something went wrong.

0 comments on commit 1937ab5

Please sign in to comment.