Gradle Plugin Property Reference

August 2, 2026 ยท View on GitHub

This page is the authoritative list of properties available in the gdxTeaVM Gradle extension. See the usage guide for setup and complete configurations.

Shared Properties

These properties live directly inside gdxTeaVM { ... }.

PropertyTypeDefaultPurpose
assetsConfigurableFileCollectionemptyLocal files or directories copied as libGDX internal assets. Directories are copied recursively.
classpathAssetsListProperty<String>emptyClasspath resource roots copied as libGDX classpath assets.
reflectionListProperty<String>emptyReflection class names or package patterns to preserve.
reflectionEnabledProperty<Boolean>trueEnables gdx-teavm reflection metadata generation.
reflectionDefaultsProperty<Boolean>trueAdds default reflection configuration required by common libGDX runtime types.
reflectionScanProperty<Boolean>trueScans reachable classes and configured packages for reflection metadata.
reflectionDebugProperty<Boolean>falsePrints extra reflection metadata diagnostics during TeaVM generation.

Helper methods:

MethodPurpose
assets(vararg paths)Adds local asset files or directories to assets.
classpathAssets(vararg paths)Adds classpath resource roots to classpathAssets.
reflection(vararg patterns)Adds reflection class names or package patterns to reflection.

Target Declaration Methods

BlockBackend
js { ... }backend-web
wasm { ... }backend-web
glfw { ... }backend-glfw
ios { ... }backend-ios
android { ... }backend-android

Only declared targets create tasks or add backend dependencies. Task behavior is covered in the usage guide.

Common TeaVM Target Properties

The js {} and wasm {} blocks expose these TeaVM Gradle properties directly. Native target blocks expose the matching TeaVM C settings and apply only the selected backend to TeaVM's C task.

PropertyTypeDefaultPurpose
outputDirDirectoryPropertytarget-specificRoot directory for generated files.
mainClassProperty<String>noneFully qualified launcher class used as TeaVM main class. This must be set for every target you build.
relativePathInOutputDirProperty<String>web webapp, native c/srcPath inside outputDir where TeaVM writes generated files.
optimizationProperty<OptimizationLevel>BALANCEDTeaVM optimization level.
debugInformationProperty<Boolean>falseIncludes TeaVM debug information when supported by the target.
fastGlobalAnalysisProperty<Boolean>falseEnables faster TeaVM global analysis, trading precision for speed.
outOfProcessProperty<Boolean>Web true, native falseRuns TeaVM compilation out of the Gradle process when supported by TeaVM.
processMemoryProperty<Int>Web 1024, native 512Memory limit in megabytes for out-of-process TeaVM compilation.
preservedClassesListProperty<String>emptyClasses TeaVM should preserve from aggressive removal or renaming.

outputDir defaults to build/dist/js, build/dist/wasm, build/dist/glfw, build/dist/ios, or build/generated/gdx-teavm/android for the corresponding target.

Web Targets

Web targets use backend-web and can be built as JavaScript or Wasm. JS and Wasm usually share the same launcher class because both start WebApplication.

Web Common Properties

These properties exist inside js {} and wasm {} only.

PropertyTypeDefaultPurpose
webappEnabledProperty<Boolean>trueEnables generated gdx-teavm web app files around web TeaVM output.
generateIndexHtmlProperty<Boolean>trueGenerates the web entry page. Set to false to leave an existing index.html untouched while continuing other web generation.
entryPointNameProperty<String>mainEntry point function name called by the generated web app.
mainClassArgsProperty<String>empty stringArguments passed by generated web app to the TeaVM entry point. Use JavaScript array element syntax without surrounding brackets.
htmlTitleProperty<String>gdx-teavmBrowser document title used by generated index.html.
htmlWidthProperty<Int>800Initial canvas width written to generated index.html.
htmlHeightProperty<Int>600Initial canvas height written to generated index.html.
copyAssetsProperty<Boolean>trueCopies configured assets, contributed classpath assets, and support scripts. This does not control the loading logo.
logoPathProperty<String>startup-logo.pngDefault startup-logo asset path compiled into WebPreloadApplicationListener; when copyLoadingAsset is true, the same path is copied from the build classpath.
copyLoadingAssetProperty<Boolean>trueIndependently copies logoPath into the generated web app, even when copyAssets is false.
serverPortProperty<Int>Gradle property teavmPluginPort, otherwise 8080Port used by this target's Jetty or TeaVM development server.
devServerGdxTeaVMDevServerExtensiondisabledConfigures TeaVM's persistent development server for this target's existing run task.

Development Server Properties

The same devServer {} block is available inside js {} and wasm {} and exposes only options supported by both targets.

PropertyTypeDefaultPurpose
enabledProperty<Boolean>falseMakes the target's existing run task use TeaVM's persistent development server.
autoBuildProperty<Boolean>trueRebuilds when project sources, resources, assets, or static files change. Set to false for a serve-only session.
autoReloadProperty<Boolean>falseReloads connected pages after successful rebuilds.
processMemoryProperty<Int>Target processMemory, normally 1024Maximum heap size in megabytes for the development-server process.
staticDirsConfigurableFileCollectionemptyAdditional directories served as static files.
staticServePathProperty<String>unsetURL path prefix for staticDirs.
resourceRootsListProperty<String>emptyClasspath resource roots served as static resources.
resourceServePathProperty<String>unsetURL path prefix for resourceRoots.

The development server uses the containing target's serverPort. TeaVM's JavaScript-only indicator and stack-deobfuscation switches are intentionally not part of this common JS/Wasm API.

JavaScript Properties

PropertyTypeDefaultPurpose
targetFileNameProperty<String>app.jsName of the generated JavaScript output file.
obfuscatedProperty<Boolean>trueMinifies and renames generated JavaScript output.
strictProperty<Boolean>falseEnables TeaVM strict JavaScript generation checks.
sourceMapProperty<Boolean>falseGenerates browser source maps.
sourceFilePolicyProperty<SourceFilePolicy>LINK_LOCAL_FILESControls how Java sources referenced by source maps are exposed.

Wasm Properties

PropertyTypeDefaultPurpose
targetFileNameProperty<String>app.wasmName of the generated Wasm output file.
obfuscatedProperty<Boolean>trueMinifies and renames generated Wasm runtime support output.
strictProperty<Boolean>falseEnables TeaVM strict Wasm generation checks.
copyRuntimeProperty<Boolean>trueCopies TeaVM's Wasm runtime JavaScript next to the generated .wasm file.
modularRuntimeProperty<Boolean>falseCopies TeaVM's ES module Wasm runtime instead of the global script runtime. The generated gdx-teavm web app expects the default global runtime.
sourceMapProperty<Boolean>falseGenerates browser source maps.
sourceFilePolicyProperty<SourceFilePolicy>LINK_LOCAL_FILESControls how Java sources referenced by source maps are exposed.

Native Targets

Native targets use TeaVM C output and add the following properties to the common target settings.

Native Target Properties

These properties exist in native target blocks.

PropertyTypeDefaultPurpose
targetFileNameProperty<String>appName of the generated native target.
releasePathDirectoryProperty[outputDir]/c/releaseDirectory where native runtime assets and build output support files are prepared.
minHeapSizeMbProperty<Int>4Initial native heap size in megabytes.
maxHeapSizeMbProperty<Int>128Maximum native heap size in megabytes.
heapDumpProperty<Boolean>falseEnables TeaVM heap dump support for native output when supported.
shortFileNamesProperty<Boolean>trueAsks TeaVM to generate shorter C file names, useful for native toolchains with path limits.
obfuscatedProperty<Boolean>trueObfuscates generated native C symbols.

GLFW Properties

PropertyTypeDefaultPurpose
buildTypeProperty<String>DebugNative build type used by generated GLFW build scripts, typically Debug or Release.
buildExecutableProperty<Boolean>falseLets the backend invoke the generated GLFW build script when true.
runExecutableProperty<Boolean>falseLets the backend run the generated GLFW executable after building when true.
consoleLogProperty<Boolean>falseOpens or attaches native console logging for GLFW run tasks when supported by the platform. On Windows, the opened console remains visible after the application exits until a key is pressed.
cmakeDefinitionsMapProperty<String, String>emptyAdvanced ordered CMake cache definitions passed to the generated GLFW configure scripts. Use cmakeDefinition(name, value) to add one definition.

Platform-specific CMake behavior is documented under Native Toolchain Policy.

iOS Properties

PropertyTypeDefaultPurpose
xcodeProjectNameProperty<String>GdxTeaVMIOSSpikeGenerated Xcode project name.
xcodeProjectDirDirectoryProperty[outputDir]/xcodeDirectory containing the generated Xcode project and Swift sources.
graphicsApiProperty<String>Gradle property gdx.teavm.ios.graphicsApi, otherwise angleGenerated Xcode graphics bridge. Supported values are angle and gles.
xcodeSchemeProperty<String>GdxTeaVMIOSSpikeXcode scheme used by simulator build tasks.
xcodeConfigurationProperty<String>DebugXcode build configuration used by simulator build tasks.
simulatorDeviceProperty<String>iPhone 12 ProSimulator device name or UDID used by gdx_teavm_ios_run_simulator.
bundleIdentifierProperty<String>com.github.xpenatan.gdxteavm.ios.spikeApp bundle identifier used by gdx_teavm_ios_run_simulator.
xcodeDerivedDataPathDirectoryPropertybuild/xcode-derived/iosDerived data directory used by simulator build and run tasks.
openSimulatorProperty<Boolean>trueOpens Simulator.app when running the simulator task.
overwriteXcodeProjectProperty<Boolean>Gradle property gdx.teavm.ios.xcode.overwrite, otherwise falseRewrites the generated Xcode project during Xcode initialization when true.