FileDocCategorySizeDatePackage
JSharp.javaAPI DocApache Ant 1.704362Wed Dec 13 06:16:24 GMT 2006org.apache.tools.ant.taskdefs.optional.dotnet

JSharp

public class JSharp extends DotnetCompile
Compile J# source down to a managed .NET application.

J# is not Java. But it is the language closest to Java in the .NET framework. This task compiles jsharp source (.java files), and generates a .NET managed exe or dll.

For historical reasons the pattern **/*.java is preset as includes list and you can not override it with an explicit includes attribute. Use nested <src> elements instead of the basedir attribute if you need more control.

see
Visual J++ online documentation
since
ant1.6
ant.task
category="dotnet" name="jsharpc"

Fields Summary
String
baseAddress
hex base address
boolean
pureJava
/x option to disable J++ and J# lang extensions
boolean
secureScoping
whether to make package scoped stuff public or assembly scoped
Constructors Summary
public JSharp()
No arg constructor.


    // CheckStyle:VisibilityModifier ON

        
      
        setExecutable("vjc");
    
Methods Summary
protected voidaddCompilerSpecificOptions(NetCommand command)
add jvc specific commands

param
command the command to add to.

        if (pureJava) {
            command.addArgument("/x:all");
        }
        if (secureScoping) {
            command.addArgument("/securescoping");
        }
    
protected voidcreateResourceParameter(NetCommand command, DotnetResource resource)
{@inheritDoc}

        resource.getParameters(getProject(), command, true);
    
public java.lang.StringgetFileExtension()
Get the extension of filenames to compile.

return
The string extension of files to compile.

        return ".java";
    
public java.lang.StringgetReferenceDelimiter()
Get the delimiter that the compiler uses between references. For example, c# will return ";"; VB.NET will return ","

return
The string delimiter for the reference string.

        return ";";
    
public voidsetBaseAddress(java.lang.String baseAddress)
Set the base address attribute.

param
baseAddress the value to use.

        this.baseAddress = baseAddress;
    
public voidsetPureJava(boolean pureJava)
do we want pure java (default, true) or corrupted J#?

param
pureJava a boolean value.

        this.pureJava = pureJava;
    
public voidsetSecureScoping(boolean secureScoping)
Make package scoped code visible to the current assembly only (default: false) .NET does not have package scoping. Instead it has assembly, private and public. By default, package content is public to all.

param
secureScoping a boolean value.

        this.secureScoping = secureScoping;
    
protected voidvalidate()
validation code

throws
org.apache.tools.ant.BuildException if validation failed

        super.validate();
        if (getDestFile() == null) {
            throw new BuildException("DestFile was not specified");
        }