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"?> | |
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
name="Android Application Rules" | |
xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd" | |
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
<exclude-pattern>.*/R.java</exclude-pattern> | |
<exclude-pattern>.*/gen/.*</exclude-pattern> |
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
FAILURE: Build failed with an exception. | |
* What went wrong: | |
Execution failed for task ‘:app:pmd’. | |
> 1 PMD rule violations were found. See the report at: file:///Users/rafael/Project/quality-tools/app/build/reports/findbugs/findbugs.html | |
* Try: | |
Run with — stacktrace option to get the stack trace. Run with — info or — debug option to get more log output. | |
BUILD FAILED |
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
lint --list |
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 { | |
disable 'InvalidPackage' | |
} | |
} |
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="InvalidPackage" 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
android { | |
lintConfig { | |
lintConfig file("${project.rootDir}/config/lint.xml") | |
} | |
} |
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
public class MainActivity extends AppCompatActivity implements View.OnClickListener { | |
private TextView text; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
findViewById(R.id.button).setOnClickListener(this); |
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"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
<TextView | |
android:id="@+id/text" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" |
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
@RunWith(AndroidJUnit4.class) | |
@LargeTest | |
public class MainActivityTest { | |
@Rule | |
public ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class); | |
@Test | |
public void shouldUpdateTextAfterButtonClick() { | |
onView(withId(R.id.button)).perform(click()); |
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 { | |
... | |
buildTypes { | |
debug { | |
testCoverageEnabled true | |
} | |
... | |
} | |
} |