-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Background** Add module template with help Geminio See here for plugin build: hhru/android-multimodule-plugin#48 **Changes** - Add template
- Loading branch information
Showing
6 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
requiredParams: | ||
name: Flipper Blank Module | ||
description: Creates empty Gradle-module for general purposes | ||
|
||
predefinedFeatures: | ||
- enableModuleCreationParams: | ||
defaultPackageNamePrefix: com.flipperdevices | ||
|
||
widgets: | ||
- booleanParameter: | ||
id: needCompose | ||
name: Add Compose dependencies? | ||
help: Adds compose gradle plugin and compose deps | ||
default: false | ||
|
||
- booleanParameter: | ||
id: isApi | ||
name: Is API submodule? | ||
help: If it is api module, we create only interface for instances | ||
default: false | ||
|
||
- booleanParameter: | ||
id: shouldGenerateDI | ||
name: Add di? | ||
help: Adds Dagger and Anvil deps, and create di component | ||
default: false | ||
|
||
recipe: | ||
- mkDirs: | ||
- ${srcOut} | ||
|
||
- instantiate: | ||
from: root/gitignore.ftl | ||
to: ${rootOut}/.gitignore | ||
|
||
- instantiate: | ||
from: root/build.gradle.kts.ftl | ||
to: ${rootOut}/build.gradle.kts | ||
|
||
- instantiate: | ||
from: root/src/main/AndroidManifest.xml.ftl | ||
to: ${manifestOut}/AndroidManifest.xml | ||
|
||
- predicate: | ||
validIf: ${shouldGenerateDI} | ||
commands: | ||
- mkDirs: | ||
- ${srcOut}/di/ | ||
- instantiateAndOpen: | ||
from: root/src/app_package/di/BlankComponent.kt.ftl | ||
to: ${srcOut}/di/${__formattedModuleName}Component.kt |
33 changes: 33 additions & 0 deletions
33
config/geminio/modules_templates/Blank Module/root/build.gradle.kts.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
plugins { | ||
id("com.android.library") | ||
id("kotlin-android") | ||
<#if shouldGenerateDI> | ||
id("com.squareup.anvil") | ||
id("kotlin-kapt") | ||
</#if> | ||
} | ||
apply<com.flipperdevices.gradle.ConfigurationPlugin>() | ||
<#if needCompose> | ||
apply<com.flipperdevices.gradle.ComposerPlugin>() | ||
</#if> | ||
|
||
dependencies { | ||
implementation(project(":components:core")) | ||
|
||
implementation(Libs.ANNOTATIONS) | ||
implementation(Libs.APPCOMPAT) | ||
<#if needCompose> | ||
|
||
// Compose | ||
implementation(Libs.COMPOSE_UI) | ||
implementation(Libs.COMPOSE_TOOLING) | ||
implementation(Libs.COMPOSE_FOUNDATION) | ||
implementation(Libs.COMPOSE_MATERIAL) | ||
</#if> | ||
<#if shouldGenerateDI> | ||
|
||
// Dagger deps | ||
implementation(Libs.DAGGER) | ||
kapt(Libs.DAGGER_COMPILER) | ||
</#if> | ||
} |
1 change: 1 addition & 0 deletions
1
config/geminio/modules_templates/Blank Module/root/gitignore.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
9 changes: 9 additions & 0 deletions
9
config/geminio/modules_templates/Blank Module/root/src/app_package/di/BlankComponent.kt.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package ${packageName}.di | ||
|
||
import com.flipperdevices.core.di.AppGraph | ||
import com.squareup.anvil.annotations.ContributesTo | ||
|
||
@ContributesTo(AppGraph::class) | ||
interface ${__formattedModuleName}Component { | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
config/geminio/modules_templates/Blank Module/root/src/main/AndroidManifest.xml.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<manifest package="${packageName}" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
templatesRootDirPath: /config/geminio/templates | ||
modulesTemplatesRootDirPath: /config/geminio/modules_templates | ||
|
||
groupsNames: | ||
forNewGroup: Flipper Templates | ||
forNewModulesGroup: Flipper Modules |