Skip to content

Commit

Permalink
Fix CI Build πŸ’š
Browse files Browse the repository at this point in the history
- Upgrade CI JDK version to 11
- Code clean up
  • Loading branch information
ndegwamartin committed Jun 24, 2022
1 parent 619b201 commit e385c8f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}
- name: Grant execute permission for gradlew
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.smartregister.location.helper.LocationHelper;
import org.smartregister.path.R;
import org.smartregister.path.fragment.ChildRegistrationDataFragment;
import org.smartregister.path.repository.ZeirVaccineOverdueCountRepository;
import org.smartregister.path.util.AppConstants.KeyConstants;
import org.smartregister.path.util.AppJsonFormUtils;
import org.smartregister.path.util.AppUtils;
Expand Down Expand Up @@ -299,6 +298,6 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {

@Override
public void updateViews() {

//Do nothing??
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.smartregister.path.application;

import android.content.Intent;
import android.os.StrictMode;
import android.util.Pair;

import androidx.annotation.VisibleForTesting;
Expand Down Expand Up @@ -518,6 +517,7 @@ public String getSyncLocations() {
return LocationHelper.getInstance().locationIdsFromHierarchy();
return "";
}

public AppExecutors getAppExecutors() {
if (appExecutors == null) {
appExecutors = new AppExecutors();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.smartregister.path.activity.ChildRegisterActivity;
import org.smartregister.path.model.ChildRegisterFragmentModel;
import org.smartregister.path.presenter.ChildRegisterFragmentPresenter;
import org.smartregister.path.repository.ZeirVaccineOverdueCountRepository;
import org.smartregister.path.repository.VaccineOverdueCountRepositoryHelper;
import org.smartregister.path.util.DBQueryHelper;
import org.smartregister.view.activity.BaseRegisterActivity;

Expand Down Expand Up @@ -233,7 +233,7 @@ private void runVaccineOverdueQuery() {
executors.diskIO().execute(() -> {
Timber.d("Started running the overdue count query");

int overDueCount = ZeirVaccineOverdueCountRepository.getOverdueCount();
int overDueCount = VaccineOverdueCountRepositoryHelper.getOverdueCount();
setOverDueCount(overDueCount);

Timber.d("Gotten the overdue count: " + overDueCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.smartregister.path.activity.ChildFormActivity;
import org.smartregister.path.contract.ChildFormContract;
import org.smartregister.path.fragment.AppChildFormFragment;
import org.smartregister.path.interactor.ChildFormInteractor;
import org.smartregister.path.util.AppConstants;

import timber.log.Timber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import org.smartregister.immunization.ImmunizationLibrary;
import org.smartregister.immunization.repository.VaccineOverdueCountRepository;

public class ZeirVaccineOverdueCountRepository {
/**
* Helper class with migration script for the new Overdue counter implementation (MIGRATE_VACCINES_QUERY)
* plus the query to efficiently count the overdue alerts (COUNT_QUERY_SQL)
*/
public class VaccineOverdueCountRepositoryHelper {

public static final String MIGRATE_VACCINES_QUERY = "INSERT INTO vaccine_overdue_count SELECT DISTINCT ec_child_details.id FROM alerts a INNER JOIN ec_child_details ON a.caseID = ec_child_details.id INNER JOIN ec_client ON a.caseID = ec_client.base_entity_id \n" +
"WHERE (ec_client.dod IS NULL AND ec_client.date_removed IS NULL AND ec_client.is_closed IS NOT '1' AND ec_child_details.is_closed IS NOT '1') \n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ private void upgradeToVersion20(SQLiteDatabase db) {

try {
db.execSQL(VaccineOverdueCountRepository.CREATE_TABLE_SQL);
db.execSQL(ZeirVaccineOverdueCountRepository.MIGRATE_VACCINES_QUERY);
db.execSQL(VaccineOverdueCountRepositoryHelper.MIGRATE_VACCINES_QUERY);
} catch (Exception e) {
Timber.e(e);
}
Expand Down

0 comments on commit e385c8f

Please sign in to comment.