Skip to content

Commit

Permalink
Merge pull request #26 from FrantisekGazo/develop
Browse files Browse the repository at this point in the history
mvp fix
  • Loading branch information
FrantisekGazo authored Jan 28, 2017
2 parents d985ae2 + 0bda503 commit 0bc86d1
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Blade.wiki
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change Log
==========

Version 2.6.1 *(2017-01-28)*
----------------------------

* Fix: `mvp` generated Activity classes

Version 2.6.0 *(2017-01-01)*
----------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public void activityWithoutPresenter() {
}

@Test
public void activityWithoutPresenterWithBlade() {
public void activityWithoutPresenterWithBladeImplementingIView() {
JavaFileObject viewInterface = file("com.example", "IMyView")
.imports(
IView.class, "V"
Expand Down Expand Up @@ -246,6 +246,36 @@ public void activityWithoutPresenterWithBlade() {
.generatesSources(expected);
}

@Test
public void activityWithoutPresenterWithBlade() {
JavaFileObject activity = file("com.example", "MyActivity")
.imports(
Activity.class,
Blade.class, "B"
)
.body(
"@$B",
"public class $T extends Activity {",
"}"
);


JavaFileObject expected = generatedFile("com.example", "MyActivity_Helper")
.imports(
WeavedMvpActivity.class, "M"
)
.body(
"abstract class $T implements $M {",
"}"
);

assertFiles(activity)
.with(BladeProcessor.Module.MVP)
.compilesWithoutError()
.and()
.generatesSources(expected);
}

@Test
public void activityWith1Presenter() {
JavaFileObject viewInterface = file("com.example", "IMyView")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1536M

LIB_GROUP_ID = eu.f3rog.blade
ARTIFACT_ID = none
LIB_VERSION = 2.6.0
LIB_VERSION = 2.6.1

LIB_VERSION_DESC = Android Library for Boilerplate Destruction

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public void checkClass(TypeElement e) throws ProcessorError {
} else if (isSubClassOf(e, View.class)) {
viewType = ViewType.VIEW;
}
} else if (isActivitySubClass(e)) {
viewType = ViewType.ACTIVITY;
}

mViewType = viewType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public final class BladePlugin
public static String ERROR_CONFIG_FILE_IS_MISSING = "Blade configuration file is missing! (more info here: https://github.com/FrantisekGazo/Blade/wiki#1-create-configuration-file)"

public static String LIB_GROUP_ID = "eu.f3rog.blade"
public static String LIB_VERSION = "2.6.0"
public static String LIB_VERSION = "2.6.1"
public static String LIB_CONFIG_FILE_NAME = "blade"
public static String[] LIB_MODULES = ["arg", "extra", "mvp", "parcel", "state"]

Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}

classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'eu.f3rog.blade:plugin:2.6.0-beta1'
classpath 'eu.f3rog.blade:plugin:2.6.0'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import eu.f3rog.blade.core.Bundler;
import blade.Bundler;

public final class StringCustomBundler implements Bundler<String> {

Expand Down

0 comments on commit 0bc86d1

Please sign in to comment.