Skip to content

Samples#

Tip

Make sure you followed the setup instructions fully before trying out a sample.

All samples in this page can be used to demonstrate features made possible by Declarative Gradle.

After picking a sample, read about new Declarative Gradle features.

Provide us feedback.

Java Application#

A sample Java application written in the Declarative Gradle DSL, using the prototype Declarative Gradle javaApplication Software Type defined in the org.gradle.experimental.jvm-ecosystem ecosystem plugin.

Please follow the README available at gradle/declarative-samples-java-app to try this sample.

Kotlin Application#

A sample Kotlin application written in the Declarative Gradle DSL, using the prototype Declarative Gradle kotlinJvmApplication Software Type defined in the org.gradle.experimental.kmp-ecosystem ecosystem plugin.

Please follow the README available at gradle/declarative-samples-kotlin-app to try this sample.

Android Application#

Using the Official Android Software Types (Preview)#

A sample Android application written in the Declarative Gradle DSL, using the official Android Software Types Preview androidApp and androidLibrary defined in the com.android.ecosystem ecosystem plugin.

Please follow the README available at gradle/declarative-samples-agp-app to try this sample.

Using Prototype Declarative Plugins#

A sample Android application written in the Declarative Gradle DSL, using the prototype Declarative Gradle androidApplication Software Type defined in the org.gradle.experimental.android-ecosystem ecosystem plugin.

Please follow the README available at gradle/declarative-samples-android-app to try this sample.

Now In Android#

Now in Android is a fully functional Android app built entirely with Kotlin and Jetpack Compose from the Android team. We forked Now in Android and updated the build to work with Declarative Gradle. The prototype repository can be found in gradle/nowinandroid.

Please follow the README to try this sample.

Bleeding edge prototypes#

If you want to go further you can take a look at some more projects for JVM, Android, KMP, Swift and C++ projects. These projects may use newer versions of Gradle or require additional manual setup, so you should try the other samples first.

Please follow the README available in each directory linked below to try these samples.

Java#

Kotlin#

Android#

Swift#

C++#