commit
018a8231d6
@ -8,6 +8,7 @@ test:
|
|||||||
- cd ..
|
- cd ..
|
||||||
- ./gradlew build
|
- ./gradlew build
|
||||||
- ./gradlew checkstyle
|
- ./gradlew checkstyle
|
||||||
|
- ./gradlew pmd
|
||||||
- echo no | android create avd --force -n fcl-test -t android-10 -b armeabi
|
- echo no | android create avd --force -n fcl-test -t android-10 -b armeabi
|
||||||
- emulator -force-32bit -avd fcl-test -no-skin -no-audio -no-window &
|
- emulator -force-32bit -avd fcl-test -no-skin -no-audio -no-window &
|
||||||
- ./tools/wait-for-emulator
|
- ./tools/wait-for-emulator
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'witness'
|
apply plugin: 'witness'
|
||||||
apply plugin: 'checkstyle'
|
apply plugin: 'checkstyle'
|
||||||
|
apply plugin: 'pmd'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
@ -203,11 +204,29 @@ task checkstyle(type: Checkstyle) {
|
|||||||
configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml")
|
configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml")
|
||||||
source 'src', 'test/src'
|
source 'src', 'test/src'
|
||||||
include '**/*.java'
|
include '**/*.java'
|
||||||
exclude '**/gen/**'
|
|
||||||
|
|
||||||
classpath = files()
|
classpath = files()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pmd {
|
||||||
|
toolVersion = '5.4.1'
|
||||||
|
consoleOutput = true
|
||||||
|
}
|
||||||
|
|
||||||
|
task pmd(type: Pmd, dependsOn: assembleDebug) {
|
||||||
|
ruleSets = [
|
||||||
|
//'java-basic',
|
||||||
|
//'java-unusedcode',
|
||||||
|
'java-android',
|
||||||
|
'java-clone',
|
||||||
|
'java-finalizers',
|
||||||
|
'java-imports',
|
||||||
|
'java-migrating',
|
||||||
|
]
|
||||||
|
source 'src'
|
||||||
|
include '**/org/fdroid/**/*.java'
|
||||||
|
}
|
||||||
|
|
||||||
// This person took the example code below from another blogpost online, however
|
// This person took the example code below from another blogpost online, however
|
||||||
// I lost the reference to it:
|
// I lost the reference to it:
|
||||||
// http://stackoverflow.com/questions/23297562/gradle-javadoc-and-android-documentation
|
// http://stackoverflow.com/questions/23297562/gradle-javadoc-and-android-documentation
|
||||||
|
@ -176,6 +176,7 @@ public class FDroidApp extends Application {
|
|||||||
@TargetApi(9)
|
@TargetApi(9)
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
if (Build.VERSION.SDK_INT >= 9 && BuildConfig.DEBUG) {
|
if (Build.VERSION.SDK_INT >= 9 && BuildConfig.DEBUG) {
|
||||||
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||||
.detectAll()
|
.detectAll()
|
||||||
@ -187,7 +188,6 @@ public class FDroidApp extends Application {
|
|||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
updateLanguage();
|
updateLanguage();
|
||||||
super.onCreate();
|
|
||||||
ACRA.init(this);
|
ACRA.init(this);
|
||||||
|
|
||||||
// Needs to be setup before anything else tries to access it.
|
// Needs to be setup before anything else tries to access it.
|
||||||
|
@ -595,12 +595,12 @@ public class SwapService extends Service {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
|
||||||
Utils.debugLog(TAG, "Destroying service, will disable swapping if required, and unregister listeners.");
|
Utils.debugLog(TAG, "Destroying service, will disable swapping if required, and unregister listeners.");
|
||||||
disableAllSwapping();
|
disableAllSwapping();
|
||||||
Preferences.get().unregisterLocalRepoHttpsListeners(httpsEnabledListener);
|
Preferences.get().unregisterLocalRepoHttpsListeners(httpsEnabledListener);
|
||||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(onWifiChange);
|
LocalBroadcastManager.getInstance(this).unregisterReceiver(onWifiChange);
|
||||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(receiveSwapStatusChanged);
|
LocalBroadcastManager.getInstance(this).unregisterReceiver(receiveSwapStatusChanged);
|
||||||
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Notification createNotification() {
|
private Notification createNotification() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user