readme.txt 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. Getting started with Protocol Buffers on Mono
  2. ---------------------------------------------
  3. Prerequisites:
  4. o Mono 2.4 or higher. Earlier versions of Mono had too
  5. many issues with the weird and wonderful generic type
  6. relationships in Protocol Buffers. (Even Mono 2.4 *did*
  7. have a few compile-time problems, but I've worked round them.)
  8. o Some sort of Linux/Unix system
  9. You can try running with Bash on Windows via MINGW32 or
  10. something similar, but you're on your own :) It's easier
  11. to build and test everything with .NET if you're on
  12. Windows.
  13. o The native Protocol Buffers build for your system.
  14. Get it from http://code.google.com/p/protobuf/
  15. After building it, copy the executable protoc
  16. file into this directory.
  17. o The NUnit binaries from http://nunit.org
  18. I generally just download the latest version, which
  19. may not be the one which goes with nunit.framework.dll
  20. in ../lib, but I've never found this to be a problem.
  21. Building the code with current sources
  22. --------------------------------------
  23. 1) Edit buildall.sh to tell it where to find nunit-console.exe
  24. (and possibly change other options)
  25. 2) Run buildall.sh from this directory. It should build the
  26. main library code + tests and ProtoGen code + tests, running
  27. each set of tests after building it.
  28. Note that currently one test is ignored in ServiceTest.cs. This
  29. made the Mono VM blow up - I suspect it's some interaction with
  30. Rhino which doesn't quite work on Mono 2.4. If you want to see a
  31. truly nasty stack trace, just comment out the Ignore attribute in
  32. ServiceTest.cs and rerun.
  33. The binaries will be produced in a bin directory under this one. The
  34. build currently starts from scratch each time, cleaning out the bin
  35. directory first. Once I've decided on a full NAnt or xbuild
  36. strategy, I'll do something a little cleaner.
  37. Rebuilding sources for generated code
  38. -------------------------------------
  39. 1) Build the current code first. The bootstrapping issue is why
  40. the generated source code is in the source repository :) See
  41. the steps above.
  42. 2) Run generatesource.sh from this directory. This will create a
  43. temporary directory, compile the .proto files into a binary
  44. format, then run ProtoGen to generate .cs files from the binary
  45. format. It will copy these files to the right places in the tree,
  46. and finally delete the temporary directory.
  47. 3) Rebuild to test that your newly generated sources work. (Optionally
  48. regenerate as well, and hash the generated files to check that
  49. the new build generates the same code as the old build :)
  50. Running the code
  51. ----------------
  52. Once you've built the binaries, you should be able to use them just
  53. as if you'd built them with .NET. (And indeed, you should be able to
  54. use binaries built with .NET as if you'd built them with Mono :)
  55. See the getting started guide for more information:
  56. http://code.google.com/p/protobuf-csharp-port/wiki/GettingStarted
  57. FAQ (Frequently Anticipated Questions)
  58. --------------------------------------
  59. Q) This build process sucks! Why aren't you doing X, Y, Z?
  60. A) My Mono skills are limited. My NAnt skills are limited. My
  61. MSBuild/xbuild skils are limited. My shell script skills are
  62. limited. Any help is *very* welcome!
  63. Q) Why doesn't it build ProtoBench etc?
  64. A) This is a first initial "release" I'll add more bits to
  65. the build script. I'll be interested to see the results
  66. of benchmarking it on Mono :)
  67. Any further questions or suggestions? Please email skeet@pobox.com
  68. or leave a request at
  69. http://code.google.com/p/protobuf-csharp-port/issues/list