wscript 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. # Thomas Nagy, 2006-2010 (ita)
  4. """
  5. java example
  6. The gcj compiler has a very different command-line - see playground/gcj
  7. """
  8. VERSION = '0.0.4'
  9. APPNAME = 'java_test'
  10. top = '.'
  11. out = 'build'
  12. def options(opt):
  13. try:
  14. opt.load('junit', tooldir='.')
  15. except:
  16. pass
  17. def configure(conf):
  18. conf.load('java protoc')
  19. try:
  20. ret = conf.load('junit', tooldir='.')
  21. conf.env.DO_JUNIT = True
  22. except:
  23. pass
  24. conf.check_java_class('java.io.FileOutputStream')
  25. conf.check_java_class('FakeClass')
  26. conf.env.CLASSPATH_NNN = ['aaaa.jar', 'bbbb.jar']
  27. conf.env.CLASSPATH_PROTOBUF = ['/tmp/cp/protobuf-java-2.5.0.jar']
  28. def build(bld):
  29. bld(features = 'javac jar javadoc',
  30. srcdir = 'src/', # folder containing the sources to compile
  31. outdir = 'src', # folder where to output the classes (in the build directory)
  32. compat = '1.6', # java compatibility version number
  33. sourcepath = ['src', 'sup'],
  34. classpath = ['.', '..'],
  35. #jaropts = '-C default/src/ .', # can be used to give files
  36. basedir = 'src', # folder containing the classes and other files to package (must match outdir)
  37. destfile = 'foo.jar', # do not put the destfile in the folder of the java classes!
  38. use = 'NNN',
  39. # javadoc
  40. javadoc_package = ['com.meow' , 'com.meow.truc.bar', 'com.meow.truc.foo'],
  41. javadoc_output = 'javadoc',
  42. )
  43. bld.recurse('animals cats')
  44. bld(
  45. features = 'javac protoc',
  46. name = 'pbjava',
  47. srcdir = 'protoc/',
  48. source = ['protoc/message.proto'],
  49. use = 'PROTOBUF',
  50. protoc_includes = ['protoc'])