GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - objectbox/objectbox-java-generator: The ObjectBox Gradle Plugin makes using ObjectBox easy in a JVM or Android project written in Java or Kotlin

BranchesTags
Open more actions menu

Latest commit

 

History

2,078 Commits
2,078 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitlab/merge_request_templates
.gitlab/merge_request_templates
 
 
agp-wrapper-7-2
agp-wrapper-7-2
 
 
build-logic
build-logic
 
 
ci
ci
 
 
gradle/wrapper
gradle/wrapper
 
 
images
images
 
 
javadoc
javadoc
 
 
objectbox-code-modifier
objectbox-code-modifier
 
 
objectbox-generator
objectbox-generator
 
 
objectbox-gradle-plugin
objectbox-gradle-plugin
 
 
objectbox-processor
objectbox-processor
 
 
scripts
scripts
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
AGENTS.md
AGENTS.md
 
 
Jenkinsfile
Jenkinsfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle.kts
build.gradle.kts
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

ObjectBox

ObjectBox Gradle Plugin

The ObjectBox Gradle Plugin makes using ObjectBox easy in a Java Virtual Machine (JVM) or Android project written in Java or Kotlin, and is free and open source. See the documentation on how to get started.

The plugin

  • automatically adds the ObjectBox Java API as a dependency and if needed Kotlin extension functions,
  • automatically adds database libraries for Android or the Java Virtual Machine (JVM) to run on the developer machine as a dependency,
  • adds and configures the processor (for Java projects as annotation processor, for Kotlin projects with kapt or, if the project applies the KSP plugin, with KSP) to generate the model JSON file and source code like the MyObjectBox and underscore classes (like Example_) used for queries,
  • for Android and Java JVM projects, registers a byte code transformer to make relations easier to use

Minimum requirements to apply the plugin

  • Gradle 8.3 (see GradleCompat)
  • Android Plugin 8.1 (see AndroidCompat)
    • For projects that use the built-in Kotlin support of Android Plugin 9.0 or newer, this plugin applies the com.android.legacy-kapt plugin so the annotation processor can process @Entity classes written in Kotlin. For this to work, the build must declare that plugin so it is on the classpath (for example in the plugins block of the top-level build script with apply false).
  • JDK 11

For Kotlin projects, the plugin by default runs the processor with the kapt plugin (and applies it, if the project has not). To use KSP instead, apply the KSP plugin before this plugin, like id("com.google.devtools.ksp") version "2.3.9" (the version tested with this plugin). This requires for Android projects at least Android Plugin 8.10 (the minimum supported by KSP).

For JVM projects, the Java byte code transformer supports @Entity classes using up to Java 11 byte code.

Development

This project is known to build with JDK 21.

This repository contains a collection of Gradle subprojects:

  • objectbox-gradle-plugin provides the actual Gradle plugins (io.objectbox and io.objectbox.sync),
  • objectbox-processor provides an annotation processor,
  • objectbox-generator provides a source code generator and model file ("IdSync") generation used by the annotation processor,
  • objectbox-code-modifier provides byte-code transformers for Android and Java projects.
    • Multiple agp-wrapper-x-y projects provide a compatibility layer for specific versions of the Android Plugin API, currently for byte-code transforms only.

All are published as Maven artifacts (see gradle folder).

Adding a new property type

This is a checklist on how to add support for a new property type:

  • (Optional) Java: update generated Flatbuffers Java classes to add new PropertyType.
  • Generator: add new generator PropertyType and map it to the Java API PropertyType.
  • Processor: add a field with each new supported type to SimpleEntity.java (SimpleEntityTest).
  • Processor: update to detect the new property types (also check if indexes should be prevented).
  • Update the model expected by the test.
  • Java API: add new collect methods to Cursor.java.
  • Generator: update PropertyCollector to generate code using the new collect methods.
  • Update the generated files expected by the test.
  • Java integration tests: add a field with the new type to TestEntity.java, update BoxTest.java.
    • Java: update TestEntity and tests with code (incl. generated by the plugin) of integration tests.
  • Java: add additional tests as needed, e.g. query the new property.

License

ObjectBox Build Tools
Copyright (C) 2017-2026 ObjectBox Ltd. <https://objectbox.io>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

Note that this license applies to the code in this repository only. The build tools in this repository are not distributed with your application. So their copyleft license has no impact on how you distribute your application. See our website on details about all licenses for ObjectBox components.

About

The ObjectBox Gradle Plugin makes using ObjectBox easy in a JVM or Android project written in Java or Kotlin

objectbox.io

Topics

androiddatabasejavajvmkotlinmobile

Resources

Readme
AGPL-3.0 license
Activity
Custom properties

Stars

11 stars

Watchers

4 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.