import{_ as n,r,o as i,c as l,a as e,b as s,d as a,e as p}from"./app-aH6YcK-Q.js";const t={},c=e("h1",{id:"introduction",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#introduction","aria-hidden":"true"},"#"),s(" Introduction")],-1),d=e("blockquote",null,[e("p",null,[e("code",null,"Gropify"),s(" is a type-safe and modern properties plugin for Gradle.")])],-1),u=e("h2",{id:"background",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#background","aria-hidden":"true"},"#"),s(" Background")],-1),y=e("p",null,[s("This plugin is designed for Gradle build scripts. It aims to bring properties similar to those in the "),e("code",null,"gradle.properties"),s(" file into build scripts in a type-safe way, avoiding problems that hard-coded strings might cause.")],-1),h={href:"https://github.com/Lagrio",target:"_blank",rel:"noopener noreferrer"},m=e("strong",null,"G",-1),g=e("strong",null,"ropify",-1),b={href:"https://github.com/HighCapable/SweetProperty",target:"_blank",rel:"noopener noreferrer"},f=p(`

The configuration plan format of Gropify is similar to SweetProperty. If you are using SweetProperty, you can consider migrating to Gropify.

Usage

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.0

Here 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.version
def appName = gropify.project.app.name
def appVersion = gropify.project.app.version

Source Code (Kotlin, Java)

val appName = MyAppProperties.PROJECT_APP_NAME
val appVersion = MyAppProperties.PROJECT_APP_VERSION
var 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.

Language Requirement

It's recommended to use Kotlin DSL to configure your project's build scripts. Groovy is also supported, but in pure Groovy projects some configuration syntax may have compatibility issues.

In Groovy DSL, we will no longer be responsible for troubleshooting and fixing any issues that arise from using this plugin, and it may be completely unsupported in future versions.

Contribution

The maintenance of this project is inseparable from the support and contributions of all developers.

This project is currently in its early stages, and there may still be some problems or lack of functions you need.

`,21),v={href:"https://github.com/HighCapable/Gropify/issues",target:"_blank",rel:"noopener noreferrer"};function _(k,A){const o=r("ExternalLinkIcon");return i(),l("div",null,[c,d,u,y,e("p",null,[s("The project icon was designed by "),e("a",h,[s("MaiTungTM"),a(o)]),s(". The name comes from "),m,s("radleP"),g,s(", meaning a plugin for Gradle properties.")]),e("p",null,[s("It is a brand-new project rebuilt from "),e("a",b,[s("SweetProperty"),a(o)]),s(", borrowing previous design ideas and making it more polished and easier to use.")]),f,e("p",null,[s("If possible, feel free to submit a PR to contribute features you think are needed to this project or go to "),e("a",v,[s("GitHub Issues"),a(o)]),s(" to make suggestions to us.")])])}const D=n(t,[["render",_],["__file","home.html.vue"]]);export{D as default};