From 6e160dadba94cbd0cdff3b64b89653e3690425f7 Mon Sep 17 00:00:00 2001 From: FrantisekGazo Date: Sun, 1 Jan 2017 21:15:23 +0100 Subject: [PATCH 1/3] Update sample app to use 2.6.0 --- sample/build.gradle | 2 +- .../java/eu/f3rog/blade/sample/state/StringCustomBundler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sample/build.gradle b/sample/build.gradle index 4b81a78..f1cb0fa 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -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' } } diff --git a/sample/src/main/java/eu/f3rog/blade/sample/state/StringCustomBundler.java b/sample/src/main/java/eu/f3rog/blade/sample/state/StringCustomBundler.java index e97ab19..093b80c 100644 --- a/sample/src/main/java/eu/f3rog/blade/sample/state/StringCustomBundler.java +++ b/sample/src/main/java/eu/f3rog/blade/sample/state/StringCustomBundler.java @@ -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 { From de0c7da7e6161f84594bde4e7e010de50eb643a4 Mon Sep 17 00:00:00 2001 From: Frantisek Gazo Date: Sat, 28 Jan 2017 12:44:09 +0100 Subject: [PATCH 2/3] Fix mvp: Generate mvp _Helper for activity class with @Blade --- .../blade/compiler/mvp/PresenterTest.java | 32 ++++++++++++++++++- .../compiler/mvp/PresenterHelperModule.java | 2 ++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/core-compiler/src/test/java/eu/f3rog/blade/compiler/mvp/PresenterTest.java b/core-compiler/src/test/java/eu/f3rog/blade/compiler/mvp/PresenterTest.java index aa59cea..2768c17 100644 --- a/core-compiler/src/test/java/eu/f3rog/blade/compiler/mvp/PresenterTest.java +++ b/core-compiler/src/test/java/eu/f3rog/blade/compiler/mvp/PresenterTest.java @@ -207,7 +207,7 @@ public void activityWithoutPresenter() { } @Test - public void activityWithoutPresenterWithBlade() { + public void activityWithoutPresenterWithBladeImplementingIView() { JavaFileObject viewInterface = file("com.example", "IMyView") .imports( IView.class, "V" @@ -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") diff --git a/module/mvp-compiler/src/main/java/eu/f3rog/blade/compiler/mvp/PresenterHelperModule.java b/module/mvp-compiler/src/main/java/eu/f3rog/blade/compiler/mvp/PresenterHelperModule.java index 4e021e2..11af221 100644 --- a/module/mvp-compiler/src/main/java/eu/f3rog/blade/compiler/mvp/PresenterHelperModule.java +++ b/module/mvp-compiler/src/main/java/eu/f3rog/blade/compiler/mvp/PresenterHelperModule.java @@ -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; From 0bda503f66d8fb78cecb41adcc472c1e21303644 Mon Sep 17 00:00:00 2001 From: FrantisekGazo Date: Sat, 28 Jan 2017 13:18:27 +0100 Subject: [PATCH 3/3] Release version 2.6.1 --- Blade.wiki | 2 +- CHANGELOG.md | 5 +++++ gradle.properties | 2 +- .../src/main/groovy/eu/f3rog/blade/plugin/BladePlugin.groovy | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Blade.wiki b/Blade.wiki index 4ffba1b..aeb3a4b 160000 --- a/Blade.wiki +++ b/Blade.wiki @@ -1 +1 @@ -Subproject commit 4ffba1bb573a3b42be9aad8cd9d1427d8102d7cb +Subproject commit aeb3a4b00a27b47b3cf0905cffc13b569e2ffbde diff --git a/CHANGELOG.md b/CHANGELOG.md index fc83561..7d880e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)* ---------------------------- diff --git a/gradle.properties b/gradle.properties index 146a1a4..eba3019 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/plugin/src/main/groovy/eu/f3rog/blade/plugin/BladePlugin.groovy b/plugin/src/main/groovy/eu/f3rog/blade/plugin/BladePlugin.groovy index 6d427a0..daa777e 100644 --- a/plugin/src/main/groovy/eu/f3rog/blade/plugin/BladePlugin.groovy +++ b/plugin/src/main/groovy/eu/f3rog/blade/plugin/BladePlugin.groovy @@ -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"]