Further configuration uses the following fields, setting them in j2objcConfig within build.gradle
| Modifiers | Name | Description |
|---|---|---|
protected boolean |
finalConfigured |
|
protected NativeCompilation |
nativeCompilation |
|
protected org.gradle.api.Project |
project |
| Constructor and description |
|---|
J2objcConfig
(org.gradle.api.Project project) |
| Type | Name and description |
|---|---|
static void |
appendArgs(java.util.List<java.lang.String> listArgs, java.lang.String nameArgs, java.lang.String... args) |
void |
cycleFinderArgs(java.lang.String... args)Add command line arguments for j2objc cycle_finder. |
void |
dependsOnJ2objcLib(java.lang.String beforeProjectName)@see #dependsOnJ2objcLib(org.gradle.api.Project) |
void |
dependsOnJ2objcLib(org.gradle.api.Project beforeProject)Uses the generated headers and compiled j2objc libraries of the given project when compiling this project. |
void |
extraLinkerArgs(java.lang.String... args)Add arguments to pass to the native linker. |
void |
extraObjcCompilerArgs(java.lang.String... args)Add arguments to pass to the native compiler. |
void |
extraObjcSrcDirs(java.lang.String... args)Add directories of Objective-C source to compile in addition to the translated source. |
void |
finalConfigure()Configures the native build using. |
void |
generatedSourceDirs(java.lang.String... args)Add generated source files directories, e.g. from dagger annotations. |
boolean |
isFinalConfigured() |
void |
testArgs(java.lang.String... args)Add command line arguments for j2objcTest task. |
org.gradle.api.tasks.util.PatternSet |
testPattern(groovy.lang.Closure cl)Configures the testPattern Calling this method repeatedly further modifies the existing testPattern, and will create an empty testPattern if none exists. |
void |
translateArgs(java.lang.String... args)Add command line arguments for j2objc translate. |
void |
translateClassPaths(java.lang.String... args)Add libraries from ${projectDir}/lib/, e.g.: "json-20140107.jar", "somelib.jar". |
org.gradle.api.tasks.util.PatternSet |
translatePattern(groovy.lang.Closure cl)Configures the translatePattern. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Command line arguments for j2objc cycle_finder.
A list of all possible arguments can be found here: http://j2objc.org/docs/cycle_finder.htmlExpected number of cycles, defaults to all those found in JRE.
This is an exact number rather than minimum as any change is significant.Where to assemble generated main libraries.
Defaults to $buildDir/j2objcOutputs/libWhere to assemble generated main source files.
Defaults to $buildDir/j2objcOutputs/src/main/objcWhere to assemble generated test source files.
Can be the same directory as destDir Defaults to $buildDir/j2objcOutputs/src/test/objcAdditional arguments to pass to the native linker.
Additional arguments to pass to the native compiler.
Directories of Objective-C source to compile in addition to the translated source.
Makes sure that the translated filenames don't collide.
Recommended if you choose to use --no-package-directories.Generated source files directories, e.g. from dagger annotations.
The plugin will ignore changes in this directory so they must be limited to files generated solely from files within your main and/or test sourceSets.Which architectures will be built and supported in packed ('fat') libraries.
The three ios_arm* architectures are for iPhone and iPad devices, while ios_i386 and ios_x86_64 are for their simulators. Adding an unrecognized new architecture here will fail. Removing an architecture here will cause that architecture not to be built and corresponding gradle tasks to not be created.supportedArchs = ['ios_arm64'] // Only build libraries for 64-bit iOS devices
Command line arguments for j2objcTest task.
j2objcTest will fail if it runs less than the expected number of tests; set to 0 to disable.
It is a minimum so adding a unit test doesn't break the j2objc build.Filter on files to test. Note this has no effect on which tests are translated, just which tests are executed by the j2objcTest task.
If no pattern is specified, all files within the 'test' sourceSet are translated. This filter is applied on top of all files within the 'main' and 'test' java sourceSets. Use testPattern(groovy.lang.Closure) to configure.Command line arguments for j2objc translate.
A list of all possible arguments can be found here: http://j2objc.org/docs/j2objc.htmlLibraries from ${projectDir}/lib/, e.g.: "json-20140107.jar", "somelib.jar". This will be added to j2objc as a '-classpath' argument.
Additional libraries that are part of the j2objc distribution.
Sets the filter on files to translate.
If no pattern is specified, all files within the sourceSets are translated. This filter is applied on top of all files within the 'main' and 'test' java sourceSets. Use translatePattern(groovy.lang.Closure) to configure.Additional sourcepaths to translate.
Directory of the target Xcode project.
Xcode target the generated files should be linked to.
Add command line arguments for j2objc cycle_finder.
A list of all possible arguments can be found here: http://j2objc.org/docs/cycle_finder.htmlcycleFinderArgs - add args for 'cycle_finder' tool
Uses the generated headers and compiled j2objc libraries of the given project when compiling this project.
Generally every cross-project 'compile' dependency should have a corresponding call to dependsOnJ2objcLib. It is safe to use this in conjunction with --build-closure. Do not also include beforeProject's java source or jar in the translateSourcepaths or translateClassPaths, respectively. Calling this method is preferable and sufficient.Add arguments to pass to the native linker.
dirs - add arguments to pass to the native linker.Add arguments to pass to the native compiler.
dirs - add arguments to pass to the native compiler.Add directories of Objective-C source to compile in addition to the translated source.
dirs - add directories for Objective-C source to be compiledConfigures the native build using. Must be called at the very end of your j2objcConfig block.
Add generated source files directories, e.g. from dagger annotations.
The plugin will ignore changes in this directory so they must be limited to files generated solely from files within your main and/or test sourceSets.generatedSourceDirs - adds generated source directories for j2objc translateAdd command line arguments for j2objcTest task.
args - add args for the 'j2objcTest' taskConfigures the testPattern
Calling this method repeatedly further modifies the existing testPattern, and will create an empty testPattern if none exists. For example:
translatePattern {
exclude 'CannotTranslateFileTest.java'
exclude '**/CannotTranslateDir/*.java'
include '**/CannotTranslateDir/AnExceptionToIncludeTest.java'
}
Add command line arguments for j2objc translate.
A list of all possible arguments can be found here: http://j2objc.org/docs/j2objc.htmltranslateArgs - add args for the 'j2objc' toolAdd libraries from ${projectDir}/lib/, e.g.: "json-20140107.jar", "somelib.jar". This will be added to j2objc as a '-classpath' argument.
add - libraries for -classpath argumentConfigures the translatePattern.
Calling this method repeatedly further modifies the existing translatePattern, and will create an empty translatePattern if none exists. For example:
translatePattern {
exclude 'CannotTranslateFile.java'
exclude '**/CannotTranslateDir/*.java'
include '**/CannotTranslateDir/AnExceptionToInclude.java'
}
Groovy Documentation