Skip to content

Commit

Permalink
Merge pull request #67 from ThoughtWorksInc/master
Browse files Browse the repository at this point in the history
Fix dependency between BaseHaxePlugin and other plugins
  • Loading branch information
chank committed Sep 15, 2015
2 parents 27afbc6 + 5ea62c4 commit 92b666e
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/scala/com/qifun/sbtHaxe/HaxeAs3Plugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import sbt._
* A Plugin used to compile Haxe sources to Action Script 3 sources.
*/
object HaxeAs3Plugin extends AutoPlugin {

override final def requires = BaseHaxePlugin

override final lazy val projectSettings: Seq[Setting[_]] = {
sbt.addArtifact(artifact in packageBin in HaxeAs3, packageBin in HaxeAs3) ++
inConfig(As3)(SbtHaxe.baseHaxeSettings) ++
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/com/qifun/sbtHaxe/HaxeCSharpPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import HaxeConfigurations._
* A plugin used to compile Haxe sources to CSharp sources.
*/
final object HaxeCSharpPlugin extends AutoPlugin {

override final def requires = BaseHaxePlugin

override final lazy val projectSettings: Seq[Setting[_]] =
sbt.addArtifact(artifact in packageBin in HaxeCSharp, packageBin in HaxeCSharp) ++
inConfig(CSharp)(SbtHaxe.baseHaxeSettings) ++
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/com/qifun/sbtHaxe/HaxeCppPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import sbt._
* A Plugin used to compile Haxe sources to C++ sources.
*/
object HaxeCppPlugin extends AutoPlugin {

override final def requires = BaseHaxePlugin

override final lazy val projectSettings: Seq[Setting[_]] = {
sbt.addArtifact(artifact in packageBin in HaxeCpp, packageBin in HaxeCpp) ++
inConfig(Cpp)(SbtHaxe.baseHaxeSettings) ++
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/com/qifun/sbtHaxe/HaxeFlashPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import sbt._
* A Plugin used to compile Haxe sources to Flash swf file.
*/
object HaxeFlashPlugin extends AutoPlugin {

override final def requires = BaseHaxePlugin

override final lazy val projectSettings: Seq[Setting[_]] = {
sbt.addArtifact(artifact in packageBin in HaxeFlash, packageBin in HaxeFlash) ++
inConfig(Flash)(SbtHaxe.baseHaxeSettings) ++
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/com/qifun/sbtHaxe/HaxeJavaPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import sbt.AutoPlugin
* A Plugin used to compile Haxe sources to Java sources.
*/
final object HaxeJavaPlugin extends AutoPlugin {

override final def requires = BaseHaxePlugin

override final def trigger = allRequirements

override final lazy val projectSettings: Seq[Setting[_]] =
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/com/qifun/sbtHaxe/HaxeJsPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import sbt._
* A Plugin used to compile Haxe sources to JavaScript sources.
*/
object HaxeJsPlugin extends AutoPlugin {

override final def requires = BaseHaxePlugin

override final lazy val projectSettings: Seq[Setting[_]] = {
sbt.addArtifact(artifact in packageBin in HaxeJs, packageBin in HaxeJs) ++
inConfig(Js)(SbtHaxe.baseHaxeSettings) ++
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/com/qifun/sbtHaxe/HaxeNekoPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import sbt._
* A Plugin used to compile Haxe sources to Neko binary.
*/
object HaxeNekoPlugin extends AutoPlugin {

override final def requires = BaseHaxePlugin

override final lazy val projectSettings: Seq[Setting[_]] = {
sbt.addArtifact(artifact in packageBin in HaxeNeko, packageBin in HaxeNeko) ++
inConfig(Neko)(SbtHaxe.baseHaxeSettings) ++
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/com/qifun/sbtHaxe/HaxePhpPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import sbt._
* A Plugin used to compile Haxe sources to PHP sources.
*/
object HaxePhpPlugin extends AutoPlugin {

override final def requires = BaseHaxePlugin

override final lazy val projectSettings: Seq[Setting[_]] = {
sbt.addArtifact(artifact in packageBin in HaxePhp, packageBin in HaxePhp) ++
inConfig(Php)(SbtHaxe.baseHaxeSettings) ++
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/com/qifun/sbtHaxe/HaxePythonPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import sbt._
* A Plugin used to compile Haxe sources to Python sources.
*/
object HaxePythonPlugin extends AutoPlugin {

override final def requires = BaseHaxePlugin

override final lazy val projectSettings: Seq[Setting[_]] = {
sbt.addArtifact(artifact in packageBin in HaxePython, packageBin in HaxePython) ++
inConfig(Python)(SbtHaxe.baseHaxeSettings) ++
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/com/qifun/sbtHaxe/SbtHaxe.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import Keys._
import HaxeKeys._
import HaxeConfigurations._

import scala.util.parsing.json.JSONFormat

final object SbtHaxe {

private lazy val HaxeFileRegex = """^(.*)\.hx$""".r
Expand Down Expand Up @@ -74,7 +76,7 @@ final object SbtHaxe {
(haxeOutputPath in injectConfiguration).value.getOrElse(temporaryDirectory).getPath) ++
(haxeOptions in injectConfiguration in haxe).value ++
haxeModules(in, (sourceDirectories in haxeConfiguration).value)
(streams in haxeConfiguration).value.log.info(processBuilder.mkString("\"", "\" \"", "\""))
(streams in haxeConfiguration).value.log.info(processBuilder.map(JSONFormat.quoteString).mkString("\"", "\" \"", "\""))
val logger = (streams in haxeConfiguration).value.log
IO.delete(haxeOutput)
class HaxeProcessLogger extends ProcessLogger {
Expand Down

0 comments on commit 92b666e

Please sign in to comment.