forked from Tencent/tinker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. move TinkerApplication get* method to ApplicationLIke
2. add pmd and findbug check 3. wait dexOpt file generate when patching 4. add TInkerLoadLibrary file to load patch library easier 5. reformat code
- Loading branch information
1 parent
c741ff5
commit 3fdaead
Showing
28 changed files
with
536 additions
and
268 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<FindBugsFilter> | ||
|
||
<Match> | ||
<Class name="~.*R\$.*" /> | ||
</Match> | ||
<Match> | ||
<Class name="~.*Manifest\$.*" /> | ||
</Match> | ||
</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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
apply plugin: 'checkstyle' | ||
|
||
|
||
checkstyle { | ||
configFile rootProject.file('checkstyle.xml') | ||
toolVersion '6.19' | ||
ignoreFailures false | ||
showViolations true | ||
} | ||
|
||
task('checkstyle', type: Checkstyle) { | ||
source 'src/main/java' | ||
include '**/*.java' | ||
classpath = files() | ||
} | ||
|
||
check.dependsOn('checkstyle') | ||
|
||
|
||
apply plugin: 'pmd' | ||
apply plugin: 'findbugs' | ||
|
||
pmd { | ||
toolVersion '5.4.0' | ||
} | ||
|
||
task pmd(type: Pmd) { | ||
targetJdk = TargetJdk.VERSION_1_7 | ||
|
||
description 'Run pmd' | ||
group 'verification' | ||
|
||
// If ruleSets is not empty, it seems to contain some | ||
// defaults which override rules in the ruleset file... | ||
ruleSets = [] | ||
ruleSetFiles = rootProject.files('pmd-ruleset.xml') | ||
source = fileTree('src/main/java') | ||
ignoreFailures = false | ||
|
||
reports { | ||
xml.enabled = false | ||
html.enabled = true | ||
} | ||
} | ||
def classTree = 'build/intermediates/classes/debug' | ||
|
||
if (project.plugins.hasPlugin('java')) { | ||
classTree = 'build/classes' | ||
} | ||
task findbugs(type: FindBugs) { | ||
|
||
description 'Run findbugs' | ||
group 'verification' | ||
|
||
classes = fileTree(classTree) | ||
source = fileTree('src/main/java/') | ||
classpath = files() | ||
|
||
effort = 'max' | ||
|
||
excludeFilter = rootProject.file("findbugs-exclude.xml") | ||
|
||
reports { | ||
xml.enabled = false | ||
html.enabled = true | ||
} | ||
ignoreFailures = false | ||
} | ||
|
||
//depend check | ||
check.dependsOn('pmd') | ||
check.dependsOn('findbugs') |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
<ruleset name="PMD.rul" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> | ||
|
||
<description>This ruleset was created from PMD.rul</description> | ||
|
||
<rule ref="rulesets/java/basic.xml"> | ||
<exclude name="AvoidBranchingStatementAsLastInLoop"/> | ||
</rule> | ||
<rule ref="rulesets/java/braces.xml"/> | ||
<rule ref="rulesets/java/strings.xml"> | ||
<!-- TODO: This warns about annotations, apparently fixed in a later version. --> | ||
<exclude name="AvoidDuplicateLiterals"/> | ||
</rule> | ||
<rule ref="rulesets/java/unusedcode.xml"/> | ||
|
||
<rule ref="rulesets/java/design.xml"> | ||
<exclude name="ConfusingTernary"/> | ||
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/> | ||
<exclude name="AvoidSynchronizedAtMethodLevel"/> | ||
|
||
<!-- This check breaks on double checked locking which is safe in Java 6/7 --> | ||
<exclude name="NonThreadSafeSingleton"/> | ||
<!-- This check breaks the builder pattern, I didn't find the solution--> | ||
<exclude name="AccessorClassGeneration"/> | ||
<!-- TODO: Fix these --> | ||
<exclude name="AvoidReassigningParameters"/> | ||
<exclude name="GodClass"/> | ||
|
||
</rule> | ||
|
||
<rule ref="rulesets/java/design.xml/AvoidDeeplyNestedIfStmts"> | ||
<properties> | ||
<property name="problemDepth" value="5"/> | ||
</properties> | ||
</rule> | ||
|
||
<rule message="Commented blocks are ok" ref="rulesets/java/empty.xml/EmptyCatchBlock"> | ||
<properties> | ||
<property name="allowCommentedBlocks" value="true"/> | ||
</properties> | ||
</rule> | ||
</ruleset> |
Oops, something went wrong.