Skip to content

Commit

Permalink
Merge pull request #28 from FrantisekGazo/develop
Browse files Browse the repository at this point in the history
mvp fixes
  • Loading branch information
FrantisekGazo authored Mar 11, 2017
2 parents 0bc86d1 + 11d639f commit 1daabb5
Show file tree
Hide file tree
Showing 78 changed files with 2,691 additions and 1,440 deletions.
13 changes: 2 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,13 @@ android:
- tools

# The BuildTools version used by your project
- build-tools-23.0.2
- build-tools-25.0.1

# The SDK version used to compile your project
- android-23
- android-25

# Additional components
#- extra-google-google_play_services
#- extra-google-m2repository
- extra-android-m2repository
- extra-android-support
#- addon-google_apis-google-19

# Specify at least one system image,
# if you need to run emulator(s) during your tests
#- sys-img-armeabi-v7a-android-19
#- sys-img-x86-android-17

install:
- ./gradlew install
Expand Down
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.2 *(2017-03-11)*
----------------------------

* Fix: Processing of `@Inject` annotations for `mvp` module

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

Expand Down
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ allprojects {
mavenLocal()
}

// this is needed for running plugin tests
configurations.all {
resolutionStrategy {
force 'org.codehaus.groovy:groovy-all:2.4.4'
}
}

if (!['Blade', 'sample', 'module'].contains(project.name)) {

println " --> $project.name "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import spock.lang.Specification
import eu.f3rog.blade.compiler.BladeProcessor

import javax.tools.JavaFileObject
import javax.tools.StandardLocation

public abstract class BaseSpecification
extends Specification {
Expand Down Expand Up @@ -39,4 +40,20 @@ public abstract class BaseSpecification
.processedWith(new BladeProcessor(processorModules))
}
}

protected boolean compilesWithoutErrorAndDoesntGenerate(String pkg,
String className,
BladeProcessor.Module module,
JavaFileObject... inputFiles) {
try {
assertFiles(inputFiles)
.with(module)
.compilesWithoutError()
.and()
.generatesFileNamed(StandardLocation.CLASS_OUTPUT, pkg, className + '.class')
return false
} catch (AssertionError e) {
return e.getMessage().contains("Did not find a generated file corresponding to ${className}.class in package ${pkg}")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,8 @@ public final class ArgHelperSpecification
)

expect:
try {
assertFiles(input)
.with(BladeProcessor.Module.ARG)
.compilesWithoutError()
.and()
.generatesFileNamed(StandardLocation.CLASS_OUTPUT, "com.example", "MyFragment_Helper.class")
} catch (AssertionError e) {
assert e.getMessage().contains("Did not find a generated file corresponding to MyFragment_Helper.class in package com.example")
}
compilesWithoutErrorAndDoesntGenerate("com.example", "MyFragment_Helper",
BladeProcessor.Module.ARG, input)
}

def "generate _Helper for a Fragment with 2 @Arg"() {
Expand Down
Loading

0 comments on commit 1daabb5

Please sign in to comment.