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