Skip to content

Commit

Permalink
Merge pull request #5 from AdamKobus/ST-142
Browse files Browse the repository at this point in the history
ST-142 QA Tools are now optional
  • Loading branch information
rainqer authored Jul 11, 2016
2 parents 4f4d748 + 160fa6f commit 9eb4fb6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ buildscript {
}
}
dependencies {
classpath 'com.infullmobile:toolkit:0.3.12'
classpath 'com.infullmobile:toolkit:0.3.14'
}
}
```
Expand Down Expand Up @@ -195,7 +195,7 @@ If set to false, Java 1.7 will be used.
Right now FindBugs won't be executed for Java 1.8 projects

#### appendVersionNameToAPK
Default: `true`
Default: `false`

If set to true, APK output file names will be modified by appending `versionName` to them.

Expand Down Expand Up @@ -421,6 +421,11 @@ Where:
- `key.store.password` - password for your keystore file
- `key.alias.password` - password to your alias

#### runQAToolsInTests
Default: `false`

If true, FindBugs and Checkstyle will be executed for test source sets / variants.

### Example toolkit.properties file content

```
Expand Down Expand Up @@ -455,6 +460,7 @@ appendVersionNameToAPK=false
configureMisc=true
configureCustomFunctions=true
runQAToolsInTests=true
```

## Planned work
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ToolkitConfiguration {
def boolean configureFabric = true;
def boolean configureCoverage = false
def boolean useJava8 = false;
def boolean appendVersionNameToAPK = true;
def boolean appendVersionNameToAPK = false;
def boolean configureTests = true;

def boolean configureCheckstyle = true;
Expand All @@ -41,6 +41,8 @@ class ToolkitConfiguration {
def boolean configureMisc = true;
def boolean configureCustomFunctions = true;

boolean runQAToolsInTests = false;

// tools version settings
def Integer compileSdkVersion;
def String buildToolsVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class ConfigureCheckstyleForVariant extends IVariantConfigCommand {
variantConfigurator.config.checkstyleConfig.addTaskDependencies(this, it)
variantWrapper.baseTask.dependsOn it
}
if (variantConfigurator.config.runQAToolsInTests) {
addCheckstyleToTestVariants(checkstyleConfig, variantConfigurator)
}
}

protected addCheckstyleToTestVariants(File checkstyleConfig, VariantConfigurator variantConfigurator) {
variantWrapper.testVariants.each { testVariant ->
configuredProject.task("checkstyle${variantWrapper.fullName.capitalize()}${testVariant.typeName.capitalize()}",
type: Checkstyle) {
Expand All @@ -63,14 +69,16 @@ class ConfigureCheckstyleForVariant extends IVariantConfigCommand {
ignoreFailures variantConfigurator.config.ignoreCheckstyleFailures

reports.xml.enabled true
reports.xml.destination "${variantConfigurator.config.checkstyleReportDir}/${variantWrapper.fullName}-${testVariant.typeName}.xml"
reports.xml.destination "${variantConfigurator.config.checkstyleReportDir}/" +
"${variantWrapper.fullName}-${testVariant.typeName}.xml"
reports.html.enabled true
reports.html.destination "${variantConfigurator.config.checkstyleReportDir}/${variantWrapper.fullName}-${testVariant.typeName}.html"

reports.html.destination "${variantConfigurator.config.checkstyleReportDir}/" +
"${variantWrapper.fullName}-${testVariant.typeName}.html"
logging.setLevel(LogLevel.LIFECYCLE)
variantConfigurator.config.checkstyleConfig.addTaskDependencies(this, it)
variantWrapper.baseTask.dependsOn it
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class ConfigureFindbugsInVariant extends IVariantConfigCommand {
configureFindbugsTask(it, variantConfigurator);
}

if(config.runQAToolsInTests) {
configureTestVariants(variantConfigurator);
}
}

def configureTestVariants(VariantConfigurator variantConfigurator) {
variantConfigurator.variantWrapper.testVariants.each { TestVariantWrapper testVariant ->
configuredProject.task("findbugs${variantWrapper.fullName.capitalize()}${testVariant.typeName.capitalize()}",
type: FindBugs,
Expand Down

0 comments on commit 9eb4fb6

Please sign in to comment.