Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase out scoping for dagger #47

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<global id="newFolder" value="${escapeXmlAttribute(srcOut)}/${classToResource(activityClass)}" />

<global id="graphClass" value="${underscoreToCamelCase(classToResource(activityClass))}Graph" />
<global id="scopeClass" value="${underscoreToCamelCase(classToResource(activityClass))}Scope" />
<global id="moduleClass" value="${underscoreToCamelCase(classToResource(activityClass))}Module" />
<global id="componentClass" value="${underscoreToCamelCase(classToResource(activityClass))}Component" />

Expand Down
3 changes: 0 additions & 3 deletions android-studio-plugin/InFullMvpActivityJava/recipe.xml.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
<instantiate from="root/src/mvp_folder/di/Graph.java.ftl"
to="${newFolder}/di/${graphClass}.java" />

<instantiate from="root/src/mvp_folder/di/Scope.java.ftl"
to="${newFolder}/di/${scopeClass}.java" />

<instantiate from="root/src/mvp_folder/di/Module.java.ftl"
to="${newFolder}/di/${moduleClass}.java" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class ${graphClass} {
builder.${moduleClass?uncap_first}(module);
}

@${scopeClass}
@Component(
<#if useApplicationComponent>
dependencies = ApplicationComponent.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,21 @@ public class ${moduleClass} {
this.activity = activity;
}

@${scopeClass}
@Provides
Context providesContext() {
return activity;
}

@${scopeClass}
@Provides
${viewClass} provides${viewClass}() {
return new ${viewClass}();
}

@${scopeClass}
@Provides
public ${modelClass} provides${modelClass}() {
return new ${modelClass}();
}

@${scopeClass}
@Provides
public ${presenterClass} provides${presenterClass}(
${viewClass} view,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<global id="newFolder" value="${escapeXmlAttribute(srcOut)}/${classToResource(activityClass)}" />

<global id="graphClass" value="${underscoreToCamelCase(classToResource(activityClass))}Graph" />
<global id="scopeClass" value="${underscoreToCamelCase(classToResource(activityClass))}Scope" />
<global id="moduleClass" value="${underscoreToCamelCase(classToResource(activityClass))}Module" />
<global id="componentClass" value="${underscoreToCamelCase(classToResource(activityClass))}Component" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
<instantiate from="root/src/mvp_folder/di/ComponentClass.java.ftl"
to="${newFolder}/di/${componentClass}.java" />

<instantiate from="root/src/mvp_folder/di/Scope.java.ftl"
to="${newFolder}/di/${scopeClass}.java" />

<instantiate from="root/src/mvp_folder/di/Module.java.ftl"
to="${newFolder}/di/${moduleClass}.java" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import ${relativePackage}.${activityClass};
import dagger.Subcomponent;
import dagger.android.AndroidInjector;

@${scopeClass}
@Subcomponent
public interface ${componentClass} {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,19 @@ import dagger.Provides;
@Module
public abstract class ${moduleClass} {

@${scopeClass}
@Binds
abstract Context bindsContext(${activityClass} activity);

@${scopeClass}
@Provides
static ${viewClass} provides${viewClass}() {
return new ${viewClass}();
}

@${scopeClass}
@Provides
static ${modelClass} provides${modelClass}() {
return new ${modelClass}();
}

@${scopeClass}
@Provides
static ${presenterClass} provides${
presenterClass}(${modelClass} model,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,12 @@
suggest="${applicationPackage}"
help="Path to .R of this app/module" />

<parameter
id="useApplicationComponent"
name="Use ApplicationComponent"
type="boolean"
default="true"
help="If true, ApplicationComponent will be used in generated Graph" />

<parameter
id="appComponentPackage"
name="Application Path"
type="string"
constraints="package|empty"
suggest="${packageName}.application"
visibility="useApplicationComponent"
help="Package where we can find di.ApplicationComponent and di.Components" />

<thumbs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<global id="newFolder" value="${escapeXmlAttribute(srcOut)}/${classToResource(activityClass)}" />

<global id="graphClass" value="${underscoreToCamelCase(classToResource(activityClass))}Graph" />
<global id="scopeClass" value="${underscoreToCamelCase(classToResource(activityClass))}Scope" />
<global id="moduleClass" value="${underscoreToCamelCase(classToResource(activityClass))}Module" />
<global id="componentClass" value="${underscoreToCamelCase(classToResource(activityClass))}Component" />

Expand Down
3 changes: 0 additions & 3 deletions android-studio-plugin/InFullMvpActivityKotlin/recipe.xml.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
<instantiate from="root/src/mvp_folder/di/Graph.java.ftl"
to="${newFolder}/di/${graphClass}.java" />

<instantiate from="root/src/mvp_folder/di/Scope.java.ftl"
to="${newFolder}/di/${scopeClass}.java" />

<instantiate from="root/src/mvp_folder/di/Module.java.ftl"
to="${newFolder}/di/${moduleClass}.java" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class ${graphClass} {
builder.${moduleClass?uncap_first}(module);
}

@${scopeClass}
@Component(
<#if useApplicationComponent>
dependencies = ApplicationComponent.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,21 @@ public class ${moduleClass} {
this.activity = activity;
}

@${scopeClass}
@Provides
Context providesContext() {
return activity;
}

@${scopeClass}
@Provides
${viewClass} provides${viewClass}() {
return new ${viewClass}();
}

@${scopeClass}
@Provides
public ${modelClass} provides${modelClass}() {
return new ${modelClass}();
}

@${scopeClass}
@Provides
public ${presenterClass} provides${presenterClass}(
${modelClass} model,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<global id="newFolder" value="${escapeXmlAttribute(srcOut)}/${classToResource(activityClass)}" />

<global id="graphClass" value="${underscoreToCamelCase(classToResource(activityClass))}Graph" />
<global id="scopeClass" value="${underscoreToCamelCase(classToResource(activityClass))}Scope" />
<global id="moduleClass" value="${underscoreToCamelCase(classToResource(activityClass))}Module" />
<global id="componentClass" value="${underscoreToCamelCase(classToResource(activityClass))}Component" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
<instantiate from="root/src/mvp_folder/di/Component.kt.ftl"
to="${newFolder}/di/${componentClass}.kt" />

<instantiate from="root/src/mvp_folder/di/Scope.java.ftl"
to="${newFolder}/di/${scopeClass}.java" />

<instantiate from="root/src/mvp_folder/di/Module.java.ftl"
to="${newFolder}/di/${moduleClass}.java" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package ${relativePackage}.di

import ${relativePackage}.${activityClass}
import ${relativePackage}.di.${scopeClass}
import dagger.Subcomponent
import dagger.android.AndroidInjector

import dagger.Component

@${scopeClass}
@Subcomponent
interface ${componentClass} : AndroidInjector<${activityClass}> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,19 @@ import dagger.Provides;
@Module
public abstract class ${moduleClass} {

@${scopeClass}
@Binds
abstract Context bindsContext(${activityClass} activity);

@${scopeClass}
@Provides
static ${viewClass} provides${viewClass}() {
return new ${viewClass}();
}

@${scopeClass}
@Provides
static ${modelClass} provides${modelClass}() {
return new ${modelClass}();
}

@${scopeClass}
@Provides
static ${presenterClass} provides${
presenterClass}(${modelClass} model,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,13 @@
suggest="${applicationPackage}"
type="string"/>

<parameter
name="Use ApplicationComponent"
default="true"
help="If true, ApplicationComponent will be used in generated Graph"
id="useApplicationComponent"
type="boolean"/>

<parameter
name="Application Path"
constraints="package|empty"
help="Package where we can find di.ApplicationComponent and di.Components"
id="appComponentPackage"
suggest="${packageName}.application"
type="string"
visibility="useApplicationComponent"/>
type="string"/>

<thumbs>
<thumb>ifmdagger.png</thumb>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<global id="newFolder" value="${escapeXmlAttribute(srcOut)}/${classToResource(fragmentClass)}" />

<global id="graphClass" value="${underscoreToCamelCase(classToResource(fragmentClass))}Graph" />
<global id="scopeClass" value="${underscoreToCamelCase(classToResource(fragmentClass))}Scope" />
<global id="moduleClass" value="${underscoreToCamelCase(classToResource(fragmentClass))}Module" />
<global id="componentClass" value="${underscoreToCamelCase(classToResource(fragmentClass))}Component" />

Expand Down
3 changes: 0 additions & 3 deletions android-studio-plugin/InFullMvpFragmentJava/recipe.xml.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
<instantiate from="root/src/mvp_folder/di/Graph.java.ftl"
to="${newFolder}/di/${graphClass}.java" />

<instantiate from="root/src/mvp_folder/di/Scope.java.ftl"
to="${newFolder}/di/${scopeClass}.java" />

<instantiate from="root/src/mvp_folder/di/Module.java.ftl"
to="${newFolder}/di/${moduleClass}.java" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class ${graphClass} {
builder.${moduleClass?uncap_first}(module);
}

@${scopeClass}
@Component(
<#if useApplicationComponent>
dependencies = ApplicationComponent.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,16 @@ public class ${moduleClass} {
this.fragment = fragment;
}

@${scopeClass}
@Provides
${viewClass} provides${viewClass}() {
return new ${viewClass}();
}

@${scopeClass}
@Provides
public ${modelClass} provides${modelClass}() {
return new ${modelClass}();
}

@${scopeClass}
@Provides
${presenterClass} provides${presenterClass}(${viewClass} view,
${modelClass} model) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<global id="relativePackage" value="${packageName}.${classToResource(fragmentClass)}" />
<global id="newFolder" value="${escapeXmlAttribute(srcOut)}/${classToResource(fragmentClass)}" />

<global id="scopeClass" value="${underscoreToCamelCase(classToResource(fragmentClass))}Scope" />
<global id="moduleClass" value="${underscoreToCamelCase(classToResource(fragmentClass))}Module" />
<global id="componentClass" value="${underscoreToCamelCase(classToResource(fragmentClass))}Component" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
<instantiate from="root/src/mvp_folder/di/Component.java.ftl"
to="${newFolder}/di/${componentClass}.java" />

<instantiate from="root/src/mvp_folder/di/Scope.java.ftl"
to="${newFolder}/di/${scopeClass}.java" />

<instantiate from="root/src/mvp_folder/di/Module.java.ftl"
to="${newFolder}/di/${moduleClass}.java" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package ${relativePackage}.di;

import ${relativePackage}.${fragmentClass};
import ${relativePackage}.di.${scopeClass};
import dagger.Subcomponent;
import dagger.android.AndroidInjector;

@${scopeClass}
@Subcomponent
public interface ${componentClass} {

Expand Down
Loading