java

package
v0.0.0-...-c231a73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractDebuggingInformation

func ExtractDebuggingInformation(configuration JavaProject) string

ExtractDebuggingInformation is a function that builds up the debugging information flag for the compiler to determine what debugging information needs to generated with the compiled classes.

func ExtractJavadocSourceFileList

func ExtractJavadocSourceFileList(configuration JavaProject, sourceDirectory string) []string

ExtractSourceFileList is a function that reads all of the source files to be compiled from the configuration file and returns a slice of source files, with the source directory prepended, to be compiled using the javac command. Each source file has had the base path appended to it when returned from the function.

func ExtractLintWarnings

func ExtractLintWarnings(configuration JavaProject) string

func ExtractSourceFileList

func ExtractSourceFileList(configuration JavaProject,
	sourceDirectory string) []string

ExtractSourceFileList is a function that reads all of the source files to be compiled from the configuration file and returns a slice of source files to be compiled using the javac command. Each source file has had the base path appended to it when returned from the function.

func ExtractTestDebuggingInformation

func ExtractTestDebuggingInformation(configuration JavaProject) string

ExtractDebuggingInformation is a function that builds up the debugging information flag for the compiler to determine what debugging information needs to generated with the compiled classes.

func ExtractTestSourceFileList

func ExtractTestSourceFileList(configuration JavaProject,
	sourceDirectory string) []string

ExtractSourceFileList is a function that reads all of the test project source files to be compiled from the configuration file and returns a slice of source files to be compiled using the javac command. Each source file has had the base path prepended to it when returned from the function.

Types

type JavaCommand

type JavaCommand struct {
	CommandName  string
	ClassPath    []string
	JarFile      string
	MainClass    string
	RunArguments []string
}

JavaCommand provides a representation of a call to the Java command.

func GetJavaRunCommand

func GetJavaRunCommand(configuration JavaProject) JavaCommand

func GetJavaRunTestCommand

func GetJavaRunTestCommand(configuration JavaProject) JavaCommand

func NewDefaultJavaCommand

func NewDefaultJavaCommand() JavaCommand

NewDefaultJavaCommand returns a JavaCommand with some default values set.

func (JavaCommand) GenerateArgumentList

func (c JavaCommand) GenerateArgumentList() []string

GenerateArgumentList is a method which returns a slice of strings containing the arguments to use when running the java command.

func (JavaCommand) GetCommandName

func (command JavaCommand) GetCommandName() string

GetCommandName is a method which accesses the name of the command to be run.

func (JavaCommand) String

func (command JavaCommand) String() string

type JavaDocumentation

type JavaDocumentation struct {
	DestinationDirectory string
	SourcePath           []string
	ClassPath            []string
	LinkSource           bool
	AccessLevel          string
	LintWarnings         []string
	WindowTitle          string
	Verbose              bool
	DocTitle             string
	Header               string
	Bottom               string
}

JavaDocumentation provides the structure of values required for generating JavaDoc documentation. ClassPath specifies the paths where javadoc searches for referenced classes. DestinationDirectory specifies where to save the generated HTML files. AccessLevel indicates the access level of the members to be displayed in the documentation output (can be public, protected, package, private). SourcePath specifies the search paths for finding source files. LinkSource when set to true, creates a HTML version of each source file (with line numbers) which is linked from the HTML documentation.

type JavaProject

type JavaProject struct {
	Name                 string
	Version              string
	Description          string
	Language             string
	SourceDirectory      string
	DestinationDirectory string
	ClassPath            []string
	SourceFiles          []string
	SourceVersion        string
	DebuggingInformation []string
	JarFile              string
	MainClass            string
	RunArguments         []string
	LintWarnings         []string
	Encoding             string
	Target               string
	Resources            []Resource
	TestProject          JavaTests
	DocumentationProject JavaDocumentation
}

JavaProject is a struct for holding the information required for building or running a Java project. Name is the name of the project. Version is used for holding the project version number. Description holds a description of the project. Language holds the name of the programming language that the project is written in. SourceDirectory holds the root directory for the project's source code. DestinationDirectory contains the directory that build artifacts are going to be placed in. ClassPath holds a list of items that are part of the class path. SourceFiles holds a list of all of the files to be compiled into the project. SourceVersion holds the value of the source code version accepted by the compiler. DebuggingInformation holds information about the debugging information to be generated. The jar file to be executed. The main class to executed. The arguments to be passed to the jar file or class file to be executed. The lint warnings to be enabled for compilation. Sets the source file encoding. Target sets the specific version of the Java VM to target. TestProject holds information about the tests for this project. DocumentationProject holds information for generating documentation.

type JavaProjectBuilder

type JavaProjectBuilder struct {
	// contains filtered or unexported fields
}

JavaProjectBuilder represents a class for building a Java project.

func NewProjectBuilder

func NewProjectBuilder(command JavacCommand, project JavaProject) JavaProjectBuilder

NewProjectBuilder creates a new instance of a JavaProjectBuilder.

func (JavaProjectBuilder) BuildProject

func (builder JavaProjectBuilder) BuildProject(verbose bool) error

BuildProject builds the Java project.

func (JavaProjectBuilder) ExecutePostBuildTasks

func (builder JavaProjectBuilder) ExecutePostBuildTasks(verbose bool) error

ExecutePostBuildTasks performs any tasks that need to be carried out after a successful build.

func (JavaProjectBuilder) ExecutePreBuildTasks

func (builder JavaProjectBuilder) ExecutePreBuildTasks(verbose bool) error

ExecutePreBuildTasks is used for executing any actions that need to be performed before building the project.

type JavaProjectRunner

type JavaProjectRunner struct {
	// contains filtered or unexported fields
}

func NewProjectRunner

func NewProjectRunner(command JavaCommand, project JavaProject) JavaProjectRunner

func (JavaProjectRunner) RunProject

func (runner JavaProjectRunner) RunProject() error

type JavaTests

type JavaTests struct {
	SourceFiles          []string
	TestFrameWork        string
	SourceDirectory      string
	ClassPath            []string
	DestinationDirectory string
	JarFile              string
	MainClass            string
	RunArguments         []string
}

JavaTests provides the structure of values required for a test project. SourceFiles holds the source files that belong to the test project. TestFrameWork holds the name of the test framework to be used. The base source directory for the test project. SourceDirectory contains the root directory for the test source files. ClassPath holds a list of items that are part of the class path. DestinationDirectory contains the directory that build artifacts are going to be placed in. The jar file to be executed The main class to executed. The arguments to be passed to the jar file or class file to be executed.

type JavacCommand

type JavacCommand struct {
	CommandName          string
	SourceDirectory      string
	DestinationDirectory string
	SourceFiles          []string
	ClassPath            []string
	Deprecation          bool
	SourceVersion        string
	DebuggingInformation string
	LintWarnings         string
	Encoding             string
	Verbose              bool
	Target               string
}

JavacCommand provides a representation of a call to the Java compiler command.

func GetJavaBuildCommand

func GetJavaBuildCommand(configuration JavaProject, deprecation bool, verbose bool) JavacCommand

GetJavaBuildCommand is a function for building up a javac command that can be used for building a java project. This command is built up using the project configuration and the command line arguments passed in.

func GetJavaTestBuildCommand

func GetJavaTestBuildCommand(configuration JavaProject, deprecation bool) JavacCommand

GetJavaTestBuildCommand is a function for building up a javac command that can be used for building a java test project. This command is built up using the project configuration and the command line arguments passed in.

func NewDefaultJavacCommand

func NewDefaultJavacCommand() JavacCommand

NewDefaultJavacCommand returns a JavacCommand with some default values set.

func (JavacCommand) GenerateArgumentList

func (c JavacCommand) GenerateArgumentList() []string

GenerateArgumentList is a method which returns a slice of strings containing the arguments to use when running the java compiler command.

func (JavacCommand) GetCommandName

func (command JavacCommand) GetCommandName() string

GetCommandName is a method on a JavacCommand which accesses the name of the command to be run.

func (JavacCommand) GetDestinationDirectory

func (command JavacCommand) GetDestinationDirectory() string

GetDestination is a method which returns the the destination directory where the compiler's output is going to be copied to.

func (JavacCommand) String

func (command JavacCommand) String() string

type JavadocBuilder

type JavadocBuilder struct {
	// contains filtered or unexported fields
}

func NewJavadocBuilder

func NewJavadocBuilder(command JavadocCommand, project JavaProject) JavadocBuilder

func (JavadocBuilder) BuildDocumentation

func (builder JavadocBuilder) BuildDocumentation(verbose bool) error

type JavadocCommand

type JavadocCommand struct {
	CommandName          string
	DestinationDirectory string
	SourceDirectory      string
	SourcePath           []string
	ClassPath            string
	LinkSource           bool
	AccessLevel          string
	LintWarnings         []string
	WindowTitle          string
	Verbose              bool
	DocTitle             string
	Header               string
	Bottom               string
}

JavadocCommand provides information for running the javadoc command.

func GetJavadocBuildCommand

func GetJavadocBuildCommand(configuration JavaProject, verbose bool) JavadocCommand

GetJavadocRunCommand is a function for building up a javadoc command that can be used for building a java project. This command is built up using the project configuration and the command line arguments passed in.

func NewDefaultJavadocCommand

func NewDefaultJavadocCommand() JavadocCommand

NewDefaultJavadocCommand returns a Javadoc command with some default values.

func (JavadocCommand) GenerateArgumentList

func (command JavadocCommand) GenerateArgumentList() []string

func (JavadocCommand) GetCommandName

func (command JavadocCommand) GetCommandName() string

GetCommandName is a method on a JavadocCommand which accesses the name of the command to be run.

func (JavadocCommand) GetDestinationDirectory

func (command JavadocCommand) GetDestinationDirectory() string

GetDestination is a method which returns the the destination directory where the compiler's output is going to be copied to.

func (JavadocCommand) String

func (command JavadocCommand) String() string

type Resource

type Resource struct {
	Source      string
	Destination string
}

Resource is a struct for holding information about a Java project resource.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL