Skip to content

Commit

Permalink
Merge pull request #20 from DylanCaiCoding/master
Browse files Browse the repository at this point in the history
修复使用 kotlin 模板时不会自动创建 Dagger**Component 的问题
  • Loading branch information
JessYanCoding authored Sep 10, 2019
2 parents d5103f1 + 90ca32a commit 2490af5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions MVPArmsTemplate/dagger2.gradle.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies {
kapt rootProject.ext.dependencies["dagger2-compiler"]
}
7 changes: 7 additions & 0 deletions MVPArmsTemplate/dagger2_macros.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<#macro addAllKaptDependencies>
<#if !isNewProject && ((language!'Java')?string == 'Kotlin')>
<apply plugin="kotlin-kapt" />
<merge from="root://activities/MVPArmsTemplate/dagger2.gradle.ftl"
to="${escapeXmlAttribute(projectOut)}/build.gradle" />
</#if>
</#macro>
2 changes: 2 additions & 0 deletions MVPArmsTemplate/recipe.xml.ftl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<#import "root://activities/common/kotlin_macros.ftl" as kt>
<#import "root://activities/MVPArmsTemplate/dagger2_macros.ftl" as dagger2>
<recipe>
<@kt.addAllKotlinDependencies />
<@dagger2.addAllKaptDependencies />
<#if needActivity>
<merge from="root/AndroidManifest.xml.ftl"
to="${escapeXmlAttribute(manifestOut)}/AndroidManifest.xml" />
Expand Down
3 changes: 3 additions & 0 deletions MVPArtTemplate/dagger2.gradle.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies {
kapt rootProject.ext.dependencies["dagger2-compiler"]
}
7 changes: 7 additions & 0 deletions MVPArtTemplate/dagger2_macros.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<#macro addAllKaptDependencies>
<#if !isNewProject && ((language!'Java')?string == 'Kotlin')>
<apply plugin="kotlin-kapt" />
<merge from="root://activities/MVPArmsTemplate/dagger2.gradle.ftl"
to="${escapeXmlAttribute(projectOut)}/build.gradle" />
</#if>
</#macro>
4 changes: 3 additions & 1 deletion MVPArtTemplate/recipe.xml.ftl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<#import "root://activities/common/kotlin_macros.ftl" as kt>
<#import "root://activities/MVPArmsTemplate/dagger2_macros.ftl" as dagger2>
<recipe>
<@kt.addAllKotlinDependencies />
<@kt.addAllKotlinDependencies />
<@dagger2.addAllKaptDependencies />
<#if needActivity>
<merge from="root/AndroidManifest.xml.ftl"
to="${escapeXmlAttribute(manifestOut)}/AndroidManifest.xml" />
Expand Down

0 comments on commit 2490af5

Please sign in to comment.