Skip to content

Meta build system with Android and Gradle support.

License

Notifications You must be signed in to change notification settings

formatools/forma

Repository files navigation

Logo

GitHub code size in bytesLicenseContributorsGitHub top languageGitHub closed pull requestsGitHub Repo stars

Forma - Kotlin first, Meta Build System with Android and Gradle support. Opinionated, scalable, thoughtfully structured, type-safe and guided way to declare your project structure. Distributed as a Gradle plugin, Forma helps developers to shift focus from Build Configuration to Project Structure Declaration, abstracting away build configuration complexity.

  • You don't need to be a gradle expert anymore
  • Get rid of project configuration bad practices
  • Type-safe, single method configuration for your targets, no room for error
  • Built-in dependency visibility rules
  • Target types - enforce scalable project structure
  • High-performance builds: Gradle best practices are applied automatically
  • Dependencies framework - helps developers to understand and deal with transitive dependencies hell
  • Extensible - be the expert when you need to!
  • And much more...

โš ๏ธ We are using target term to express application components(e.g. modules or projects, depending in the context) across documentation and code, there is a couple of reasons for that. Module term often confused with Dagger modules which makes communication harder, project from the other hand used only in Gradle context but not in other build systems like Buck and Bazel.

โš ๏ธ This is early alpha release - please do try this at home๐Ÿ 

Presentation Link

Configuration made easy:

// root build.gradle.ktspluginManagement{repositories{google() gradlePluginPortal() mavenCentral() } } plugins{id("tools.forma.android") version "0.1.3" } // Configure shared aspects of your android Projectbuildscript{androidProjectConfiguration( project = project, minSdk =21, targetSdk =33, compileSdk =33, agpVersion ="7.4.2", extraPlugins = listOf( "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3", "com.google.firebase:firebase-crashlytics-gradle:2.9.4", ) ) }

Your kotlin android library

// Single method, type-safe creation of your target// Plugins applied automatically// Project configuration shared between targets androidLibrary( // Mandatory, visible from build configuration packageName ="tools.forma.sample.example", // External dependencies declaration, one universal syntax dependencies = deps( google.material, androidx.appcompat, ) + deps( // Internal project dependencies, declared separately from externals project(":demo-library") ), // Test dependencies declaration testDependencies = deps( test.junit ), // Android test dependencies declaration androidTestDependencies = deps( test.espresso ) )

Progress

Supported target typesimplementedpurposevalidation
androidBinaryโœ…Generate single APKโœ…
androidAppโœ…Application classpartial
androidLibraryโœ…Android librarypartial
androidWidgetโœ…Custom Viewpartial
androidResโœ…Resources Onlyโœ…
androidTestUtilsโœ…Shared code for Android testsโœ…
androidUtilsโœ…Library extensionspartial
testUtilsโœ…Shared code for unit testsโœ…
utilsโœ…JVM Library extensionspartial
libraryโœ…JVM Librarypartial
apiโœ…Feature external API'spartial
implโœ…Feature implementationpartial

Dependency matrix

Each column represents the list of allowed/disallowed dependencies

androidAppandroidBinaryandroidLibraryandroidWidgetandroidResandroidTestUtilsapiimplandroidUtilsutilstestUtils
androidAppโŒโœ…โŒโŒโŒโŒโŒโŒโŒโŒโŒ
androidBinaryโŒโŒโŒโŒโŒโŒโŒโŒโŒโŒโŒ
androidLibraryโœ…โŒโœ…โœ…โŒโŒโŒโœ…โŒโŒโŒ
androidWidgetโŒโŒโœ…โœ…โŒโŒโŒโœ…โŒโŒโŒ
androidResโŒโŒโœ…โœ…โœ…โœ…โŒโœ…โœ…โŒโŒ
androidTestUtilsโŒโŒโŒโŒโŒโœ…โŒโŒโŒโŒโŒ
apiโœ…โŒโŒโŒโŒโœ…โœ…โœ…โŒโŒโŒ
implโœ…โŒโŒโŒโŒโœ…โŒโŒโŒโŒโŒ
androidUtilsโœ…โŒโœ…โœ…โŒโœ…โŒโœ…โœ…โŒโŒ
utilsโŒโŒโœ…โœ…โŒโœ…โŒโœ…โœ…โœ…โœ…
testUtilsโŒโŒโŒโŒโŒโœ…โŒโŒโŒโŒโœ…

Icons made by Freepik from www.flaticon.com

Sponsor this project

 

Contributors 9

Languages