A type-safe and modern properties plugin for Gradle.
English | 简体中文
| HighCapable |
|---|
This project belongs to the organization above. Click the link to follow us and discover more awesome projects.
This plugin is designed for Gradle build scripts. It aims to bring properties similar to those in the gradle.properties file into build scripts in a
type-safe way, avoiding problems that hard-coded strings might cause.
The project icon was designed by MaiTungTM. The name comes from GradlePropify, meaning a plugin for Gradle properties.
This isn't just another ordinary BuildConfig plugin. Here is how Gropify stacks up against existing solutions in the community:
| Feature Dimension | Official Approach | Traditional Plugins | Alternatives | Gropify |
|---|---|---|---|---|
| Buildscript Access | ❌ Hard-coded strings like providers.gradleProperty("foo.bar") |
❌ Unsupported, requires manual .kts binding |
- | ✅ Auto-generated chainable accessors gropify.foo.bar (with IDE autocompletion) |
| Source Code Constants | ❌ Only Android supports buildConfigField, lacking native KMP/JVM support |
✅ Supports multi-platform constants, but needs explicit .kts declarations |
gmazzo/gradle-buildconfig-plugin | ✅ Zero manual declarations, infers and mounts directly from properties |
| KMP Multiplatform | ❌ No native mapping | ✅ Supports expect/actual generation | yshrsmz/BuildKonfig | ✅ Flawlessly integrated, automatically mounted to the commonMain source set |
| Configuration Redundancy | ❌ High (Keys scattered as strings across files) | .kts) |
- | ✅ Ultra-low (Properties act as the Schema) |
| Design Philosophy | Fragmented capabilities | CodeGen-First (Code generation tooling) | - | Properties-Centric (Single source of truth) |
Gropify is mainly designed for Kotlin DSL build scripts. Groovy can directly use properties from the gradle.properties file as variables, but you
can still use Gropify to achieve type-safe property access.
Gropify also supports generating properties (similar to those defined in a gradle.properties file) in a type-safe way into the source code of
Kotlin, Java, and Android projects for use at application runtime—similar to Android's BuildConfig's buildConfigField feature.
Suppose we have the following gradle.properties file.
The following example
project.app.name=Gropify-Demo
project.app.version=1.0.0Here is an example of calling the code automatically generated by Gropify.
Build Script (Kotlin DSL, Groovy DSL)
val appName = gropify.project.app.name
val appVersion = gropify.project.app.versiondef appName = gropify.project.app.name
def appVersion = gropify.project.app.versionSource Code (Kotlin, Java)
val appName = MyAppProperties.PROJECT_APP_NAME
val appVersion = MyAppProperties.PROJECT_APP_VERSIONvar appName = MyAppProperties.PROJECT_APP_NAME;
var appVersion = MyAppProperties.PROJECT_APP_VERSION;Gropify also supports Kotlin Multiplatform projects, and you can use the generated property classes in the commonMain source set.
| Gropify Documentation |
|---|
You can go to the documentation page for more detailed tutorials and content.
- Apply the plugin: Add the
Gropifyplugin ID to yoursettings.gradle.kts. - Configure properties: Define your properties in
gradle.properties. - Sync the project: After a Gradle sync, you can start enjoying type-safe property access.
In the opened page, select the Quick Start section in the sidebar to continue reading.
Apache License Version 2.0
Copyright (C) 2019 HighCapable
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copyright © 2019 HighCapable