Java support
Javac is one of the few compilers that behaves very badly:
Remember that the compilation can be performed using Jython[1] rather than regular Python. Instead of running one of the following commands:
./waf configure
python waf configure
You would have to run:
java -jar /path/to/jython.jar waf configure
Task generator method
Create a javac task for compiling .java files. There can be only one javac task by task generator.
Feature : | javac |
---|
Task generator method
Processes the use attribute referring to other java compilations
Feature : | javac |
---|
Task generator method
Sets the CLASSPATH value on the javac task previously created.
Feature : | javac |
---|
Task generator method
Creates a jar task (one maximum per task generator)
Feature : | jar |
---|
Task generator method
Processes the use attribute to set the build order on the tasks created by another task generator.
Feature : | jar |
---|
Bases: waflib.Task.Task
Base class for java and jar tasks; provides functionality to run long commands
Bases: waflib.Tools.javaw.JTask
Creates a jar file
Wait for dependent tasks to be executed, then read the files to update the list of inputs.
Bases: waflib.Tools.javaw.JTask
Compiles java files
The javac task will be executed again if the variables CLASSPATH, JAVACFLAGS, JAVAC or OUTDIR change.
Waits for dependent tasks to be complete, then read the file system to find the input nodes.
Task generator method
Creates a javadoc task (feature ‘javadoc’)
Feature : | javadoc |
---|
Bases: waflib.Task.Task
Builds java documentation
Configuration Method bound to waflib.Configure.ConfigurationContext
Checks if the specified java class exists
Parameters: |
|
---|
Decorator: attach new configuration functions to waflib.Build.BuildContext and waflib.Configure.ConfigurationContext. The methods bound will accept a parameter named ‘mandatory’ to disable the configuration errors:
def configure(conf):
conf.find_program('abc', mandatory=False)
Parameters: | f (function) – method to bind |
---|
Decorator that registers a task generator method that will be executed when the object attribute feature contains the corresponding key(s):
from waflib.Task import feature
@feature('myfeature')
def myfunction(self):
print('that is my feature!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – feature names |
---|
Decorator that registera task generator method which will be executed before the functions of given name(s):
from waflib.TaskGen import feature, before
@feature('myfeature')
@before_method('fun2')
def fun1(self):
print('feature 1!')
@feature('myfeature')
def fun2(self):
print('feature 2!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – method names |
---|
Decorator that registers a task generator method which will be executed after the functions of given name(s):
from waflib.TaskGen import feature, after
@feature('myfeature')
@after_method('fun2')
def fun1(self):
print('feature 1!')
@feature('myfeature')
def fun2(self):
print('feature 2!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – method names |
---|
Configuration Method bound to waflib.Configure.ConfigurationContext
Checks for jni headers and libraries. On success the conf.env variables xxx_JAVA are added for use in C/C++ targets:
def options(opt):
opt.load('compiler_c')
def configure(conf):
conf.load('compiler_c java')
conf.check_jni_headers()
def build(bld):
bld.shlib(source='a.c', target='app', use='JAVA')
Features defined in this module: