This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'pmd' | |
task pmd(type: Pmd) { | |
ruleSetFiles = files("$project.rootDir/tools/rules-pmd.xml") | |
source = fileTree('src/main/java/') | |
reports { | |
xml.enabled = false | |
html.enabled = true | |
html.destination = "$project.buildDir/outputs/pmd/pmd.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FindBugsFilter> | |
<Bug pattern="SF_SWITCH_NO_DEFAULT" /> | |
<Bug pattern="SF_SWITCH_FALLTHROUGH" /> | |
</FindBugsFilter> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MainActivity.java | |
... | |
private void someMethod(int variable) { | |
switch (variable) { | |
case 1: | |
System.out.println("1"); | |
case 2: | |
System.out.println("2"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
apply from: "$project.rootDir/tools/script-findbugs.gradle" | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'findbugs' | |
task findbugs(type: FindBugs) { | |
excludeFilter = file("$project.rootDir/tools/rules-findbugs.xml") | |
classes = fileTree("$project.buildDir/intermediates/classes/dev/debug/com/dd") | |
source = fileTree("$project.rootDir/src/main/java/com/dd/") | |
classpath = files() | |
reports { | |
xml.enabled = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<lint> | |
<issue id="GoogleAppIndexingWarning" severity="ignore" /> | |
</lint> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
apply from: "$project.rootDir/tools/script-lint.gradle" | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
lintOptions { | |
lintConfig file("$project.rootDir/tools/rules-lint.xml") | |
htmlOutput file("$project.buildDir/outputs/lint/lint.html") | |
warningsAsErrors true | |
xmlReport false | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test 1 | |
for (int i = 0; i < 10; i++) { | |
// spawn new thread which call queryNoTransaction() | |
} | |
void queryNoTransaction() { | |
try (Realm realm = Realm.getDefaultInstance()) { | |
long start = System.currentTimeMillis(); | |
RealmResults<UserProfile> users = realm.where(UserProfile.class).findAll(); | |
List<UserProfile> userCopy = realm.copyFromRealm(users); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add project specific ProGuard rules here. | |
-dontobfuscate | |
-dontoptimize | |
-ignorewarnings |