This directory contains prototypes of plugins for JVM, Android, and KMP projects built using "unified" plugins that all utilize a similar model and are implemented using the Declarative DSL.
Currently, these different ecosystems still apply distinct plugins, but those plugins all share a common plugin-common
dependency, which will gradually grow to contain more functionality.
Sample Java projects live in the testbed-java-library
and testbed-java-application
directories.
These samples show the definition of a simple Java application and library that target a single version of Java.
To run the application, use:
> ./gradlew testbed-java-application:run
Sample Java projects live in the testbed-jvm-library
and testbed-jvm-application
directories.
These samples show the definition of a simple Java application and library that are implemented using a mix of Java 11 and Java 17 source code.
To run the application, use:
> ./gradlew testbed-java-application:run
Sample Kotlin JVM projects live in the testbed-kotlin-jvm-library
and testbed-kotlin-jvm-application
directories.
These samples show the definition of a simple Kotlin JVM application and library that target a single version of Kotlin and Java.
To run the application, use:
> ./gradlew testbed-kotlin-jvm-application:run
The sample Kotlin Multiplatform project lives in the testbed-kotlin-library
and testbed-kotlin-application
directories.
The unified-prototype/plugin-kmp
plugin demonstrates creating extensions using the Declarative DSL, and loading the data from those extensions into the KMP project used by KGP.
The sample project demonstrates setting properties, using a common dependencies block, and adding dependencies to specific targets.
An Apache Commons dependency is used by the JVM code. A SQLDelight dependency is used by the JS code. The kotlinx.datetime multiplatform dep is used by common code.
The StandaloneKmpLibraryPlugin
plugin works by using project.afterEvaluate
to load data from the Declarative DSL extensions into KGP's model.
The KMP example is currently limited, and does not support any targets other than nodeJs
, jvm
and macOsArm64
.
From the testbed-kotlin-application
directory, run jvmRun
using the Gradle wrapper in the parent directory:
cd testbed-kotlin-application
../gradlew jvmRun
From the testbed-kotlin-application
directory, run build
using the Gradle wrapper in the parent directory:
cd testbed-kotlin-application
../gradlew build
to build the JS, JVM and KMP metadata jars for the example KMP project build in the testbed-kotlin-application/build/libs
directory.
You can also build the JS and JVM libs separately:
cd testbed-kotlin-application
../gradlew jsJar
cd testbed-kotlin-application
../gradlew jvmJar
Sample Android projects live in the testbed-android-library
and testbed-android-application
directories.
The unified-prototype/plugin-android
plugin demonstrates creating extensions using the Declarative DSL, and loading the data from those extensions into the Android project used by AGP.
The sample project demonstrates setting properties, using a common dependencies block, and adding dependencies to specific Android targets.
Guava is declared as an implementation dependency. The OKHttp dep is used by the release build type's implementation, and is not necessary for the debug variant.
Both plugin implementations work by using project.afterEvaluate
to load data from the Declarative DSL extensions into AGP's model.
The Android example is currently limited, and does not support many use cases such as adding tests or running the publish
task.
It requires JDK >= 17 to build.
From the testbed-android-library
or testbed-android-application
directory, run build
using the Gradle wrapper in the parent directory:
cd testbed-android-application
../gradlew build
to build debug and release aar
s for the example Android project build in the testbed-android/build/outputs/aar
directory.
You can also build the Debug
and Release
variants separately:
gradlew :testbed-android-application:assembleDebug
gradlew :testbed-android-application:assembleRelease