Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

CompileThriftPhp #6

Merged
merged 2 commits into from

2 participants

@bmatheny

For those of us not using ruby or python, being able to build php bindings would be great.

@mariusae mariusae merged commit 36d2bf9 into from
@mariusae
Collaborator

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 30, 2011
  1. @bmatheny

    Adding PHP thrift compile.

    bmatheny authored
  2. @bmatheny

    Update README with PHP info

    bmatheny authored
This page is out of date. Refresh to see the latest.
View
1  README.md
@@ -6,6 +6,7 @@ compile phase. Choose one of these three:
- `CompileThriftFinagle` - create the java bindings with alternative async interfaces for finagle, in `target/gen-java/`
- `CompileThriftJava` - create just the java bindings, in `target/gen-java/`
+- `CompileThriftPhp` - create just the PHP bindings, in `target/gen-php/`
- `CompileThriftPython` - create just the python bindings, in `target/gen-py/ (or target/gen-py.twisted/)`
- `CompileThriftRuby` - create just the ruby bindings, in `target/gen-ruby/`
- `CompileThriftScala` - do `CompileThriftFinagle` and `CompileThriftRuby`, but also generate scala wrappers and implicit conversions in `target/gen-scala/`
View
21 src/main/scala/com/twitter/sbt/CompileThriftPhp.scala
@@ -0,0 +1,21 @@
+package com.twitter.sbt
+
+import _root_.sbt._
+
+/**
+ * Generate plain-old-php bindings
+ */
+trait CompileThriftPhp extends CompileThrift {
+ lazy val compileThriftPhp = compileThriftAction("php")
+
+ lazy val autoCompileThriftPhp = task {
+ if (autoCompileThriftEnabled) {
+ compileThriftPhp.run
+ } else {
+ log.info("%s: not auto-compiling thrift-php; you may need to run compile-thrift-php manually".format(name))
+ None
+ }
+ }
+
+ override def compileAction = super.compileAction dependsOn(autoCompileThriftPhp)
+}
View
3  src/main/scala/com/twitter/sbt/GeneratedSources.scala
@@ -5,11 +5,13 @@ import _root_.sbt._
trait GeneratedSources extends DefaultProject {
def generatedJavaDirectoryName = "gen-java"
def generatedRubyDirectoryName = "gen-rb"
+ def generatedPhpDirectoryName = "gen-php"
def generatedPythonDirectoryName = "gen-py"
def generatedScalaDirectoryName = "gen-scala"
def generatedJavaPath = outputPath / generatedJavaDirectoryName
def generatedRubyPath = outputPath / generatedRubyDirectoryName
+ def generatedPhpPath = outputPath / generatedPhpDirectoryName
def generatedPythonPath = outputPath / generatedPythonDirectoryName
def generatedScalaPath = outputPath / generatedScalaDirectoryName
@@ -18,6 +20,7 @@ trait GeneratedSources extends DefaultProject {
lazy val cleanGenerated = (
cleanTask(generatedJavaPath) && cleanTask(generatedRubyPath)
&& cleanTask(generatedPythonPath) && cleanTask(generatedScalaDirectoryName)
+ && cleanTask(generatedPhpPath)
) describedAs "Clean generated source folders"
override def cleanAction = super.cleanAction dependsOn(cleanGenerated)
Something went wrong with that request. Please try again.