Skip to content

Commit e2e1b5a

Browse files
authored
Forma Android v0.1.3 (#131)
* Forma Android v0.1.3 * Readme Updated
1 parent 0db8b2e commit e2e1b5a

File tree

46 files changed

+341
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+341
-210
lines changed

README.md

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<p align="center">
32
<a href="https://forma.tools" target="_blank" rel="noopener noreferrer"><img width="100" src="./img/press.svg" alt="Logo"></a>
43
</p>
@@ -18,9 +17,12 @@
1817
<img alt="GitHub top language" src="https://img.shields.io/github/languages/top/formatools/forma"/>
1918
<img alt="GitHub closed pull requests" src="https://img.shields.io/github/issues-pr-closed/formatools/forma"/>
2019
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/formatools/forma?style=social"/>
21-
</p>
20+
</p>
2221

23-
**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.
22+
**Forma** - Kotlin first, Meta Build System with Android and Gradle support. Opinionated, scalable, thoughtfully
23+
structured, type-safe and guided way to declare your project structure. Distributed as a Gradle plugin, Forma helps
24+
developers to shift focus from `Build Configuration` to `Project Structure Declaration`, abstracting away build
25+
configuration complexity.
2426

2527
- You don't need to be a gradle expert anymore
2628
- Get rid of project configuration bad practices
@@ -32,50 +34,46 @@
3234
- Extensible - be the expert when you need to!
3335
- And much more...
3436

35-
⚠️ We are using `target` term to express application components(e.g. modules or projects, depending in the context) across documentation and code, there is 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.
37+
⚠️ We are using `target` term to express application components(e.g. modules or projects, depending in the context)
38+
across documentation and code, there is a couple of reasons for that. `Module` term often confused with Dagger modules
39+
which makes communication harder, `project` from the other hand used only in Gradle context but not in other build
40+
systems like Buck and Bazel.
3641

3742
⚠️ This is early *alpha* release - please do try this at home🏠
3843

39-
Easiest way to start is here >> ‼️ https://github.com/stepango/FormaShowcase ‼️
40-
4144
[Presentation Link](https://www.beautiful.ai/player/-MLn7RnBBWeh7vePDoDq)
4245

43-
Configuration made easy (Gradle 6.8+):
44-
```gradle
45-
// settings.gradle.kts
46-
dependencyResolutionManagement {
47-
@Suppress("UnstableApiUsage")
48-
repositories {
49-
google()
50-
jcenter()
51-
}
52-
}
53-
54-
```
55-
46+
Configuration made easy:
5647

5748
``` gradle
5849
// root build.gradle.kts
59-
buildscript {
50+
pluginManagement {
6051
repositories {
6152
google()
53+
gradlePluginPortal()
54+
mavenCentral()
6255
}
6356
}
6457
6558
plugins {
66-
id("tools.forma.android") version "0.0.1"
59+
id("tools.forma.android") version "0.1.3"
6760
}
6861
6962
// Configure shared aspects of your android Project
70-
androidProjectConfiguration(
71-
minSdk = 21,
72-
targetSdk = 29,
73-
compileSdk = 29,
74-
kotlinVersion = "1.4.10",
75-
agpVersion = "4.0.0",
76-
versionCode = 1,
77-
versionName = "1.0"
78-
)
63+
buildscript {
64+
androidProjectConfiguration(
65+
project = project,
66+
minSdk = 21,
67+
targetSdk = 33,
68+
compileSdk = 33,
69+
agpVersion = "7.4.2",
70+
dataBinding = true,
71+
extraPlugins = listOf(
72+
"androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3",
73+
"com.google.firebase:firebase-crashlytics-gradle:2.9.4",
74+
)
75+
)
76+
}
7977
```
8078

8179
Your kotlin android library
@@ -105,24 +103,25 @@ androidLibrary(
105103
)
106104
)
107105
```
106+
108107
## Progress
109108

110-
| Supported target types | implemented | purpose | validation |
111-
|:-----------------------------:|:-----------:|:------------------------:|:-----------:
112-
| androidBinary | | Genearte single APK | |
113-
| androidApp | | Application class | partial |
114-
| androidLibrary | | Android library | partial |
115-
| dataBinding || Data Binding Layouts | partial |
116-
| dataBindingAdapters || Data Binding Adapters | partial |
117-
| androidWidget | | Custom View | partial |
118-
| androidRes | | Resources Only | |
119-
| androidTestUtils || Shared code for Android tests | |
120-
| androidUtils | | Library extensions | partial |
121-
| testUtils || Shared code for unit tests | |
122-
| utils || JVM Library extensions | partial |
123-
| library | | JVM Library | partial |
124-
| api || Feature external API's | partial |
125-
| impl || Feature implementation | partial |
126-
127-
128-
Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>
109+
| Supported target types | implemented | purpose | validation |
110+
|:----------------------:|:-----------:|:-----------------------------:|:----------:|
111+
| androidBinary | | Genearte single APK | |
112+
| androidApp | | Application class | partial |
113+
| androidLibrary | | Android library | partial |
114+
| dataBinding || Data Binding Layouts | partial |
115+
| dataBindingAdapters || Data Binding Adapters | partial |
116+
| androidWidget | | Custom View | partial |
117+
| androidRes | | Resources Only | |
118+
| androidTestUtils || Shared code for Android tests | |
119+
| androidUtils | | Library extensions | partial |
120+
| testUtils || Shared code for unit tests | |
121+
| utils || JVM Library extensions | partial |
122+
| library | | JVM Library | partial |
123+
| api || Feature external API's | partial |
124+
| impl || Feature implementation | partial |
125+
126+
Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a>
127+
from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>

build-dependencies/dependencies/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
group = "tools.forma.demo"
66

77
dependencies {
8-
implementation("tools.forma:deps-core")
8+
implementation("tools.forma:deps")
99
implementation("tools.forma:owners")
1010
implementation("tools.forma:config")
1111

build-dependencies/dependencies/src/main/kotlin/Plugins.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension
2-
import tools.forma.deps_core.PluginWrapper
3-
import tools.forma.deps_core.pluginConfiguration
2+
import tools.forma.deps.core.PluginWrapper
3+
import tools.forma.deps.core.pluginConfiguration
44

55
object Plugins {
66

build-dependencies/dependencies/src/main/kotlin/Team.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import tools.forma.owner.Person
2-
import tools.forma.owner.Team
1+
import tools.forma.owners.Person
2+
import tools.forma.owners.Team
33

44
object Users {
55
val stepango = Person(

plugins/android/build.gradle.kts

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,23 @@ plugins {
77
id("com.gradle.plugin-publish")
88
}
99

10-
group = "tools.forma"
11-
version = "0.1.2"
10+
group = rootProject.ext["group"] as String
11+
version = rootProject.ext["version"] as String
12+
13+
gradlePlugin {
14+
website.set(rootProject.ext["website"] as String)
15+
vcsUrl.set(rootProject.ext["vcsUrl"] as String)
16+
plugins {
17+
create(name) {
18+
id = "$group.$name"
19+
displayName = rootProject.ext["displayName"] as String
20+
description = rootProject.ext["description"] as String
21+
implementationClass = "$id.plugin.FormaPlugin"
22+
@Suppress("UNCHECKED_CAST")
23+
tags.set(rootProject.ext["tags"] as List<String>)
24+
}
25+
}
26+
}
1227

1328
tasks.named("compileKotlin", KotlinCompilationTask::class.java) {
1429
compilerOptions {
@@ -19,33 +34,19 @@ tasks.named("compileKotlin", KotlinCompilationTask::class.java) {
1934
dependencies {
2035
implementation("com.android.tools.build:gradle:7.4.2")
2136
implementation(embeddedKotlin("gradle-plugin"))
22-
implementation(project(":deps-core"))
2337
implementation(project(":target"))
2438
implementation(project(":validation"))
2539
implementation(project(":owners"))
2640
implementation(project(":config"))
41+
implementation(project(":deps"))
2742
}
2843

29-
gradlePlugin {
30-
website.set("https://forma.tools/")
31-
vcsUrl.set("https://github.com/formatools/forma.git")
32-
plugins {
33-
create("Forma") {
34-
id = "tools.forma.android"
35-
displayName = "Forma - Meta Build System with Gradle and Android support"
36-
description = "Best way to structure your Android Project"
37-
implementationClass = "tools.forma.android.plugin.FormaPlugin"
38-
tags.set(
39-
listOf(
40-
"kotlin",
41-
"android",
42-
"structure",
43-
"dependencies",
44-
"module",
45-
"rules",
46-
"project"
47-
)
48-
)
49-
}
50-
}
44+
tasks.named<Task>("publishPlugins") {
45+
dependsOn(
46+
":target:publishPlugins",
47+
":validation:publishPlugins",
48+
":owners:publishPlugins",
49+
":config:publishPlugins",
50+
":deps:publishPlugins",
51+
)
5152
}

plugins/android/src/main/java/TargetBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import org.gradle.api.Project
2-
import tools.forma.deps_core.PluginWrapper
2+
import tools.forma.deps.core.PluginWrapper
33

44
class TargetBuilder(
55
private val project: Project

plugins/android/src/main/java/androidApp.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ import tools.forma.android.feature.androidLibraryFeatureDefinition
33
import tools.forma.android.feature.applyFeatures
44
import tools.forma.android.feature.kotlinAndroidFeatureDefinition
55
import tools.forma.android.target.ApplicationTargetTemplate
6-
import tools.forma.owner.NoOwner
7-
import tools.forma.owner.Owner
6+
import tools.forma.owners.NoOwner
7+
import tools.forma.owners.Owner
88
import tools.forma.android.utils.BuildConfiguration
99
import tools.forma.validation.EmptyValidator
1010
import tools.forma.android.validation.disallowResources
1111
import tools.forma.validation.validate
1212
import tools.forma.android.visibility.Public
1313
import tools.forma.android.visibility.Visibility
14-
import tools.forma.deps_core.FormaDependency
15-
import tools.forma.deps_core.NamedDependency
16-
import tools.forma.deps_core.applyDependencies
14+
import tools.forma.deps.core.FormaDependency
15+
import tools.forma.deps.core.NamedDependency
16+
import tools.forma.deps.core.applyDependencies
1717
import org.gradle.api.Project
1818
import tools.forma.android.feature.kaptConfigurationFeature
1919

plugins/android/src/main/java/androidBinary.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import org.gradle.api.Project
22
import tools.forma.android.feature.AndroidBinaryFeatureConfiguration
33
import tools.forma.android.feature.androidBinaryFeatureDefinition
44
import tools.forma.android.feature.applyFeatures
5-
import tools.forma.owner.NoOwner
6-
import tools.forma.owner.Owner
5+
import tools.forma.owners.NoOwner
6+
import tools.forma.owners.Owner
77
import tools.forma.android.target.BinaryTargetTemplate
88
import tools.forma.android.utils.BuildConfiguration
99
import tools.forma.android.validation.disallowResources
10-
import tools.forma.deps_core.FormaDependency
11-
import tools.forma.deps_core.applyDependencies
10+
import tools.forma.deps.core.FormaDependency
11+
import tools.forma.deps.core.applyDependencies
1212
import tools.forma.validation.EmptyValidator
1313
import tools.forma.validation.validate
1414

plugins/android/src/main/java/androidLibrary.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import tools.forma.android.feature.androidLibraryFeatureDefinition
44
import tools.forma.android.feature.applyFeatures
55
import tools.forma.android.feature.kaptConfigurationFeature
66
import tools.forma.android.feature.kotlinAndroidFeatureDefinition
7-
import tools.forma.owner.NoOwner
8-
import tools.forma.owner.Owner
7+
import tools.forma.owners.NoOwner
8+
import tools.forma.owners.Owner
99
import tools.forma.android.target.LibraryTargetTemplate
1010
import tools.forma.android.utils.BuildConfiguration
1111
import tools.forma.android.visibility.Public
1212
import tools.forma.android.visibility.Visibility
13-
import tools.forma.deps_core.FormaDependency
14-
import tools.forma.deps_core.NamedDependency
15-
import tools.forma.deps_core.applyDependencies
13+
import tools.forma.deps.core.FormaDependency
14+
import tools.forma.deps.core.NamedDependency
15+
import tools.forma.deps.core.applyDependencies
1616
import tools.forma.validation.EmptyValidator
1717
import tools.forma.validation.validate
1818

plugins/android/src/main/java/androidNative.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import org.gradle.api.Project
22
import tools.forma.android.config.NdkAbi
33
import tools.forma.android.config.NdkBuildSystem
4-
import tools.forma.owner.NoOwner
5-
import tools.forma.owner.Owner
4+
import tools.forma.owners.NoOwner
5+
import tools.forma.owners.Owner
66
import tools.forma.android.target.NativeTarget
77
import tools.forma.android.visibility.Public
88
import tools.forma.android.visibility.Visibility

0 commit comments

Comments
 (0)